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, Oct 13, 11:36 AM
Unknown Object (File)
Mon, Oct 13, 11:36 AM
Unknown Object (File)
Mon, Oct 13, 11:36 AM
Unknown Object (File)
Sun, Oct 12, 10:56 PM
Unknown Object (File)
Thu, Sep 25, 3:46 AM
Unknown Object (File)
Wed, Sep 24, 3:25 AM
Unknown Object (File)
Sat, Sep 20, 2:16 AM
Unknown Object (File)
Sep 15 2025, 9:26 AM
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.