Page MenuHomeFreeBSD

iflib: Make txq mp ring stats persistent
Needs ReviewPublic

Authored by zlei on Sep 22 2024, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 12 2024, 12:35 AM
Unknown Object (File)
Nov 5 2024, 1:54 PM
Unknown Object (File)
Nov 4 2024, 1:47 AM
Unknown Object (File)
Nov 4 2024, 1:46 AM
Unknown Object (File)
Nov 1 2024, 2:50 AM
Unknown Object (File)
Oct 10 2024, 1:05 PM
Unknown Object (File)
Oct 9 2024, 4:13 AM
Unknown Object (File)
Oct 5 2024, 8:56 PM

Details

Reviewers
jhb
erj
shurd
Group Reviewers
iflib
Summary

Those stats get reset on every iflib_stop(), e.g., ifconfig em0 -tso.
However it is harmless if they persist. Currenty they are retrived only
via sysctl. A upcoming fix will make use of drops to correctly report
output dropped packets of an interface. With this change we will not
have to save the drops stat on every iflib_stop(), then the code will
be simpler.

MFC after: 2 weeks

Test Plan

Verify the txq mp ring stats persist after changing interface flags.

# sysctl dev.igc.0 | grep txq | grep enqueues
dev.igc.0.iflib.txq3.r_enqueues: 0
dev.igc.0.iflib.txq2.r_enqueues: 0
dev.igc.0.iflib.txq1.r_enqueues: 0
dev.igc.0.iflib.txq0.r_enqueues: 4

# ifconfig igc0 -tso
# sysctl dev.igc.0 | grep txq | grep enqueues
dev.igc.0.iflib.txq3.r_enqueues: 0
dev.igc.0.iflib.txq2.r_enqueues: 0
dev.igc.0.iflib.txq1.r_enqueues: 0
dev.igc.0.iflib.txq0.r_enqueues: 4

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

zlei requested review of this revision.Sep 22 2024, 5:13 PM

For what it's worth I think the TSO reset is due to ifnet, iflib, and individual drivers only making various decisions during attach that would better be done in helper functions that are called during init and SIOCSIFCAP and not some real limitation of the network stack or hardware. It would be cool to not need that reset. I left a more relevant comment in https://reviews.freebsd.org/D46186#inline-280367