[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210314121940.2807621-1-idosch@idosch.org>
Date: Sun, 14 Mar 2021 14:19:29 +0200
From: Ido Schimmel <idosch@...sch.org>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, jiri@...dia.com,
yotam.gi@...il.com, jhs@...atatu.com, xiyou.wangcong@...il.com,
roopa@...dia.com, peter.phaal@...on.com, neil.mckee@...on.com,
mlxsw@...dia.com, Ido Schimmel <idosch@...dia.com>
Subject: [PATCH net-next 00/11] psample: Add additional metadata attributes
From: Ido Schimmel <idosch@...dia.com>
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
--
2.29.2
Powered by blists - more mailing lists