Skip to content

page_pool: allow caching from safely localized NAPI

Jakub Kicinski netdev 3 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 Latest posting 2/23 patches 8 repliesApplied 3/3
  2. v2 RFC posting 1/23 patches 5 repliesSuperseded
  3. v1 RFC2 patches 15 repliesSuperseded

Changes in v2 from the cover letter

- minor commit message fixes (patch 1)
v1: https://lore.kernel.org/all/[email protected]/
- rename the arg in_normal_napi -> napi_safe
- also allow recycling in __kfree_skb_defer()
rfcv2: https://lore.kernel.org/all/[email protected]/

Patches in v2 posting 2/2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3net: skb: plumb napi state thru skb freeing pathsnet/core/skbuff.c+20 -185 repliesApplied
2/3page_pool: allow caching from safely localized NAPIDocumentation/networking/page_pool.rst include/linux/netdevice.h include/linux/skbuff.h +4 more+37 -122 repliesApplied
3/3bnxt: hook NAPIs to page poolsdrivers/net/ethernet/broadcom/bnxt/bnxt.c+1 -00 repliesApplied

Reviews trailers per patch

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

PatchTariq ToukanJesper Dangaard BrouerDragos Tatulea
SeriesT-b
1/3R-b
2/3R-b A-b
3/3R-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 3 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 0/3] page_pool: allow caching from safely localized NAPI

I went back to the explicit "are we in NAPI method", mostly because I don't like having both around :( (even tho I maintain that in_softirq() && !in_hardirq() is as safe, as softirqs do not nest).

Still returning the skbs to a CPU, tho, not to the NAPI instance. I reckon we could create a small refcounted struct per NAPI instance which would allow sockets and other users so hold a persisent and safe reference. But that's a bigger change, and I get 90+% recycling thru the cache with just these patches (for RR and streaming tests with 100% CPU use it's almost 100%).

Some numbers for streaming test with 100% CPU use (from previous version, but really they perform the same):

		HW-GRO				page=page
		before		after		before		after

recycle:
cached: 0 138669686 0 150197505
cache_full: 0 223391 0 74582
ring: 138551933 9997191 149299454 0
ring_full: 0 488 3154 127590
released_refcnt: 0 0 0 0

alloc:
fast: 136491361 148615710 146969587 150322859
slow: 1772 1799 144 105
slow_high_order: 0 0 0 0
empty: 1772 1799 144 105
refill: 2165245 156302 2332880 2128
waive: 0 0 0 0

v2:
- minor commit message fixes (patch 1)
v1: https://lore.kernel.org/all/[email protected]/
- rename the arg in_normal_napi -> napi_safe
- also allow recycling in __kfree_skb_defer()
rfcv2: https://lore.kernel.org/all/[email protected]/

Jakub Kicinski (3):
net: skb: plumb napi state thru skb freeing paths
page_pool: allow caching from safely localized NAPI
bnxt: hook NAPIs to page pools

 Documentation/networking/page_pool.rst    |  1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt.c |  1 +
 include/linux/netdevice.h                 |  3 ++
 include/linux/skbuff.h                    | 20 +++++++----
 include/net/page_pool.h                   |  3 +-
 net/core/dev.c                            |  3 ++
 net/core/page_pool.c                      | 15 ++++++--
 net/core/skbuff.c                         | 42 ++++++++++++-----------
 8 files changed, 58 insertions(+), 30 deletions(-)
Signature · 1 line
2.39.2