From e08233696816431b3f536bc556928491ecd14e2f Mon Sep 17 00:00:00 2001 From: Miguel Angel Ajo Date: Wed, 9 May 2018 16:23:41 +0200 Subject: [PATCH] Don't delete flows on ports which were on dead vlan during plug Ocata codebase of the neutron agent deletes_flows when a port has been tagged and already had a tag. Later versions implement uninstall_flows to selectively delete specific flows, but such patches are big and buggy (have several follow up patches). This prevents that the patch handling 1767422 will get the DSCP flows deleted when port is tagged. Which is detected by functional testing. I have manually tested that setting a port admin_state_up False, and then True, will correctly move the port into dead vlan, and then back to non dead vlan, and properly remove the in_port=x,DROP openflow rule regardless of this change. Related: rhbz#1575706 Related-Bug: 1767422 Change-Id: Ib7915ae7bb7f471ff70ce25ce3beb16189ad5394 --- .../plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py index 60065f7bc33..2a829bd470b 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py @@ -828,7 +828,8 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin, self.int_br.set_db_attribute( "Port", port.port_name, "other_config", other_config) # Uninitialized port has tag set to [] - if cur_info['tag']: + if (cur_info['tag'] and + cur_info['tag'] != constants.DEAD_VLAN_TAG): self.int_br.delete_flows(in_port=port.ofport) def _bind_devices(self, need_binding_ports):