Skip to content

Commit be2b057

Browse files
committed
tests: Set stable datapath-id on bridges in system tests.
When a port with a globally-administered MAC address (e.g., 00:00:00:00:00:04) is added to br-int, OVS may recalculate the bridge datapath ID if no explicit datapath-id is configured. The new DPID causes OVS to tear down all OpenFlow connections to the bridge, since there is no OpenFlow message to notify the controller of a DPID change. This triggers ovn-controller's ofctrl_seqno_flush(), which resets the internal sequence counter to 0. If a flow update from before the reconnection is still in-flight, ofctrl_put() detects that the new req_cfg is smaller than the pending one and emits "req_cfg regressed from 2 to 1". Fix this by deriving a stable other-config:datapath-id from the bridge name in the ADD_BR macro. This ensures the DPID never changes when ports are added or removed, preventing spurious OpenFlow reconnections during tests. Assisted-by: Claude Opus 4.6, OpenCode Signed-off-by: Ales Musil <amusil@redhat.com>
1 parent f6e58e2 commit be2b057

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/system-common-macros.at

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ m4_define([NS_CHECK_EXEC],
4242
#
4343
# Expands into the proper ovs-vsctl commands to create a bridge with the
4444
# appropriate type, and allows additional arguments to be passed.
45-
m4_define([ADD_BR], [ovs-vsctl _ADD_BR([$1]) -- $2])
45+
# A stable datapath-id derived from the bridge name is set.
46+
m4_define([ADD_BR],
47+
[dpid=$(printf '%016x' $(echo '$1' | cksum | cut -d ' ' -f1))
48+
ovs-vsctl _ADD_BR([$1]) -- set Bridge $1 other-config:datapath-id="$dpid" -- $2])
4649

4750
# ADD_VETH([port], [namespace], [ovs-br], [ip_addr] [mac_addr], [gateway],
4851
# [ip_addr_flags] [ip6_addr] [gateway6])

0 commit comments

Comments
 (0)