Skip to content

psample: Add additional metadata attributes

Ido Schimmel netdev 1 version Applied

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

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 0 repliesApplied 11/11

Patches in v1 All 11 applied

#Subject and filesSizeRepliesApplied
1/11psample: Encapsulate packet metadata in a structdrivers/net/ethernet/mellanox/mlxsw/spectrum.c include/net/psample.h net/psample/psample.c +1 more+23 -210 repliesApplied
2/11psample: Add additional metadata attributesinclude/net/psample.h include/uapi/linux/psample.h net/psample/psample.c+52 -10 repliesApplied
3/11netdevsim: Add dummy psample implementationdrivers/net/Kconfig drivers/net/netdevsim/Makefile drivers/net/netdevsim/dev.c +2 more+299 -20 repliesApplied
4/11selftests: netdevsim: Test psample functionalitytools/testing/selftests/drivers/net/netdevsim/psample.sh+181 -00 repliesApplied
5/11mlxsw: pci: Add more metadata fields to CQEv2drivers/net/ethernet/mellanox/mlxsw/pci_hw.h+71 -00 repliesApplied
6/11mlxsw: Create dedicated field for Rx metadata in skb control blockdrivers/net/ethernet/mellanox/mlxsw/core.h drivers/net/ethernet/mellanox/mlxsw/pci.c drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c+7 -30 repliesApplied
7/11mlxsw: pci: Set extra metadata in skb control blockdrivers/net/ethernet/mellanox/mlxsw/core.h drivers/net/ethernet/mellanox/mlxsw/pci.c+68 -00 repliesApplied
8/11mlxsw: spectrum: Remove unnecessary RCU read-side critical sectiondrivers/net/ethernet/mellanox/mlxsw/spectrum.c+1 -40 repliesApplied
9/11mlxsw: spectrum: Remove mlxsw_sp_sample_receive()drivers/net/ethernet/mellanox/mlxsw/spectrum.c drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c+17 -270 repliesApplied
10/11mlxsw: spectrum: Report extra metadata to psample moduledrivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c+52 -20 repliesApplied
11/11selftests: mlxsw: Add tc sample teststools/testing/selftests/drivers/net/mlxsw/tc_sample.sh+492 -00 repliesApplied

Reviews trailers per patch

8 of 11 patches have a Reviewed-by or Acked-by.

PatchJiri Pirko
1/11R-b
2/11R-b
3/11
4/11
5/11R-b
6/11R-b
7/11R-b
8/11R-b
9/11R-b
10/11R-b
11/11

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

Read the v1 thread

Cover letter [PATCH net-next 00/11] psample: Add additional metadata attributes

From: Ido Schimmel <[email protected]>

This series extends the psample module to expose additional metadata to user space for packets sampled via act_sample. The new metadata (e.g., transit delay) can then be consumed by applications such as hsflowd [1] for better network observability.

netdevsim is extended with a dummy psample implementation that periodically reports "sampled" packets to the psample module. In addition to testing of the psample module, it enables the development and demonstration of user space applications (e.g., hsflowd) that are interested in the new metadata even without access to specialized hardware (e.g., Spectrum ASIC) that can provide it.

mlxsw is also extended to provide the new metadata to psample.

A Wireshark dissector for psample netlink packets [2] will be submitted upstream after the kernel patches are accepted. In addition, a libpcap capture module for psample is currently in the works. Eventually, users should be able to run:

 # tshark -i psample

In order to consume sampled packets along with their metadata.

Series overview:

Patch #1 makes it easier to extend the metadata provided to psample

Patch #2 adds the new metadata attributes to psample

Patch #3 extends netdevsim to periodically report "sampled" packets to psample. Various debugfs knobs are added to control the reporting

Patch #4 adds a selftest over netdevsim

Patches #5-#10 gradually add support for the new metadata in mlxsw

Patch #11 adds a selftest over mlxsw

[1] https://sflow.org/draft4_sflow_transit.txt
[2] https://gitlab.com/amitcohen1/wireshark/-/commit/3d711143024e032aef1b056dd23f0266c54fab56

Ido Schimmel (11):
psample: Encapsulate packet metadata in a struct
psample: Add additional metadata attributes
netdevsim: Add dummy psample implementation
selftests: netdevsim: Test psample functionality
mlxsw: pci: Add more metadata fields to CQEv2
mlxsw: Create dedicated field for Rx metadata in skb control block
mlxsw: pci: Set extra metadata in skb control block
mlxsw: spectrum: Remove unnecessary RCU read-side critical section
mlxsw: spectrum: Remove mlxsw_sp_sample_receive()
mlxsw: spectrum: Report extra metadata to psample module
selftests: mlxsw: Add tc sample tests

 drivers/net/Kconfig                           |   1 +
 drivers/net/ethernet/mellanox/mlxsw/core.h    |  21 +-
 drivers/net/ethernet/mellanox/mlxsw/pci.c     |  55 +-
 drivers/net/ethernet/mellanox/mlxsw/pci_hw.h  |  71 +++
 .../net/ethernet/mellanox/mlxsw/spectrum.c    |  26 -
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |   2 -
 .../ethernet/mellanox/mlxsw/spectrum_trap.c   |  71 ++-
 drivers/net/netdevsim/Makefile                |   4 +
 drivers/net/netdevsim/dev.c                   |  17 +-
 drivers/net/netdevsim/netdevsim.h             |  15 +
 drivers/net/netdevsim/psample.c               | 264 ++++++++++
 include/net/psample.h                         |  21 +-
 include/uapi/linux/psample.h                  |   7 +
 net/psample/psample.c                         |  45 +-
 net/sched/act_sample.c                        |  16 +-
 .../selftests/drivers/net/mlxsw/tc_sample.sh  | 492 ++++++++++++++++++
 .../drivers/net/netdevsim/psample.sh          | 181 +++++++
 17 files changed, 1256 insertions(+), 53 deletions(-)
 create mode 100644 drivers/net/netdevsim/psample.c
 create mode 100755 tools/testing/selftests/drivers/net/mlxsw/tc_sample.sh
 create mode 100755 tools/testing/selftests/drivers/net/netdevsim/psample.sh
Signature · 1 line
2.29.2