Page MenuHomeFreeBSD

iflib: accurately account for TSO packets & transmitted
ClosedPublic

Authored by gallatin on Thu, Apr 9, 11:27 PM.
Tags
None
Referenced Files
F152917697: D56338.diff
Sat, Apr 18, 1:05 AM
F152871026: D56338/new/.diff
Fri, Apr 17, 3:44 PM
Unknown Object (File)
Thu, Apr 16, 5:03 PM
Unknown Object (File)
Wed, Apr 15, 10:06 PM

Details

Summary

Fix iflib software pkt/byte counters to work properly with TSO. The current software based counters count packets and bytes sent down to the driver, but does not account for the inflation of packets/bytes when using TSO. To account for this, we must calculate the number of segments the NIC will transmit, and multiply the header size by the number of segments transmitted to arrive at the total bytes sent.

To do this, move the calculation into iflib_encap(), where we have already parsed the packet and know the header size, etc.

I noticed this when moving an out-of-tree NIC driver for a NIC with unreliable HW counters to using iflib SW counters.

Diff Detail

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

Event Timeline

The conception looks good to me, but I'm not familiar with TSO so no idea whether Update packets / bytes sent does the right thing.

FreeBSD/sys/net/iflib.c
3482 ↗(On Diff #175207)

Arguably those two statistics belong to txq.

This revision was not accepted when it landed; it landed in state Needs Review.Fri, Apr 17, 5:35 PM
This revision was automatically updated to reflect the committed changes.