diff options
author | Toke Høiland-Jørgensen <toke@redhat.com> | 2022-01-03 18:08:08 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-01-06 06:46:32 +0300 |
commit | 64693ec7774e471f817a725686d93903e919a2e5 (patch) | |
tree | 6a8bec9a7fbc46ab60d2e3cad7a51892c0e7ad21 /net/core/page_pool.c | |
parent | 35b2e549894b7ef0b6e7f3a70c2ab75b767cfce9 (diff) | |
download | linux-64693ec7774e471f817a725686d93903e919a2e5.tar.xz |
page_pool: Store the XDP mem id
Store the XDP mem ID inside the page_pool struct so it can be retrieved
later for use in bpf_prog_run().
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Link: https://lore.kernel.org/bpf/20220103150812.87914-4-toke@redhat.com
Diffstat (limited to 'net/core/page_pool.c')
-rw-r--r-- | net/core/page_pool.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/page_pool.c b/net/core/page_pool.c index f53786f6666d..7347d5c7dbe0 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -693,10 +693,12 @@ static void page_pool_release_retry(struct work_struct *wq) schedule_delayed_work(&pool->release_dw, DEFER_TIME); } -void page_pool_use_xdp_mem(struct page_pool *pool, void (*disconnect)(void *)) +void page_pool_use_xdp_mem(struct page_pool *pool, void (*disconnect)(void *), + struct xdp_mem_info *mem) { refcount_inc(&pool->user_cnt); pool->disconnect = disconnect; + pool->xdp_mem_id = mem->id; } void page_pool_destroy(struct page_pool *pool) |