Page MenuHomeFreeBSD

iflib: Add iflib managed counters support
Needs ReviewPublic

Authored by zlei on Jul 30 2024, 4:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 28, 3:59 PM
Unknown Object (File)
Fri, Sep 27, 11:26 AM
Unknown Object (File)
Mon, Sep 23, 8:00 AM
Unknown Object (File)
Mon, Sep 23, 5:48 AM
Unknown Object (File)
Sat, Sep 21, 5:30 AM
Unknown Object (File)
Tue, Sep 17, 9:27 PM
Unknown Object (File)
Tue, Sep 17, 7:57 PM
Unknown Object (File)
Wed, Sep 11, 10:24 AM

Details

Reviewers
shurd
jhb
Group Reviewers
iflib
network
Summary

Currently supports IFCOUNTER_OQDROPS and fallbacks to if_get_counter_default().

PR: 280386
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

zlei requested review of this revision.Jul 30 2024, 4:40 PM
zlei added inline comments.
sys/net/iflib.c
2642

I'm not convinced that we need to reset txq stats on every call iflib_stop(). The stats can persist IMO, then iflib_save_stats can be omitted. Can the author @mmacy comment on this ?

zlei added a reviewer: network.
erj added inline comments.
sys/net/iflib.c
2642

I agree that I don't think we should do this; maybe it was something that was added because it was useful for debugging when iflib was being developed?

4665

Ok, I think it makes sense that we're adding the IFCOUNTER_OQDROPS from the ifnet, too.

PR: 280386

Is this supposed to help solve the problem in the PR? I'm not sure what's going on there, but I'm not sure it's clear in there except for your comment that Odrops isn't incrementing because they're not being retrieved properly.

In D46186#1052952, @erj wrote:

PR: 280386

Is this supposed to help solve the problem in the PR?

Yes. That PR lead this change. I mean when I hacking if_bridge(4), I realized some iflib drivers ( em and igb in that PR ) does not report Odrops correctly.

I'm not sure what's going on there, but I'm not sure it's clear in there except for your comment that Odrops isn't incrementing because they're not being retrieved properly.

So users ( and also me ) got confused what happens behind. Users are more familiar with netstat(8) than driver specific sysctl variables.

zlei added inline comments.
sys/net/iflib.c
2642

Long time no responses from @mmacy . I posted the removal of ifmp_ring_reset_stats(txq->ift_br) to D46751. If that is accepted, I'll update and remove iflib_save_stats() in this CR.

4672

With this change we will not have to save the drops stat on every iflib_stop(), then the code will be simpler.

CC @jhb

kbowling added inline comments.
sys/net/iflib.c
2642

I think it's just an opinion to retain or not retain the stats. I don't see any logical flaw in resetting them on interface resets, which toggling certain HW changes will accomplish but I am not against retaining them either.. it should just carry sufficient reasoning to make a change in behavior. What problem are you trying to solve by persisting the ring drop stats, and what doesn't work if you leave it as is? That justification should be in your change and eventual commit message.

The code in question comes from sys/dev/cxgbe/t4_mp_ring.c which I think was written by @np you may wish to confer with him.