Page MenuHomeFreeBSD

lagg: re-check port caps after bringing up a port
ClosedPublic

Authored by gallatin on Jul 6 2026, 6:55 PM.
Tags
None
Referenced Files
F165846148: D58062.diff
Mon, Aug 10, 5:30 AM
Unknown Object (File)
Mon, Aug 10, 1:52 AM
Unknown Object (File)
Sun, Aug 9, 9:42 AM
Unknown Object (File)
Sun, Aug 9, 2:31 AM
Unknown Object (File)
Sat, Aug 8, 6:01 PM
Unknown Object (File)
Sat, Aug 8, 9:25 AM
Unknown Object (File)
Sat, Aug 8, 7:07 AM
Unknown Object (File)
Sun, Aug 2, 3:33 PM
Subscribers

Details

Summary

Some nic drivers (including iflib) do not initialize if_hwassist until after the interface is brought up.
If a lagg member is included in a lagg when its not yet been brought up, that will cause lagg to see
if_hwassist=0 and will disable all checksum offload, etc, on the interface. This is almost impossible
to debug without kgdb or dtrace, as ifconfig does not surface if_hwassist.

Fix this by re-calculating lagg caps (including if_hwassist) after adding a port.

I encountered this problem when I had a commented-out if_foo1=up entry in my rc.conf that i neglected
to uncomment when I was re-configuring a lagg.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added inline comments.
sys/net/if_lagg.c
1313

Maybe this should be done in lagg_if_updown()?

This revision is now accepted and ready to land.Jul 7 2026, 2:22 PM

Looks good to me.

sys/net/if_lagg.c
1313

Typically hwassist will be updated only when the interfaces being brought up. After the interface is brought down, it shall stop transmitting any packets ( both outbound and inbound ) so it appears to be not useful to update lagg(4)'s or port interfaces' hwassist .

gallatin added inline comments.
sys/net/if_lagg.c
1313

As @zlei points out, lagg_if_updown() handles both up/down events and is called from just lagg_stop() (on the way down) and lagg_init_locked() (on the way up). It looks like all the stuff we do on the way up is in lagg_init_locked(), so I think it makes the most sense to keep it here..

sys/net/if_lagg.c
1313

lagg_if_updown() knows whether the interface is going up or down, so it could only call lagg_capabilities() when going up, but ok.