Skip to content

page_pool: allow direct bulk recycling

Alexander Lobakin lkml netdev 1 version 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

  1. v1 Latest2 patches 3 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2page_pool: check for PP direct cache locality laterinclude/linux/skbuff.h net/core/page_pool.c net/core/skbuff.c +2 more+58 -593 repliesApplied
2/2page_pool: try direct bulk recyclingnet/core/page_pool.c+5 -20 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/2] page_pool: allow direct bulk recycling

Previously, there was no reliable way to check whether it's safe to use direct PP cache. The drivers were passing @allow_direct to the PP recycling functions and that was it. Bulk recycling is used by xdp_return_frame_bulk() on .ndo_xdp_xmit() frames completion where the page origin is unknown, thus the direct recycling has never been tried.
Now that we have at least 2 ways of checking if we're allowed to perform direct recycling -- pool->p.napi (Jakub) and pool->cpuid (Lorenzo), we can use them when doing bulk recycling as well. Just move that logic from the skb core to the PP core and call it before __page_pool_put_page() every time @allow_direct is false. Under high .ndo_xdp_xmit() traffic load, the win is 2-3% Pps assuming the sending driver uses xdp_return_frame_bulk() on Tx completion.

Alexander Lobakin (2):
page_pool: check for PP direct cache locality later
page_pool: try direct bulk recycling

 include/linux/skbuff.h | 12 ++++----
 net/core/page_pool.c   | 38 ++++++++++++++++++++---
 net/core/skbuff.c      | 70 +++++++++++++-----------------------------
 net/ipv4/esp4.c        |  2 +-
 net/ipv6/esp6.c        |  2 +-
 5 files changed, 63 insertions(+), 61 deletions(-)
Signature · 1 line
2.44.0