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
F81419804: D24659.diff
Tue, Apr 16, 2:03 AM
Unknown Object (File)
Thu, Mar 28, 7:59 AM
Unknown Object (File)
Feb 20 2024, 1:50 PM
Unknown Object (File)
Jan 27 2024, 5:19 AM
Unknown Object (File)
Jan 12 2024, 9:04 AM
Unknown Object (File)
Jan 10 2024, 10:38 PM
Unknown Object (File)
Dec 22 2023, 10:54 PM
Unknown Object (File)
Dec 18 2023, 4:01 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30949
Build 28660: arc lint + arc unit

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