Page MenuHomeFreeBSD

dpaa2: ni: add more stats and link information
ClosedPublic

Authored by bz on Feb 17 2026, 3:23 AM.
Tags
None
Referenced Files
F157029968: D55321.id175961.diff
Mon, May 18, 1:08 AM
F157029367: D55321.id175961.diff
Mon, May 18, 1:03 AM
Unknown Object (File)
Mon, May 11, 10:49 AM
Unknown Object (File)
Mon, May 11, 9:53 AM
Unknown Object (File)
Mon, May 11, 1:24 AM
Unknown Object (File)
Sat, May 9, 10:20 PM
Unknown Object (File)
Sat, May 9, 9:20 PM
Unknown Object (File)
Sat, May 9, 9:14 PM
Subscribers

Details

Summary

In addition to the locally generated statistics counters, dpaa2 ni
provides a larger set of counters than we currently export via
sysctl. Add (most of) the missing counters and descriptions.
Around Page 3/4 there are some things left to do if we want.
Also the manual was not clear on the descriptions of 3/0 and 3/1.

The second half of the change adds another sysctl note which exports
the link-state, speed, and capabilities set as a text-blob. This is
especially interesting in case the "ni" stops passing packets.
From what I have found in that case the (internal) link state of the
ni goes DOWN but we do not see an interrupt for a link-state change.

Being able to diagnose the state helps to (manually) fix it for now
by changing the media status to 10BaseT or none and then back to auto.
That usually brings the internal link state back UP.

MFC after: 3 days
PR: 279352

Diff Detail

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

Event Timeline

bz requested review of this revision.Feb 17 2026, 3:23 AM
dsl added inline comments.
sys/dev/dpaa2/dpaa2_ni.c
3537

I don't understand those option bits and sbuf(9) doesn't help me much, but it's likely my problem. Everything else LGTM.

This revision is now accepted and ready to land.Feb 21 2026, 3:05 PM

@bz I'd rebase this review and commit if you don't have time now.

In D55321#1294230, @dsl wrote:

@bz I'd rebase this review and commit if you don't have time now.

I'll rebase and push it. But thanks.

bz marked an inline comment as done.Tue, Apr 21, 8:53 AM
bz added inline comments.
sys/dev/dpaa2/dpaa2_ni.c
3537

printf %b prints the bits that are set as a number first and then in verbose as given so if bits 1 and 3 are set it'll print 0x3<AUTONEG,PAUSE>.

You know that from ifconfig I would assume though that is userspace; 6 bits set (number is hex) and 6 options printed:
vlan99: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500

sbuf is basically just a dynamic buffer to print into in this case so that one doesn't have to concatenate stings or malloc oneself.

sys/dev/dpaa2/dpaa2_ni.c
3537

Ah, looks familiar indeed. Thanks for explanation!

This revision was automatically updated to reflect the committed changes.
bz marked an inline comment as done.