]> www.infradead.org Git - users/jedix/linux-maple.git/commit
page_pool: allow mixing PPs within one bulk
authorAlexander Lobakin <aleksander.lobakin@intel.com>
Wed, 11 Dec 2024 17:26:38 +0000 (18:26 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 13 Dec 2024 02:22:51 +0000 (18:22 -0800)
commitfcc680a647ba77370480fe753664cc10d572b240
tree523b787550ae95aabf1334341226e5dfbf1bfb69
parenta42d71e322a8066dcfa228ce8529bb073c521ae9
page_pool: allow mixing PPs within one bulk

The main reason for this change was to allow mixing pages from different
&page_pools within one &xdp_buff/&xdp_frame. Why not? With stuff like
devmem and io_uring zerocopy Rx, it's required to have separate PPs for
header buffers and payload buffers.
Adjust xdp_return_frame_bulk() and page_pool_put_netmem_bulk(), so that
they won't be tied to a particular pool. Let the latter create a
separate bulk of pages which's PP is different from the first netmem of
the bulk and process it after the main loop.
This greatly optimizes xdp_return_frame_bulk(): no more hashtable
lookups and forced flushes on PP mismatch. Also make
xdp_flush_frame_bulk() inline, as it's just one if + function call + one
u32 read, not worth extending the call ladder.

Co-developed-by: Toke Høiland-Jørgensen <toke@redhat.com> # iterative
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Suggested-by: Jakub Kicinski <kuba@kernel.org> # while (count)
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Link: https://patch.msgid.link/20241211172649.761483-2-aleksander.lobakin@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/page_pool/types.h
include/net/xdp.h
net/core/page_pool.c
net/core/xdp.c