Bug 193953 - vlan(4) on LACP lagg(4) do not update if_baudrate value and thus SNMP daemons do not provide high capacity counters
Summary: vlan(4) on LACP lagg(4) do not update if_baudrate value and thus SNMP daemons...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2014-09-26 16:03 UTC by Josh C
Modified: 2018-04-17 13:49 UTC (History)
4 users (show)

See Also:


Attachments
ugly_patch_exposing_64-bit_counters (514 bytes, patch)
2018-02-21 13:01 UTC, Marek Zarychta
no flags Details | Diff
Another patch for FreeBSD 12-CURRENT (3.37 KB, patch)
2018-02-21 14:08 UTC, Andrey V. Elsukov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Josh C 2014-09-26 16:03:23 UTC
When creating a vlan interface to a lagg, bsnmpd does not report 64-bit counter values under the IF-MIB::ifXTable. It DOES report these values correctly when the vlan is attached to an interface not under a lagg (such as a physical interface.) 

The other values under ifXTable are correct so it's just the 64-bit counters that appear affected with vlans under laggs.

This leaves only 32-bit counters that wrap too quickly to be useful for network management utilities under even moderate transfer speeds.
Comment 1 Eugene Grosbein freebsd_committer 2017-06-11 15:29:13 UTC
Please re-test this using any supported FreeBSD version (e.g. 10.3+ or 11). It should work here now.
Comment 2 Marek Zarychta 2017-06-19 09:54:29 UTC
(In reply to Eugene Grosbein from comment #1)

I confirm aforementioned behavior for 11-STABLE r318137. 64 bit counters are reported, but not working correctly for VLAN interfaces created on LAGG, although they work fine for interfaces belonging to that LAGG. Maybe the issue is related to incorrect speed reported by this VLAN interfaces (10Mbps).

I am stuck on this version of FreeBSD because of this unresolved bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219453 so, I am not able to test it on latest 11.1-BETA.
Comment 3 Eugene Grosbein freebsd_committer 2017-06-19 11:16:59 UTC
(In reply to Marek Zarychta from comment #2)

Please show output of "ifconfig -m" command for physical interface, for lagg and for vlan over lagg.
Comment 4 Marek Zarychta 2017-06-19 11:48:12 UTC
(In reply to Eugene Grosbein from comment #3)

This test has been done on the spare machine, which had been setup to test mentioned Bug 219453. The machine is currently running fresh FreeBSD 11.1-BETA2 #0 r319996.
 
Ifconig -m doesn't show interface speed for this devices. Output is limited to physical interfaces belonging to the LAGG, LAGG interface itself and one child VLAN. IP addresses are not shown as irrelevant.

~# ifconfig -m 

msk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
	options=80018<VLAN_MTU,VLAN_HWTAGGING,LINKSTATE>
	capabilities=c011b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,TSO4,VLAN_HWTSO,LINKSTATE>
	ether 00:0e:0c:a4:53:5d
	hwaddr 00:0e:0c:a4:53:5c
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
	supported media:
		media autoselect mediaopt flowcontrol
		media autoselect
		media 1000baseT mediaopt full-duplex,master
		media 1000baseT mediaopt full-duplex
		media 1000baseT mediaopt master
		media 1000baseT
		media 100baseTX mediaopt full-duplex
		media 100baseTX
		media 10baseT/UTP mediaopt full-duplex
		media 10baseT/UTP
		media none
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
	options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
	capabilities=11389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC,VLAN_HWFILTER,NETMAP>
	ether 00:0e:0c:a4:53:5d
	hwaddr 00:0e:0c:a4:53:5d
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
	supported media:
		media autoselect
		media 1000baseT
		media 1000baseT mediaopt full-duplex
		media 100baseTX mediaopt full-duplex
		media 100baseTX
		media 10baseT/UTP mediaopt full-duplex
		media 10baseT/UTP

lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
	options=18<VLAN_MTU,VLAN_HWTAGGING>
	capabilities=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
	ether 00:0e:0c:a4:53:5d
	inet (...)
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect
	status: active
	supported media:
		media autoselect
	groups: lagg 
	laggproto lacp lagghash l2,l3,l4
	laggport: msk0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>
	laggport: em0 flags=1c<ACTIVE,COLLECTING,DISTRIBUTING>

vlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 9000
	ether 00:0e:0c:a4:53:5d
	inet (...)
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect
	status: active
	supported media:
		media autoselect
	vlan: 10 vlanpcp: 0 parent interface: lagg0
	groups: vlan 

 
Here is the output of the command: 
~# bsnmpwalk -v 2c -s public@127.0.0.1
(...)
ifDescr[1] = msk0
ifDescr[2] = em0
ifDescr[3] = lo0
ifDescr[4] = lagg0 
ifDescr[5] = lo1
ifDescr[6] = lo2
ifDescr[7] = lo3
ifDescr[8] = lo4
ifDescr[9] = lo5
ifDescr[10] = lo6
ifDescr[11] = vlan0
ifDescr[12] = vlan1
ifDescr[13] = vlan2
ifDescr[14] = vlan3
(...)
ifSpeed[1] = 1000000000
ifSpeed[2] = 1000000000
ifSpeed[3] = 0
ifSpeed[4] = 2000000000
ifSpeed[5] = 0
ifSpeed[6] = 0
ifSpeed[7] = 0
ifSpeed[8] = 0
ifSpeed[9] = 0
ifSpeed[10] = 0
ifSpeed[11] = 10000000
ifSpeed[12] = 10000000
ifSpeed[13] = 10000000
ifSpeed[14] = 10000000
(...)

For this system bsmnmpwalk shows 64-bit counters present for only 3 interfaces:

~# bsnmpwalk -v 2c -s public@127.0.0.1 1.3.6.1.2.1.31.1.1.1.6
ifHCInOctets[1] = 315994426
ifHCInOctets[2] = 400196178
ifHCInOctets[4] = 716190604
Comment 5 Marek Zarychta 2017-07-12 06:12:44 UTC
At present (11.1-PRERELEASE) this bug refers only to VLAN interfaces created from startup scripts on the top of LACP LAGGs. 
When the VLAN interface is created manually after the parent LACP LAGG is up, the speed reported by the interface reflects the speed of parent LAGG, also the 64-bit counters are present for such VLAN interface.
Comment 6 Marek Zarychta 2018-02-21 13:01:11 UTC
Created attachment 190855 [details]
ugly_patch_exposing_64-bit_counters

This patch at least exposes exposes 64-bit interface counters for vlan children, althrouhg the speed of aggregate interface itself is still being calculated by LACP code.

Interface speed for LACP aggretated LAGGs is calculated in sys/net/ieee8023ad_lacp.c When the state of LACP interface changes VLAN children should also be made aware of this. Maybe someone will correct this by reinitializing valuse for LACP aggregate in right way by calling sys/net/ieee8023ad_lacp.c instead of comment  /* LACP updates if_baudrate itself */.
Comment 7 Andrey V. Elsukov freebsd_committer 2018-02-21 14:08:51 UTC
Created attachment 190856 [details]
Another patch for FreeBSD 12-CURRENT

We use this patch to solve this problem.
Comment 8 Andrey V. Elsukov freebsd_committer 2018-02-21 14:21:45 UTC
Comment on attachment 190856 [details]
Another patch for FreeBSD 12-CURRENT

Note that the patch for CURRENT.
Comment 9 Marek Zarychta 2018-02-21 15:21:38 UTC
(In reply to Andrey V. Elsukov from comment #8)
Plans to MFC this?