Skip to content

net: make sure we retain NAPI ordering on netdev->napi_list

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 Latest8 patches 4 repliesApplied 8/8
  2. v18 patches 18 repliesSuperseded

Changes in v2 from the cover letter

- [patch 2] allocate the array with kcalloc() instead of kvcalloc()
- [patch 2] set GFP_KERNEL_ACCOUNT when allocating queues
- [patch 6] don't null-check page pool before page_pool_destroy()
- [patch 6] controled -> controlled
- [patch 7] change mode to 0200
- [patch 7] reorder removal to be inverse of add
- [patch 7] fix the spaces vs tabs
v1: https://lore.kernel.org/[email protected]

Patches in v2 All 8 applied

#Subject and filesSizeRepliesApplied
1/8net: make sure we retain NAPI ordering on netdev->napi_listnet/core/dev.c+36 -60 repliesApplied
2/8netdev: define NETDEV_INTERNALDocumentation/networking/netdevices.rst net/core/netdev_rx_queue.c+11 -00 repliesApplied
3/8netdevsim: support NAPI configdrivers/net/netdevsim/netdev.c+1 -10 repliesApplied
4/8netdevsim: allocate rqs individuallydrivers/net/netdevsim/netdev.c drivers/net/netdevsim/netdevsim.h+32 -190 repliesApplied
5/8netdevsim: add queue alloc/free helpersdrivers/net/netdevsim/netdev.c+24 -110 repliesApplied
6/8netdevsim: add queue management API supportdrivers/net/netdevsim/netdev.c drivers/net/netdevsim/netdevsim.h+124 -122 repliesApplied
7/8netdevsim: add debugfs-triggered queue resetdrivers/net/netdevsim/netdev.c drivers/net/netdevsim/netdevsim.h+56 -02 repliesApplied
8/8selftests: net: test listing NAPI vs queue resetstools/testing/selftests/net/nl_netdev.py+18 -10 repliesApplied

Reviews trailers per patch

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

PatchWillem de BruijnEric DumazetStanislav FomichevMina Almasry
1/8R-b R-b
2/8R-b R-b
3/8R-b R-b
4/8R-b R-b
5/8R-b R-b
6/8R-b A-b R-b
7/8R-b A-b R-b
8/8R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 0/8] net: make sure we retain NAPI ordering on netdev->napi_list

I promised Eric to remove the rtnl protection of the NAPI list, when I sat down to implement it over the break I realized that the recently added NAPI ID retention will break the list ordering assumption we have in netlink dump. The ordering used to happen "naturally", because we'd always add NAPIs that the head of the list, and assign a new monotonically increasing ID.

Before the first patch of this series we'd still only add at the head of the list but now the newly added NAPI may inherit from its config an ID lower than something else already on the list.

The fix is in the first patch, the rest is netdevsim churn to test it. I'm posting this for net-next, because AFAICT the problem can't be triggered in net, given the very limited queue API adoption.

v2:
- [patch 2] allocate the array with kcalloc() instead of kvcalloc()
- [patch 2] set GFP_KERNEL_ACCOUNT when allocating queues
- [patch 6] don't null-check page pool before page_pool_destroy()
- [patch 6] controled -> controlled
- [patch 7] change mode to 0200
- [patch 7] reorder removal to be inverse of add
- [patch 7] fix the spaces vs tabs
v1: https://lore.kernel.org/[email protected]

Jakub Kicinski (8):
net: make sure we retain NAPI ordering on netdev->napi_list
netdev: define NETDEV_INTERNAL
netdevsim: support NAPI config
netdevsim: allocate rqs individually
netdevsim: add queue alloc/free helpers
netdevsim: add queue management API support
netdevsim: add debugfs-triggered queue reset
selftests: net: test listing NAPI vs queue resets

 Documentation/networking/netdevices.rst  |  10 +
 drivers/net/netdevsim/netdev.c           | 259 ++++++++++++++++++++---
 drivers/net/netdevsim/netdevsim.h        |   5 +-
 net/core/dev.c                           |  42 +++-
 net/core/netdev_rx_queue.c               |   1 +
 tools/testing/selftests/net/nl_netdev.py |  19 +-
 6 files changed, 294 insertions(+), 42 deletions(-)
Signature · 1 line
2.47.1