Page MenuHomeFreeBSD

ifconfig: Improve CMIS parsing of breakout configs
ClosedPublic

Authored by gallatin on Wed, Jul 15, 5:56 PM.
Tags
None
Referenced Files
F166195961: D58263.diff
Wed, Aug 12, 6:56 AM
Unknown Object (File)
Sun, Aug 9, 5:35 AM
Unknown Object (File)
Sun, Aug 9, 4:23 AM
Unknown Object (File)
Sat, Aug 8, 5:20 PM
Unknown Object (File)
Sat, Aug 8, 10:48 AM
Unknown Object (File)
Sat, Aug 8, 3:30 AM
Unknown Object (File)
Fri, Aug 7, 7:16 AM
Unknown Object (File)
Thu, Aug 6, 9:43 PM
Subscribers

Details

Summary
This fixes a bug where we do not report all lanes when
a NIC configures a breakout.  Eg, we reported all 4
lanes when a NIC configured the optics as 1x400g, but
only printed the first lane's strength when configured as
4x100g.

Fix this by actually parsing the active lane count, rather
than pulling it from the default descriptor.

While here, optionally print page 10h when -vvvv is
specified. This aids in determining how a breakout is configured.
I put it under an extra level of verbosity, as I don't want
to let things get out of hand printing CMIS pages.

I'm currently trying to debug a 400g nic that seems to randomly configure the optics as 4x100g or 1x400g
and printing 10h is what let me figure out that the nic was configured as 4x100 (even tho the driver
was reporting 1x400)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Before and after:

 # ifconfig -v net0 | egrep -v drivern\|ether
net0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
	options=1ee507bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,HWRXTSTMP,MEXTPG,TXTLS4,TXTLS6>
	media: Ethernet autoselect (400GBase-DR4 <full-duplex>)
	status: active
	nd6 options=829<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL,STABLEADDR>
	plugged: QSFP+(CMIS) 100G-FR/100GBASE-FR1 (LC)
	vendor: FLEXOPTIX PN: Q.164HG.2.C SN: F7Z5BVD DATE: 2025-08-22
	module temperature: 59.71 C voltage: 3.26 Volts
	lane 1: RX power: 1.57 mW (1.96 dBm) TX bias: 74.90 mA
# ./ifconfig -v net0 | egrep -v drivern\|ether
net0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
	options=1ee507bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWFILTER,VLAN_HWTSO,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,HWRXTSTMP,MEXTPG,TXTLS4,TXTLS6>
	media: Ethernet autoselect (400GBase-DR4 <full-duplex>)
	status: active
	nd6 options=829<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL,STABLEADDR>
	plugged: QSFP+(CMIS) 100G-FR/100GBASE-FR1 (LC)
	vendor: FLEXOPTIX PN: Q.164HG.2.C SN: F7Z5BVD DATE: 2025-08-22
	module temperature: 59.67 C voltage: 3.26 Volts
	lane 1: RX power: 1.57 mW (1.96 dBm) TX bias: 75.30 mA
	lane 2: RX power: 1.57 mW (1.95 dBm) TX bias: 85.00 mA
	lane 3: RX power: 1.34 mW (1.27 dBm) TX bias: 74.82 mA
	lane 4: RX power: 1.44 mW (1.59 dBm) TX bias: 85.69 mA
This revision is now accepted and ready to land.Thu, Jul 16, 2:44 PM