Successfully find a better workaround to take advantage of delete_accepted_egress_direct_flow in _unbind_distributed_router_interface_port [1].
# eg: mac of the old snat-xxx port is fa:16:3e:7a:11:7d
neutron router-interface-delete provider-router $(openstack subnet show private_subnet -cid -fvalue)
# eg: mac of the new snat-xxx port is fa:16:3e:e6:f9:b2
neutron router-interface-add provider-router $(openstack subnet show private_subnet -cid -fvalue)
openstack port list --device-owner network:router_centralized_snat
Successfully find a better workaround to take advantage of delete_ accepted_ egress_ direct_ flow in _unbind_ distributed_ router_ interface_ port [1].
# eg: mac of the old snat-xxx port is fa:16:3e:7a:11:7d interface- delete provider-router $(openstack subnet show private_subnet -cid -fvalue) interface- add provider-router $(openstack subnet show private_subnet -cid -fvalue) router_ centralized_ snat
neutron router-
# eg: mac of the new snat-xxx port is fa:16:3e:e6:f9:b2
neutron router-
openstack port list --device-owner network:
The code path is:
process_ deleted_ ports -> port_unbound -> unbind_ port_from_ dvr -> _unbind_ centralized_ snat_port_ on_dvr_ subnet -> delete_ accepted_ egress_ direct_ flow
The egress direct flow for the old snat-xxx port won't disappear
# ovs-ofctl dump-flows br-int |grep fa:16:3e:7a:11:7d |grep -E 'priority= 12|priority= 10' 0x59874eed7c9fa 42a, duration= 76882.302s, table=94, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority= 12,reg6= 0x1,dl_ dst=fa: 16:3e:7a: 11:7d actions=output:16 0x59874eed7c9fa 42a, duration= 76882.302s, table=94, n_packets=0, n_bytes=0, idle_age=65534, hard_age=65534, priority= 10,reg6= 0x1,dl_ src=fa: 16:3e:7a: 11:7d,dl_ dst=00: 00:00:00: 00:00/01: 00:00:00: 00:00 actions= mod_vlan_ vid:1,output: 2
cookie=
cookie=
but the egress direct flow won't produce as well
# ovs-ofctl dump-flows br-int |grep 'fa:16:3e:e6:f9:b2' |grep -E 'priority= 12|priority= 10'
So north-south traffic will resume to work again.
# ip netns exec snat-10140acd- 28e6-4110- ae67-76115b72b3 7c ping -c1 192.168.21.114
PING 192.168.21.114 (192.168.21.114) 56(84) bytes of data.
64 bytes from 192.168.21.114: icmp_seq=1 ttl=64 time=1.86 ms
[1] https:/ /review. opendev. org/c/openstack /neutron/ +/704506/ 1/neutron/ plugins/ ml2/drivers/ openvswitch/ agent/ovs_ dvr_neutron_ agent.py# 678