aboutsummaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen2022-01-03 16:08:07 +0100
committerAlexei Starovoitov2022-01-05 19:46:32 -0800
commit35b2e549894b7ef0b6e7f3a70c2ab75b767cfce9 (patch)
tree32a1813d431fd1875d576c44eb0f624d05802b5f /include/net
parent4a48ef70b93b8c7ed5190adfca18849e76387b80 (diff)
page_pool: Add callback to init pages when they are allocated
Add a new callback function to page_pool that, if set, will be called every time a new page is allocated. This will be used from bpf_test_run() to initialise the page data with the data provided by userspace when running XDP programs with redirect turned on. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com> Link: https://lore.kernel.org/bpf/20220103150812.87914-3-toke@redhat.com
Diffstat (limited to 'include/net')
-rw-r--r--include/net/page_pool.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/page_pool.h b/include/net/page_pool.h
index a4082406a003..d807b6800a4a 100644
--- a/include/net/page_pool.h
+++ b/include/net/page_pool.h
@@ -80,6 +80,8 @@ struct page_pool_params {
enum dma_data_direction dma_dir; /* DMA mapping direction */
unsigned int max_len; /* max DMA sync memory size */
unsigned int offset; /* DMA addr offset */
+ void (*init_callback)(struct page *page, void *arg);
+ void *init_arg;
};
struct page_pool {