Skip to content

net: improve core queue API handling while device is down

Jakub Kicinski netdev 2 versions – Applied

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

  1. v2 Latest4 patches 5 repliesApplied 4/4
  2. v13 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- allow also mode 2 and 3 (patch 3 is new)
v1: https://lore.kernel.org/[email protected]

Patches in v2 All 4 applied

#Subject and filesSizeRepliesApplied
1/4net: refactor netdev_rx_queue_restart() to use local qopsnet/core/netdev_rx_queue.c+12 -132 repliesApplied
2/4net: devmem: don't call queue stop / start when the interface is downinclude/net/netdev_queues.h net/core/netdev_rx_queue.c+14 -61 replyApplied
3/4net: page_pool: avoid false positive warning if NAPI was never addednet/core/dev.h net/core/page_pool.c+14 -51 replyApplied
4/4netdevsim: allow normal queue reset while downdrivers/net/netdevsim/netdev.c tools/testing/selftests/net/nl_netdev.py+21 -71 replyApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchMina Almasry
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net-next v2 0/4] net: improve core queue API handling while device is down

The core netdev_rx_queue_restart() doesn't currently take into account that the device may be down. The current and proposed queue API implementations deal with this by rejecting queue API calls while the device is down. We can do better, in theory we can still allow devmem binding when the device is down - we shouldn't stop and start the queues just try to allocate the memory. The reason we allocate the memory is that memory provider binding checks if any compatible page pool has been created (page_pool_check_memory_provider()).

Alternatively we could reject installing MP while the device is down but the MP assignment survives ifdown (so presumably MP doesn't cease to exist while down), and in general we allow configuration while down.

Previously I thought we need this as a fix, but gve rejects page pool calls while down, and so did Saeed in the patches he posted. So this series just makes the core act more sensibly but practically should be a noop for now.

v2:
- allow also mode 2 and 3 (patch 3 is new)
v1: https://lore.kernel.org/[email protected]

Jakub Kicinski (4):
net: refactor netdev_rx_queue_restart() to use local qops
net: devmem: don't call queue stop / start when the interface is down
net: page_pool: avoid false positive warning if NAPI was never added
netdevsim: allow normal queue reset while down

 include/net/netdev_queues.h              |  4 +++
 net/core/dev.h                           | 12 ++++++++
 drivers/net/netdevsim/netdev.c           | 10 +++----
 net/core/netdev_rx_queue.c               | 37 +++++++++++++-----------
 net/core/page_pool.c                     |  7 ++---
 tools/testing/selftests/net/nl_netdev.py | 18 +++++++++++-
 6 files changed, 59 insertions(+), 29 deletions(-)
Signature · 1 line
2.48.1