From: Petr Machata <petrm@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>
Subject: [PATCH net-next 0/3] netdevsim: Support for L3 HW stats
Date: Thu, 10 Mar 2022 17:12:21 +0100 [thread overview]
Message-ID: <cover.1646928340.git.petrm@nvidia.com> (raw)
"L3 stats" is a suite of interface statistics aimed at reflecting traffic
taking place in a HW device, on an object corresponding to some software
netdevice. Support for this stats suite has been added recently, in commit
ca0a53dcec94 ("Merge branch 'net-hw-counters-for-soft-devices'").
In this patch set:
- Patch #1 adds support for L3 stats to netdevsim.
Real devices can have various conditions for when an L3 counter is
available. To simulate this, netdevsim maintains a list of devices
suitable for HW stats collection. Only when l3_stats is enabled on both a
netdevice itself, and in netdevsim, will netdevsim contribute values to
L3 stats.
This enablement and disablement is done via debugfs:
# echo $ifindex > /sys/kernel/debug/netdevsim/$DEV/hwstats/l3/enable_ifindex
# echo $ifindex > /sys/kernel/debug/netdevsim/$DEV/hwstats/l3/disable_ifindex
Besides this, there is a third toggle to mark a device for future failure:
# echo $ifindex > /sys/kernel/debug/netdevsim/$DEV/hwstats/l3/fail_next_enable
- This allows HW-independent testing of stats reporting and in-kernel APIs,
as well as a test for enablement rollback, which is difficult to do
otherwise. This netdevsim-specific selftest is added in patch #2.
- Patch #3 adds another driver-specific selftest, namely a test aimed at
checking mlxsw-induced stats monitoring events.
Petr Machata (3):
netdevsim: Introduce support for L3 offload xstats
selftests: netdevsim: hw_stats_l3: Add a new test
selftests: mlxsw: hw_stats_l3: Add a new test
drivers/net/netdevsim/Makefile | 2 +-
drivers/net/netdevsim/dev.c | 17 +-
drivers/net/netdevsim/hwstats.c | 497 ++++++++++++++++++
drivers/net/netdevsim/netdevsim.h | 23 +
.../drivers/net/mlxsw/hw_stats_l3.sh | 31 ++
.../drivers/net/netdevsim/hw_stats_l3.sh | 421 +++++++++++++++
tools/testing/selftests/net/forwarding/lib.sh | 60 +++
7 files changed, 1048 insertions(+), 3 deletions(-)
create mode 100644 drivers/net/netdevsim/hwstats.c
create mode 100755 tools/testing/selftests/drivers/net/mlxsw/hw_stats_l3.sh
create mode 100755 tools/testing/selftests/drivers/net/netdevsim/hw_stats_l3.sh
--
2.31.1
next reply other threads:[~2022-03-10 16:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 16:12 Petr Machata [this message]
2022-03-10 16:12 ` [PATCH net-next 1/3] netdevsim: Introduce support for L3 offload xstats Petr Machata
2022-03-11 5:13 ` Jakub Kicinski
2022-03-11 9:18 ` Petr Machata
2022-03-11 16:06 ` Jakub Kicinski
2022-03-11 16:07 ` Jakub Kicinski
2022-03-11 17:31 ` Petr Machata
2022-03-10 16:12 ` [PATCH net-next 2/3] selftests: netdevsim: hw_stats_l3: Add a new test Petr Machata
2022-03-10 16:12 ` [PATCH net-next 3/3] selftests: mlxsw: " Petr Machata
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=cover.1646928340.git.petrm@nvidia.com \
--to=petrm@nvidia.com \
--cc=davem@davemloft.net \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).