Page MenuHomeFreeBSD

em/ix/ixv/ixl/iavf: Implement ifdi_needs_restart iflib method
ClosedPublic

Authored by erj on May 1 2020, 10:44 PM.

Details

Summary

Pursuant to rS360398, implement driver-specific versions of the ifdi_needs_restart
iflib device method.

Some (if not most?) Intel network cards don't need reinitializing when a VLAN
is added or removed from the device hardware, so these implement ifdi_needs_restart
in a way that tell iflib not to bring the interface up or down when a VLAN is
added or removed, regardless of whether the VLAN_HWFILTER interface capability
flag is set or not.

This could potentially solve several PRs relating to link flaps that occur when
VLANs are added/removed to devices.

Signed-off-by: Eric Joyner <erj@freebsd.org>

Test Plan

Ideally, someone would test this patch out by adding/removing VLANs on the various
network devices that this patch affects. iavf(4) doesn't need testing since I've
already worked on that, but the others do (probably not ixl(4) though).

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

erj created this revision.May 1 2020, 10:44 PM
erj requested review of this revision.May 1 2020, 10:44 PM
erj set the repository for this revision to rS FreeBSD src repository.
erj added subscribers: iflib, wigneddoom_yandex.ru.
gallatin accepted this revision.May 1 2020, 11:07 PM
This revision is now accepted and ready to land.May 1 2020, 11:07 PM
emaste added a subscriber: emaste.May 6 2020, 4:05 PM
erj updated this revision to Diff 71466.May 6 2020, 6:16 PM
  • Add em_if_needs_restart to igb's iflib device method list
This revision now requires review to proceed.May 6 2020, 6:16 PM
lev added a subscriber: lev.May 6 2020, 9:29 PM

It helps me on 13-CURRENT with em, igb and ix.

olivier accepted this revision.May 6 2020, 9:41 PM
olivier added a subscriber: olivier.

Tested on igb and excellent result!

Before applying this patch (datastamp log message from Cisco switch console):

[root@IBM3]~# ifconfig igb2.5 create vlan 5 vlandev igb2 inet 192.168.50.1/24

May  6 21:04:22: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/17, changed state to down
May  6 21:04:23: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/17, changed state to down
May  6 21:04:25: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/17, changed state to up
May  6 21:04:26: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/17, changed state to up

[root@IBM3]~# ifconfig igb2.6 create vlan 6 vlandev igb2 inet 192.168.60.1/24

May  6 21:05:08: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/17, changed state to down
May  6 21:05:09: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/17, changed state to down
May  6 21:05:12: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/17, changed state to up
May  6 21:05:13: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/17, changed state to up

[root@IBM3]~#  ifconfig igb2.5 destroy

May  6 21:08:21: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/17, changed state to down
May  6 21:08:22: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/17, changed state to down
May  6 21:08:24: %LINK-3-UPDOWN: Interface GigabitEthernet1/0/17, changed state to up
May  6 21:08:25: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/17, changed state to up

And after applying, no more link flapping :-)

[root@IBM3]~# ifconfig igb2.5 create vlan 5 vlandev igb2 inet 192.168.50.1/24
[root@IBM3]~# ifconfig igb2.6 create vlan 6 vlandev igb2 inet 192.168.60.1/24
[root@IBM3]~# ifconfig igb2.5 destroy
This revision is now accepted and ready to land.May 6 2020, 9:41 PM
gallatin accepted this revision.May 7 2020, 3:21 AM
This revision was automatically updated to reflect the committed changes.