netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next v3 0/4] virtio_net: Link queues to NAPIs
@ 2025-01-21 19:10 Joe Damato
  2025-01-21 19:10 ` [RFC net-next v3 1/4] net: protect queue -> napi linking with netdev_lock() Joe Damato
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Joe Damato @ 2025-01-21 19:10 UTC (permalink / raw)
  To: netdev
  Cc: gerhard, jasowang, leiyang, xuanzhuo, mkarsten, Joe Damato,
	Alexander Lobakin, Alexei Starovoitov, Andrew Lunn,
	open list:XDP (eXpress Data Path):Keyword:(?:b|_)xdp(?:b|_),
	Daniel Borkmann, David S. Miller, Eric Dumazet,
	Eugenio Pérez, Jakub Kicinski, Jesper Dangaard Brouer,
	John Fastabend, Kuniyuki Iwashima, open list, Lorenzo Bianconi,
	Michael S. Tsirkin, Paolo Abeni, Sebastian Andrzej Siewior,
	Simon Horman, open list:VIRTIO CORE AND NET DRIVERS

Greetings:

Welcome to RFC v3, since net-next is closed. See changelog below.

Recently [1], Jakub mentioned that there were a few drivers that are not
yet mapping queues to NAPIs.

While I don't have any of the other hardware mentioned, I do happen to
have a virtio_net laying around ;)

I've attempted to link queues to NAPIs, using the new locking Jakub
introduced avoiding RTNL.

Note: It seems virtio_net uses TX-only NAPIs which do not have NAPI IDs.
As such, I've left the TX NAPIs unset (as opposed to setting them to 0).

As per the discussion on the v2 [2], all RX queues now have their NAPIs
linked.

See the commit message of patch 3 for an example of how to get the NAPI
to queue mapping information.

See the commit message of patch 4 for an example of how NAPI IDs are
persistent despite queue count changes.

Thanks,
Joe

[1]: https://lore.kernel.org/netdev/20250109084301.2445a3e3@kernel.org/
[2]: https://lore.kernel.org/netdev/f8fe5618-af94-4f5b-8dbc-e8cae744aedf@engleder-embedded.com/

v3:
  - patch 3:
    - Removed the xdp checks completely, as Gerhard Engleder pointed
      out, they are likely not necessary.

  - patch 4:
    - Added Xuan Zhuo's Reviewed-by.

v2:
  - patch 1:
    - New in the v2 from Jakub.

  - patch 2:
    - Previously patch 1, unchanged from v1.
    - Added Gerhard Engleder's Reviewed-by.
    - Added Lei Yang's Tested-by.

  - patch 3:
    - Introduced virtnet_napi_disable to eliminate duplicated code
      in virtnet_xdp_set, virtnet_rx_pause, virtnet_disable_queue_pair,
      refill_work as suggested by Jason Wang.
    - As a result of the above refactor, dropped Reviewed-by and
      Tested-by from patch 3.

  - patch 4:
    - New in v2. Adds persistent NAPI configuration. See commit message
      for more details.

Jakub Kicinski (1):
  net: protect queue -> napi linking with netdev_lock()

Joe Damato (3):
  virtio_net: Prepare for NAPI to queue mapping
  virtio_net: Map NAPIs to queues
  virtio_net: Use persistent NAPI config

 drivers/net/virtio_net.c      | 38 +++++++++++++++++++++++++++--------
 include/linux/netdevice.h     |  9 +++++++--
 include/net/netdev_rx_queue.h |  2 +-
 net/core/dev.c                | 16 ++++++++++++---
 4 files changed, 51 insertions(+), 14 deletions(-)


base-commit: cf33d96f50903214226b379b3f10d1f262dae018
-- 
2.25.1


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

end of thread, other threads:[~2025-01-27 22:32 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-21 19:10 [RFC net-next v3 0/4] virtio_net: Link queues to NAPIs Joe Damato
2025-01-21 19:10 ` [RFC net-next v3 1/4] net: protect queue -> napi linking with netdev_lock() Joe Damato
2025-01-27 21:37   ` Jakub Kicinski
2025-01-27 22:21     ` Joe Damato
2025-01-21 19:10 ` [RFC net-next v3 2/4] virtio_net: Prepare for NAPI to queue mapping Joe Damato
2025-01-22  6:12   ` Jason Wang
2025-01-22 17:40     ` Joe Damato
2025-01-23  2:40       ` Jason Wang
2025-01-23  2:47         ` Joe Damato
2025-01-24  1:14           ` Jason Wang
2025-01-24 20:19             ` Joe Damato
2025-01-26  8:04               ` Jason Wang
2025-01-27 17:52                 ` Joe Damato
2025-01-27 19:31                   ` Joe Damato
2025-01-27 21:33                     ` Jakub Kicinski
2025-01-27 22:07                       ` Joe Damato
2025-01-27 22:24                         ` Jakub Kicinski
2025-01-27 22:32                           ` Joe Damato
2025-01-21 19:10 ` [RFC net-next v3 3/4] virtio_net: Map NAPIs to queues Joe Damato
2025-01-21 20:13   ` Gerhard Engleder
2025-01-22  6:13   ` Jason Wang
2025-01-21 19:10 ` [RFC net-next v3 4/4] virtio_net: Use persistent NAPI config Joe Damato
2025-01-21 20:18   ` Gerhard Engleder
2025-01-22  6:13   ` Jason Wang

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