The OVSCookieBridge class does properly the job of applying the extension-specific cookie when calls are made to add_flow/mod_flow/delete_flows.
However if methods that call self.add/mod/delete_flow() are called on an OVSCookieBridge instance, the call will be passed to the underlying bridge and the implementation in the underlying bridge will call its own add_flow method that is not cookie aware, and the extension-specific cookie will not be applied.
Better with an example:
Assuming:
- a = ovs_ofctl.br_tun.OVSTunnelBridge(...)
- c = OVSCookieBridge(a)
Then calling c.install_arp_responder(...) will result in :
- c.bridge.install_arp_responder(...)
- -> a.install_arp_responder(...)
- -> ovs_ofctl.br_tun.OVSTunnelBridge.install_arp_responder(a, ...)
- ...
- -> a.add_flow( ... ) [1]
And the cookie will not be applied because the cookie-aware add_flow method is in c, not in a.
This topic was discussed on IRC [2]
A second, related, issue is that OVSBridge subclasses touching flows with methods other than add/mod/delete_flow are not taking cookie into account at all. This is the case for instance of openflow.br_tun.OVSTunnelBridge.install_arp_responder, e.g. [3].
[1] https://github.com/openstack/neutron/blob/c44dc073fb9abd91fdcc6713b7191872f8130227/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/ovs_ofctl/br_tun.py#L197
[2] http://eavesdrop.openstack.org/irclogs/%23openstack-neutron/%23openstack-neutron.2016-03-11.log.html#t2016-03-11T09:11:54
[3] https://github.com/openstack/neutron/blob/c44dc073fb9abd91fdcc6713b7191872f8130227/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_tun.py#L220
Needs refactoring and fixes. I've gone through the discussion on IRC between tmorin, ihrachys and ajo.
I will work on this.