public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] page_pool: allow direct bulk recycling
@ 2024-03-29 16:55 Alexander Lobakin
  2024-03-29 16:55 ` [PATCH net-next 1/2] page_pool: check for PP direct cache locality later Alexander Lobakin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexander Lobakin @ 2024-03-29 16:55 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Alexander Lobakin, Lorenzo Bianconi,
	Toke Høiland-Jørgensen,
	nex.sw.ncis.osdt.itp.upstreaming, netdev, linux-kernel

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(-)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-03  9:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-29 16:55 [PATCH net-next 0/2] page_pool: allow direct bulk recycling Alexander Lobakin
2024-03-29 16:55 ` [PATCH net-next 1/2] page_pool: check for PP direct cache locality later Alexander Lobakin
2024-03-29 19:21   ` Mina Almasry
2024-03-30 12:41   ` Yunsheng Lin
2024-04-03  9:21     ` Alexander Lobakin
2024-03-29 16:55 ` [PATCH net-next 2/2] page_pool: try direct bulk recycling Alexander Lobakin
2024-04-03  1:40 ` [PATCH net-next 0/2] page_pool: allow " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox