veth: link RX queues to their NAPI instances
Status from this message: This series was applied to netdev/net-next.git (main)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest5 patches 0 repliesApplied 5/5
- v23 patches 0 repliesSuperseded
- v13 patches 1 replySuperseded
Changes in v3 from the cover letter
- Patch 1: add all NAPI instances before enabling any, as before the series (Sashiko [1]).
- Patch 3: reword the commit message. No code change.
- New patch 4: use netif_napi_add_config() (Sashiko [2]).
- New patch 5: check that each RX queue keeps its NAPI ID.
- v2: https://lore.kernel.org/all/[email protected]/
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
Patches in v3 All 5 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | veth: refactor NAPI enable pathsdrivers/ | +20 | 0 replies | Applied |
| 2/5 | veth: link RX queues to their NAPI instancesdrivers/ | +3 | 0 replies | Applied |
| 3/5 | selftests: net: veth: test RX queue NAPI linkstools/ | +78 | 0 replies | Applied |
| 4/5 | veth: use persistent NAPI configdrivers/ | +1 | 0 replies | Applied |
| 5/5 | selftests: net: veth: test that RX queues keep their NAPI IDstools/ | +29 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH net-next v3 0/5] veth: link RX queues to their NAPI instances
veth does not link its RX queues to their NAPI instances, so queue-get reports no napi-id for them. napi-get lists each NAPI instance, and its thread PID when NAPI is threaded, but not the RX queue it polls. Userspace cannot tell which NAPI thread to pin for a given queue, or which NAPI to change with napi-set.
There is also no way to busy poll an AF_XDP socket bound to a veth queue. xsk_bind() takes the socket's NAPI ID from the RX queue, and a veth RX queue has none.
Patch 1 is a cleanup to ease review of patch 2. veth_enable_xdp_range() adds the NAPI instances only to pass their napi_id to xdp_rxq_info_reg(), which no longer uses it. Patch 1 moves netif_napi_add() into veth_napi_enable_range(), before the loop that enables the NAPI instances. It also drops the napi_already_on and delete_napi arguments and two wrappers.
Patch 2 calls netif_queue_set_napi() in veth_napi_enable_range(), after napi_enable(). In veth_napi_del_range(), it clears the link with NULL before napi_disable().
Patch 3 adds RX queue NAPI link checks to veth.sh. The napi-ids of the RX queues must be the IDs of the NAPI instances of the device. The queues must be linked only while NAPI is enabled. The checks run with GRO on and with XDP attached, and across RX channel changes and link down/up.
Patch 4 uses netif_napi_add_config(). veth deletes the NAPI instance of an RX queue when it no longer needs it. With a persistent NAPI config, the queue keeps its NAPI ID and settings when veth adds the instance again.
Patch 5 adds checks to veth.sh that each RX queue keeps its NAPI ID.
---
Changes in v3:
- Patch 1: add all NAPI instances before enabling any, as before the series (Sashiko [1]).
- Patch 3: reword the commit message. No code change.
- New patch 4: use netif_napi_add_config() (Sashiko [2]).
- New patch 5: check that each RX queue keeps its NAPI ID.
- v2: https://lore.kernel.org/all/[email protected]/
[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Rebase on net-next. Patch 3 no longer applied after commit c1f04ea0aa0f ("selftests: net: check veth carrier after changing channel counts"). The conflict is in context only. No code change.
- v1: https://lore.kernel.org/all/[email protected]/
Tianyi Gao (5):
veth: refactor NAPI enable paths
veth: link RX queues to their NAPI instances
selftests: net: veth: test RX queue NAPI links
veth: use persistent NAPI config
selftests: net: veth: test that RX queues keep their NAPI IDs
drivers/net/veth.c | 85 ++++++---------------- tools/testing/selftests/net/veth.sh | 108 +++++++++++++++++++++++++++- 2 files changed, 130 insertions(+), 63 deletions(-)
base-commit: 6964ff21c5d8b75649211a52dbfd92753e605649
Signature · 1 line
2.56.0