]> www.infradead.org Git - users/jedix/linux-maple.git/commit
page_pool: make page_pool_put_page_bulk() handle array of netmems
authorAlexander Lobakin <aleksander.lobakin@intel.com>
Tue, 3 Dec 2024 17:37:31 +0000 (18:37 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 Dec 2024 02:41:07 +0000 (18:41 -0800)
commit024bfd2e9d80d7131f1178eb2235030b96f7ef0e
treeb649fc2374e2a6b8383d296addb43f9e3c1089cc
parent9bd9f72a74344b54cfb6fcabf1173e6c6e5c6952
page_pool: make page_pool_put_page_bulk() handle array of netmems

Currently, page_pool_put_page_bulk() indeed takes an array of pointers
to the data, not pages, despite the name. As one side effect, when
you're freeing frags from &skb_shared_info, xdp_return_frame_bulk()
converts page pointers to virtual addresses and then
page_pool_put_page_bulk() converts them back. Moreover, data pointers
assume every frag is placed in the host memory, making this function
non-universal.
Make page_pool_put_page_bulk() handle array of netmems. Pass frag
netmems directly and use virt_to_netmem() when freeing xdpf->data,
so that the PP core will then get the compound netmem and take care
of the rest.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20241203173733.3181246-9-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