From: Tobias Waldekranz <tobias@waldekranz.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com,
netdev@vger.kernel.org
Subject: [PATCH v4 net-next 0/8] net: dsa: mv88e6xxx: Add "eth-mac" and "rmon" counter group support
Date: Thu, 14 Dec 2023 14:50:21 +0100 [thread overview]
Message-ID: <20231214135029.383595-1-tobias@waldekranz.com> (raw)
The majority of the changes (2/8) are about refactoring the existing
ethtool statistics support to make it possible to read individual
counters, rather than the whole set.
4/8 tries to collect all information about a stat in a single place
using a mapper macro, which is then used to generate the original list
of stats, along with a matching enum. checkpatch is less than amused
with this construct, but prior art exists (__BPF_FUNC_MAPPER in
include/uapi/linux/bpf.h, for example).
To support the histogram counters from the "rmon" group, we have to
change mv88e6xxx's configuration of them. Instead of counting rx and
tx, we restrict them to rx-only. 6/8 has the details.
With that in place, adding the actual counter groups is pretty
straight forward (5,7/8).
Tie it all together with a selftest (8/8).
v3 -> v4:
- Return size_t from mv88e6xxx_stats_get_stats
- Spelling errors in commit message of 6/8
- Improve selftest:
- Report progress per-bucket
- Test both ports in the pair
- Increase MTU, if required
v2 -> v3:
- Added 6/8
- Added 8/8
v1 -> v2:
- Added 1/6
- Added 3/6
- Changed prototype of stats operation to reflect the fact that the
number of read stats are returned, no errors
- Moved comma into MV88E6XXX_HW_STAT_MAPPER definition
- Avoid the construction of mapping table iteration which relied on
struct layouts outside of mv88e6xxx's control
Tobias Waldekranz (8):
net: dsa: mv88e6xxx: Push locking into stats snapshotting
net: dsa: mv88e6xxx: Create API to read a single stat counter
net: dsa: mv88e6xxx: Fix mv88e6352_serdes_get_stats error path
net: dsa: mv88e6xxx: Give each hw stat an ID
net: dsa: mv88e6xxx: Add "eth-mac" counter group support
net: dsa: mv88e6xxx: Limit histogram counters to ingress traffic
net: dsa: mv88e6xxx: Add "rmon" counter group support
selftests: forwarding: ethtool_rmon: Add histogram counter test
drivers/net/dsa/mv88e6xxx/chip.c | 392 ++++++++++++------
drivers/net/dsa/mv88e6xxx/chip.h | 31 +-
drivers/net/dsa/mv88e6xxx/global1.c | 7 +-
drivers/net/dsa/mv88e6xxx/serdes.c | 10 +-
drivers/net/dsa/mv88e6xxx/serdes.h | 8 +-
.../testing/selftests/net/forwarding/Makefile | 1 +
.../selftests/net/forwarding/ethtool_rmon.sh | 143 +++++++
tools/testing/selftests/net/forwarding/lib.sh | 9 +
8 files changed, 435 insertions(+), 166 deletions(-)
create mode 100755 tools/testing/selftests/net/forwarding/ethtool_rmon.sh
--
2.34.1
next reply other threads:[~2023-12-14 13:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 13:50 Tobias Waldekranz [this message]
2023-12-14 13:50 ` [PATCH v4 net-next 1/8] net: dsa: mv88e6xxx: Push locking into stats snapshotting Tobias Waldekranz
2023-12-14 13:50 ` [PATCH v4 net-next 2/8] net: dsa: mv88e6xxx: Create API to read a single stat counter Tobias Waldekranz
2023-12-14 13:50 ` [PATCH v4 net-next 3/8] net: dsa: mv88e6xxx: Fix mv88e6352_serdes_get_stats error path Tobias Waldekranz
2023-12-14 13:50 ` [PATCH v4 net-next 4/8] net: dsa: mv88e6xxx: Give each hw stat an ID Tobias Waldekranz
2023-12-14 13:50 ` [PATCH v4 net-next 5/8] net: dsa: mv88e6xxx: Add "eth-mac" counter group support Tobias Waldekranz
2023-12-14 13:50 ` [PATCH v4 net-next 6/8] net: dsa: mv88e6xxx: Limit histogram counters to ingress traffic Tobias Waldekranz
2023-12-14 13:50 ` [PATCH v4 net-next 7/8] net: dsa: mv88e6xxx: Add "rmon" counter group support Tobias Waldekranz
2023-12-14 13:50 ` [PATCH v4 net-next 8/8] selftests: forwarding: ethtool_rmon: Add histogram counter test Tobias Waldekranz
2023-12-14 14:12 ` Vladimir Oltean
2023-12-15 11:10 ` [PATCH v4 net-next 0/8] net: dsa: mv88e6xxx: Add "eth-mac" and "rmon" counter group support patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231214135029.383595-1-tobias@waldekranz.com \
--to=tobias@waldekranz.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox