Skip to content

netdevsim: implement RX statistics using NETDEV_PCPU_STAT_DSTATS

Breno Leitao linux-kselftest lkml netdev 4 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected] change-id 20250610-netdevsim_stat-95995921e03e

Versions newest first

  1. v4 Latest4 patches 0 repliesApplied 4/4
  2. v34 patches 5 repliesSuperseded
  3. v24 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches4 repliesSuperseded

Changes in v4 from the cover letter

- Protect dev_dstats_rx_dropped_add() by disabling BH (Jakub)
- Link to v3: https://lore.kernel.org/r/[email protected]

Patches in v4 All 4 applied

#Subject and filesSizeRepliesApplied
1/4netdevsim: migrate to dstats stats collectiondrivers/net/netdevsim/netdev.c drivers/net/netdevsim/netdevsim.h+6 -320 repliesApplied
2/4netdevsim: collect statistics at RX sidedrivers/net/netdevsim/netdev.c+10 -20 repliesApplied
3/4net: add dev_dstats_rx_dropped_add() helperinclude/linux/netdevice.h+10 -00 repliesApplied
4/4netdevsim: account dropped packet length in stats on queue freedrivers/net/netdevsim/netdev.c+7 -40 repliesApplied

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchJoe Damato
1/4R-b
2/4R-b
3/4R-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH net-next v4 0/4] netdevsim: implement RX statistics using NETDEV_PCPU_STAT_DSTATS

The netdevsim driver previously lacked RX statistics support, which prevented its use with the GenerateTraffic() test framework, as this framework verifies traffic flow by checking RX byte counts.

This patch migrates netdevsim from its custom statistics collection to the NETDEV_PCPU_STAT_DSTATS framework, as suggested by Jakub. This change not only standardizes the statistics handling but also adds the necessary RX statistics support required by the test framework.

---
Changes in v4:
- Protect dev_dstats_rx_dropped_add() by disabling BH (Jakub)
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Rely on netdev from caller instead of napi->dev in nsim_queue_free().
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Changed the RX collection place from nsim_napi_rx() to nsim_rcv (Joe Damato)
- Collect RX dropped packets statistic in nsim_queue_free() (Jakub)
- Added a helper in dstat to add values to RX dropped packets
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Breno Leitao (4):
netdevsim: migrate to dstats stats collection
netdevsim: collect statistics at RX side
net: add dev_dstats_rx_dropped_add() helper
netdevsim: account dropped packet length in stats on queue free

 drivers/net/netdevsim/netdev.c    | 56 ++++++++++++++++-----------------------
 drivers/net/netdevsim/netdevsim.h |  5 ----
 include/linux/netdevice.h         | 10 +++++++
 3 files changed, 33 insertions(+), 38 deletions(-)

---
base-commit: 3b5b1c428260152e47c9584bc176f358b87ca82d
change-id: 20250610-netdevsim_stat-95995921e03e

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>