Description of problem: fail to ping in ls-lr-ls topo after set requested-tnl-key for logical switch Version-Release number of selected component (if applicable): ovn2.13-20.06.1-6.el8fdp.x86_64 How reproducible: Always Steps to Reproduce: server: #!/bin/bash systemctl start openvswitch systemctl start ovn-northd ovn-nbctl set-connection ptcp:6641 ovn-sbctl set-connection ptcp:6642 ovs-vsctl set open . external_ids:system-id=hv1 external_ids:ovn-remote=tcp:20.0.31.25:6642 external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip=20.0.31.25 systemctl restart ovn-controller ovn-nbctl ls-add ls1 ovn-nbctl lsp-add ls1 ls1p1 ovn-nbctl lsp-set-addresses ls1p1 "00:00:00:01:01:02 192.168.1.1" ovn-nbctl ls-add ls2 ovn-nbctl lsp-add ls2 ls2p1 ovn-nbctl lsp-set-addresses ls2p1 "00:00:00:01:02:02 192.168.2.1" ovn-nbctl lr-add lr1 ovn-nbctl lrp-add lr1 lr1-ls1 00:de:ad:ff:01:01 192.168.1.254/24 ovn-nbctl lrp-add lr1 lr1-ls2 00:de:ad:ff:01:02 192.168.2.254/24 ovn-nbctl lsp-add ls1 ls1-lr1 ovn-nbctl lsp-set-type ls1-lr1 router ovn-nbctl lsp-set-addresses ls1-lr1 00:de:ad:ff:01:01 ovn-nbctl lsp-set-options ls1-lr1 router-port=lr1-ls1 ovn-nbctl lsp-add ls2 ls2-lr1 ovn-nbctl lsp-set-type ls2-lr1 router ovn-nbctl lsp-set-addresses ls2-lr1 00:de:ad:ff:01:02 ovn-nbctl lsp-set-options ls2-lr1 router-port=lr1-ls2 ovs-vsctl add-port br-int p1 -- set interface p1 type=internal ip netns add p1 ip link set p1 netns p1 ip netns exec p1 ip link set p1 address 00:00:00:01:01:02 ip netns exec p1 ip link set p1 up ip netns exec p1 ip addr add 192.168.1.1/24 dev p1 ip netns exec p1 ip route add default via 192.168.1.254 dev p1 ovs-vsctl set interface p1 external_ids:iface-id=ls1p1 client: #!/bin/bash systemctl start openvswitch ovs-vsctl set open . external_ids:system-id=hv0 external_ids:ovn-remote=tcp:20.0.31.25:6642 external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip=20.0.31.26 systemctl restart ovn-controller ovs-vsctl add-port br-int p2 -- set interface p2 type=internal ip netns add p2 ip link set p2 netns p2 ip netns exec p2 ip link set p2 address 00:00:00:01:02:02 ip netns exec p2 ip link set p2 up ip netns exec p2 ip addr add 192.168.2.1/24 dev p2 ip netns exec p2 ip route add default via 192.168.2.254 dev p2 ovs-vsctl set interface p2 external_ids:iface-id=ls2p1 # server [root@dell-per740-12 test]# ovn-nbctl set logical_switch ls1 other_config:requested-tnl-key=16777215 [root@dell-per740-12 test]# ovn-nbctl --wait=hv sync [root@dell-per740-12 test]# ip netns exec p1 ping 192.168.2.1 -c 1 PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data. --- 192.168.2.1 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms <== failed Actual results: ping failed Expected results: ping should pass Additional info: if recompute for ovn-controller with "ovn-appctl -t ovn-controller recompute" on both side, ping would pass [root@dell-per740-12 test]# rpm -qa | grep -E "openvswitch|ovn" ovn2.13-20.06.1-6.el8fdp.x86_64 ovn2.13-central-20.06.1-6.el8fdp.x86_64 openvswitch2.13-2.13.0-54.el8fdp.x86_64 ovn2.13-host-20.06.1-6.el8fdp.x86_64 kernel-kernel-networking-openvswitch-ovn-common-1.0-7.noarch python3-openvswitch2.13-2.13.0-54.el8fdp.x86_64 openvswitch-selinux-extra-policy-1.0-23.el8fdp.noarch
In ovn2.13-host-20.12.0-195.el8fdp.x86_64, ping works after set the requested-tnl-key for ls. However in ovn-2021-21.12.0-30.el8fdp.x86_64, the requested-tnl-key is also set for the first time but if the tnl-key value is selected which was previously used, then it fails to ping until ovn-controller recompute. for normal_val in 1 12345 16777215 1 do ovn-nbctl set logical_switch ls1 other_config:requested-tnl-key=$normal_val ovn-nbctl --wait=hv sync ovn-sbctl find datapath_binding external_ids:name=ls1 | grep tunnel_key | grep $normal_val ip netns exec p1 ping 192.168.2.1 -c 1 done In the last iteration of the loop, the ping failed because 1 was already used previously as requested-tnl-key.