Hi Ales

Thanks for the patch

Patch looks good to me.
I was initially wondering whether OVN should reactively fix this instead
(i.e., detect a missing hwaddr/datapath-id and add it) since it already
sets the hwaddr when creating br-int.
However, I guess it's better not to do that: either OVN creates br-int and
manages datapath-id, or CMS creates br-int and is responsible for the
datapath-id.

So,
Acked-by: Xavier Simonart <[email protected]>

Thanks
Xavier


On Mon, Jun 8, 2026 at 11:54 AM Ales Musil <[email protected]> wrote:

> 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 <[email protected]>
> ---
>  tests/system-common-macros.at | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
> index b32fc0b68..b8237b483 100644
> --- a/tests/system-common-macros.at
> +++ b/tests/system-common-macros.at
> @@ -42,7 +42,10 @@ m4_define([NS_CHECK_EXEC],
>  #
>  # Expands into the proper ovs-vsctl commands to create a bridge with the
>  # appropriate type, and allows additional arguments to be passed.
> -m4_define([ADD_BR], [ovs-vsctl _ADD_BR([$1]) -- $2])
> +# A stable datapath-id derived from the bridge name is set.
> +m4_define([ADD_BR],
> +  [dpid=$(printf '%016x' $(echo '$1' | cksum | cut -d ' ' -f1))
> +   ovs-vsctl _ADD_BR([$1]) -- set Bridge $1
> other-config:datapath-id="$dpid" -- $2])
>
>  # ADD_VETH([port], [namespace], [ovs-br], [ip_addr] [mac_addr], [gateway],
>  #          [ip_addr_flags] [ip6_addr] [gateway6])
> --
> 2.54.0
>
>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to