[Bug 221122] Attaching interface to a bridge stops all traffic on uplink NIC for few seconds

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 01 Sep 2023 02:40:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221122

--- Comment #34 from spork@bway.net ---
The answer to "when did interface capabilities get restored when a member is
removed" is "back in 2008".

This commit altered how interface flags were dealt with: 

https://cgit.freebsd.org/src/commit/sys/net/if_bridge.c?id=ec29c623005ca6a32d44fb59bc2a759a96dc75e4

You can see a variable "bif_savedcaps" was added so that the bridge now tracks
what the original interface flags were.

Then when a member is removed, it looks like all of a bridge's interfaces are
looped through and the original flags are restored (in bridge_delete_member()):

+               /* reneable any interface capabilities */
+               bridge_set_ifcap(sc, bif, bif->bif_savedcaps);

Not sure where, but this kind of feels like it could be a tunable, like
"net.link.bridge.restore_caps" or similar, given a) jails will trigger this
with lots of NICs b) these days 5 seconds of downtime is actually not a minor
issue in many environments and c) it need not change any defaults, but
rc.d/jail and 3rd party jail scripts could opt to set it d) jails are kind of a
big reason people come to FreeBSD.

I'm not much of a coder, but I could get that sysctl like 80% there I think
after looking at the other "net.link.bridge" tunables... any takers on helping?
Any thoughts on whether this makes sense?

-- 
You are receiving this mail because:
You are the assignee for the bug.