From: David Wei <dw@davidwei.uk>
To: Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@resnulli.us>,
Sabrina Dubroca <sd@queasysnail.net>,
netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH net-next v3 0/4] netdevsim: link and forward skbs between ports
Date: Thu, 14 Dec 2023 13:24:39 -0800 [thread overview]
Message-ID: <20231214212443.3638210-1-dw@davidwei.uk> (raw)
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.
---
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 (4):
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/bus.c | 17 +++
drivers/net/netdevsim/dev.c | 88 +++++++++++++
drivers/net/netdevsim/netdev.c | 29 ++++-
drivers/net/netdevsim/netdevsim.h | 3 +
.../selftests/drivers/net/netdevsim/Makefile | 18 +++
.../selftests/drivers/net/netdevsim/peer.sh | 123 ++++++++++++++++++
7 files changed, 274 insertions(+), 5 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
next reply other threads:[~2023-12-14 21:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 21:24 David Wei [this message]
2023-12-14 21:24 ` [PATCH net-next v3 1/4] netdevsim: allow two netdevsim ports to be connected David Wei
2023-12-15 11:11 ` Jiri Pirko
2023-12-15 19:13 ` David Wei
2023-12-16 9:21 ` Jiri Pirko
2023-12-16 20:52 ` David Wei
2023-12-14 21:24 ` [PATCH net-next v3 2/4] netdevsim: forward skbs from one connected port to another David Wei
2023-12-15 10:45 ` Jiri Pirko
2023-12-15 18:31 ` David Wei
2023-12-16 9:22 ` Jiri Pirko
2023-12-17 2:59 ` David Wei
2023-12-17 11:36 ` Jiri Pirko
2023-12-14 21:24 ` [PATCH net-next v3 3/4] netdevsim: add selftest for forwarding skb between connected ports David Wei
2023-12-14 21:24 ` [PATCH net-next v3 4/4] netdevsim: add Makefile for selftests David Wei
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=20231214212443.3638210-1-dw@davidwei.uk \
--to=dw@davidwei.uk \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
/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).