Page MenuHomeFreeBSD

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

Authored by erj on May 1 2020, 10:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 5, 4:26 AM
Unknown Object (File)
Thu, May 2, 7:34 PM
Unknown Object (File)
Thu, May 2, 5:12 PM
Unknown Object (File)
Thu, May 2, 2:22 AM
Unknown Object (File)
Wed, May 1, 10:53 AM
Unknown Object (File)
Wed, May 1, 9:03 AM
Unknown Object (File)
Wed, May 1, 9:01 AM
Unknown Object (File)
Tue, Apr 30, 11:49 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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

erj requested review of this revision.May 1 2020, 10:44 PM
This revision is now accepted and ready to land.May 1 2020, 11:07 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

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

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