Page MenuHomeFreeBSD

qlnxe: Advertise the IFCAP_HWSTATS capability
ClosedPublic

Authored by zlei on Jul 21 2025, 11:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 17, 12:09 PM
Unknown Object (File)
Sat, Nov 8, 12:24 AM
Unknown Object (File)
Fri, Nov 7, 2:09 AM
Unknown Object (File)
Thu, Nov 6, 10:32 PM
Unknown Object (File)
Thu, Nov 6, 6:55 PM
Unknown Object (File)
Thu, Nov 6, 5:49 PM
Unknown Object (File)
Nov 2 2025, 5:18 AM
Unknown Object (File)
Oct 25 2025, 1:54 PM
Subscribers

Details

Summary

The hardware can count statistics and the driver has already retrieved
them via qlnx_get_counter().

Advertise the IFCAP_HWSTATS capability so that the net stack will not
double count IFCOUNTER_IBYTES.

Note that on retrieving IFCOUNTER_IBYTES the count statistics stored
in netif->if_counters[IFCOUNTER_IBYTES] is ignored so this change will
not fix anything but is only a micro optimization.

MFC after: 1 week

Diff Detail

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

Event Timeline

zlei requested review of this revision.Jul 21 2025, 11:17 AM

In the commit message do you mean to say there is something else double counting?

In the commit message do you mean to say there is something else double counting?

I may not express that clearly.

Advertise the IFCAP_HWSTATS capability so that the net stack will not
double count IFCOUNTER_IBYTES.

See the logic in if_ethersubr.c https://cgit.freebsd.org/src/tree/sys/net/if_ethersubr.c#n587

So the counter ifp->if_counters[IFCOUNTER_IBYTES] actually increases, but qlnx_get_counter() just ignores it. https://cgit.freebsd.org/src/tree/sys/dev/qlnx/qlnxe/qlnx_os.c#n7164

I would remove the phrase 'change will not fix anything but' in the commit message and I think this is good.

This revision is now accepted and ready to land.Jul 22 2025, 3:28 AM

I would remove the phrase 'change will not fix anything but' in the commit message and I think this is good.

OK, I'll revise before committing.

This revision was automatically updated to reflect the committed changes.