[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250116055302.14308-1-jdamato@fastly.com>
Date: Thu, 16 Jan 2025 05:52:55 +0000
From: Joe Damato <jdamato@...tly.com>
To: netdev@...r.kernel.org
Cc: gerhard@...leder-embedded.com,
jasowang@...hat.com,
leiyang@...hat.com,
mkarsten@...terloo.ca,
Joe Damato <jdamato@...tly.com>,
Alexander Lobakin <aleksander.lobakin@...el.com>,
Alexei Starovoitov <ast@...nel.org>,
Andrew Lunn <andrew+netdev@...n.ch>,
bpf@...r.kernel.org (open list:XDP (eXpress Data Path):Keyword:(?:\b|_)xdp(?:\b|_)),
Daniel Borkmann <daniel@...earbox.net>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Eugenio PĂ©rez <eperezma@...hat.com>,
Jakub Kicinski <kuba@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
linux-kernel@...r.kernel.org (open list),
Lorenzo Bianconi <lorenzo@...nel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Paolo Abeni <pabeni@...hat.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Simon Horman <horms@...nel.org>,
virtualization@...ts.linux.dev (open list:VIRTIO CORE AND NET DRIVERS),
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>
Subject: [PATCH net-next v2 0/4] virtio_net: Link queues to NAPIs
Greetings:
Welcome to v2.
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).
Note: I tried to handle the XDP case correctly (namely XDP queues should
not have NAPIs registered, but AF_XDP/XSK should have NAPIs registered,
IIUC). I would appreciate reviewers familiar with virtio_net double
checking me on that.
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/
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 | 47 +++++++++++++++++++++++++++++------
include/linux/netdevice.h | 9 +++++--
include/net/netdev_rx_queue.h | 2 +-
net/core/dev.c | 16 +++++++++---
4 files changed, 60 insertions(+), 14 deletions(-)
base-commit: 0b21051a4a6208c721615bb0285a035b416a4383
--
2.25.1
Powered by blists - more mailing lists