Page MenuHomeFreeBSD

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

Authored by gallatin on Mon, Jul 6, 6:55 PM.
Tags
None
Referenced Files
F162414199: D58062.id181379.diff
Mon, Jul 13, 12:56 AM
F162413894: D58062.id181535.diff
Mon, Jul 13, 12:51 AM
F162411052: D58062.id181379.diff
Mon, Jul 13, 12:11 AM
F162410814: D58062.id181379.diff
Mon, Jul 13, 12:07 AM
F162395078: D58062.id181535.diff
Sun, Jul 12, 8:19 PM
F162394717: D58062.id181535.diff
Sun, Jul 12, 8:16 PM
Unknown Object (File)
Sat, Jul 11, 4:26 AM
Unknown Object (File)
Sat, Jul 11, 12:39 AM
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 Skipped
Unit
Tests Skipped

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.Tue, Jul 7, 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.