diff options
| author | Alexander Lobakin <aleksander.lobakin@intel.com> | 2024-12-03 18:37:31 +0100 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2024-12-05 18:41:07 -0800 |
| commit | 024bfd2e9d80d7131f1178eb2235030b96f7ef0e (patch) | |
| tree | b649fc2374e2a6b8383d296addb43f9e3c1089cc /include/net/xdp.h | |
| parent | netmem: add a couple of page helper wrappers (diff) | |
| download | linux-024bfd2e9d80d7131f1178eb2235030b96f7ef0e.tar.gz linux-024bfd2e9d80d7131f1178eb2235030b96f7ef0e.zip | |
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>
Diffstat (limited to 'include/net/xdp.h')
| -rw-r--r-- | include/net/xdp.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/xdp.h b/include/net/xdp.h index 1253fe21ede7..f4020b29122f 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -194,7 +194,7 @@ xdp_frame_is_frag_pfmemalloc(const struct xdp_frame *frame) struct xdp_frame_bulk { int count; void *xa; - void *q[XDP_BULK_QUEUE_SIZE]; + netmem_ref q[XDP_BULK_QUEUE_SIZE]; }; static __always_inline void xdp_frame_bulk_init(struct xdp_frame_bulk *bq) |
