netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v5 0/5] netdevsim: link and forward skbs between ports
@ 2023-12-28  1:46 David Wei
  2023-12-28  1:46 ` [PATCH net-next v5 1/5] netdevsim: maintain a list of probed netdevsims David Wei
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: David Wei @ 2023-12-28  1:46 UTC (permalink / raw)
  To: Jakub Kicinski, Jiri Pirko, Sabrina Dubroca, netdev
  Cc: David S. Miller, Eric Dumazet, Paolo Abeni

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.

---
v4->v5:
- reduce nsim_dev_list_lock critical section
- fixed missing mutex unlock during unwind ladder
- rework nsim_dev_peer_write synchronization to take devlink lock as
  well as rtnl_lock
- return err msgs to user during linking if port doesn't exist or
  linking to self
- update tx stats outside of RCU lock

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                   | 153 ++++++++++++++++--
 drivers/net/netdevsim/netdev.c                |  27 +++-
 drivers/net/netdevsim/netdevsim.h             |   3 +
 .../selftests/drivers/net/netdevsim/Makefile  |  18 +++
 .../selftests/drivers/net/netdevsim/peer.sh   | 124 ++++++++++++++
 6 files changed, 310 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


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-01-10  1:53 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-28  1:46 [PATCH net-next v5 0/5] netdevsim: link and forward skbs between ports David Wei
2023-12-28  1:46 ` [PATCH net-next v5 1/5] netdevsim: maintain a list of probed netdevsims David Wei
2024-01-02 11:04   ` Jiri Pirko
2024-01-03 21:48     ` David Wei
2023-12-28  1:46 ` [PATCH net-next v5 2/5] netdevsim: allow two netdevsim ports to be connected David Wei
2024-01-02 11:11   ` Jiri Pirko
2024-01-03 21:56     ` David Wei
2024-01-04  9:30       ` Jiri Pirko
2024-01-04  1:39   ` Jakub Kicinski
2024-01-09 16:57     ` David Wei
2024-01-10  1:53       ` Jakub Kicinski
2023-12-28  1:46 ` [PATCH net-next v5 3/5] netdevsim: forward skbs from one connected port to another David Wei
2024-01-02 11:13   ` Jiri Pirko
2024-01-03 22:36     ` David Wei
2024-01-04  9:31       ` Jiri Pirko
2024-01-09 16:58         ` David Wei
2024-01-02 11:20   ` Eric Dumazet
2024-01-03 21:57     ` David Wei
2023-12-28  1:46 ` [PATCH net-next v5 4/5] netdevsim: add selftest for forwarding skb between connected ports David Wei
2023-12-28  1:46 ` [PATCH net-next v5 5/5] netdevsim: add Makefile for selftests David Wei

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).