[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231220014747.1508581-1-dw@davidwei.uk>
Date: Tue, 19 Dec 2023 17:47:42 -0800
From: David Wei <dw@...idwei.uk>
To: Jakub Kicinski <kuba@...nel.org>,
Jiri Pirko <jiri@...nulli.us>,
Sabrina Dubroca <sd@...asysnail.net>,
netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>
Subject: [PATCH net-next v4 0/5] netdevsim: link and forward skbs between ports
This patchset adds the ability to link two netdevsim ports together and
forward skbs between them, similar to veth. The goal is to use netdevsim
for testing features e.g. zero copy Rx using io_uring.
This feature was tested locally on QEMU, and a selftest is included.
---
v3->v4:
- maintain a mutex protected list of probed nsim_devs instead of using
nsim_bus_dev
- fixed synchronization issues by taking rtnl_lock
- track tx_dropped skbs
v2->v3:
- take lock when traversing nsim_bus_dev_list
- take device ref when getting a nsim_bus_dev
- return 0 if nsim_dev_peer_read cannot find the port
- address code formatting
- do not hard code values in selftests
- add Makefile for selftests
v1->v2:
- renamed debugfs file from "link" to "peer"
- replaced strstep() with sscanf() for consistency
- increased char[] buf sz to 22 for copying id + port from user
- added err msg w/ expected fmt when linking as a hint to user
- prevent linking port to itself
- protect peer ptr using RCU
David Wei (5):
netdevsim: maintain a list of probed netdevsims
netdevsim: allow two netdevsim ports to be connected
netdevsim: forward skbs from one connected port to another
netdevsim: add selftest for forwarding skb between connected ports
netdevsim: add Makefile for selftests
MAINTAINERS | 1 +
drivers/net/netdevsim/dev.c | 144 ++++++++++++++++--
drivers/net/netdevsim/netdev.c | 31 +++-
drivers/net/netdevsim/netdevsim.h | 3 +
.../selftests/drivers/net/netdevsim/Makefile | 18 +++
.../selftests/drivers/net/netdevsim/peer.sh | 123 +++++++++++++++
6 files changed, 304 insertions(+), 16 deletions(-)
create mode 100644 tools/testing/selftests/drivers/net/netdevsim/Makefile
create mode 100755 tools/testing/selftests/drivers/net/netdevsim/peer.sh
--
2.39.3
Powered by blists - more mailing lists