Page MenuHomeFreeBSD

Don't propagate SIOCSIFCAPS from vlan(4) to parent.
ClosedPublic

Authored by glebius on Apr 17 2015, 11:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 12:31 PM
Unknown Object (File)
Mar 8 2024, 12:48 PM
Unknown Object (File)
Jan 18 2024, 1:41 AM
Unknown Object (File)
Dec 19 2023, 7:48 PM
Unknown Object (File)
Nov 30 2023, 4:53 PM
Unknown Object (File)
Oct 4 2023, 2:46 AM
Unknown Object (File)
Aug 16 2023, 10:40 PM
Unknown Object (File)
Aug 2 2023, 6:22 PM
Subscribers

Details

Reviewers
melifaro
np
Group Reviewers
network
Summary

The current behaviour allows to change capabilities on a trunk device and
all vlan devices together, since no NIC can do for example checksum
offloading selectively on vlans. However, not only the trunk device can
be the configuration point for ioctl(2) but any vlan. This leads to a
very misleading behavior. Changing caps on a vlan would toggle them on
the trunk and all other vlans. This is how it looks like:

root@behemoth:~:|>ifconfig vlan1
vlan1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500

options=303<RXCSUM,TXCSUM,TSO4,TSO6>
ether 00:25:90:03:0e:fa
inet 10.1.1.1 netmask 0xffffffff broadcast 10.1.1.1 
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
vlan: 1 parent interface: igb0
groups: vlan

root@behemoth:~:|>ifconfig vlan2 -txcsum
root@behemoth:~:|>ifconfig vlan1
vlan1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500

ether 00:25:90:03:0e:fa
inet 10.1.1.1 netmask 0xffffffff broadcast 10.1.1.1 
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
vlan: 1 parent interface: igb0
groups: vlan

Oops, I didn't do anything to vlan1, but it changed. This is not an expected
behavior for a sysadmin. But the next problem is even worse. The propagation
had cleared IFCAP_VLAN_HWTAGGING on the parent, so if I try to undo harm and
turn back the "txcsum", it will not be propagated back to vlans:

root@behemoth:~:|>ifconfig igb0 txcsum
root@behemoth:~:|>ifconfig vlan1
vlan1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500

ether 00:25:90:03:0e:fa
inet 10.1.1.1 netmask 0xffffffff broadcast 10.1.1.1 
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
vlan: 1 parent interface: igb0
groups: vlan

Fail!

The plan is to disable SIOCSIFCAP on vlan(4) and allow it only on the parent.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

glebius retitled this revision from to Don't propagate SIOCSIFCAPS from vlan(4) to parent..
glebius updated this object.
glebius edited the test plan for this revision. (Show Details)
glebius added reviewers: network, np.
melifaro added a reviewer: melifaro.
melifaro added a subscriber: melifaro.

I second this. If anyone really needs auto vlan cap propagation, it should be implemented not at driver level, but at OS-wide level (like having special subsystem for tracking interface graph (e.g. lagg/vlan/bridge connections) and doing loop detection, cap/state propagation/etc)

This revision is now accepted and ready to land.Apr 21 2015, 9:10 AM
np edited edge metadata.