[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221130220803.3657490-23-willy@infradead.org>
Date: Wed, 30 Nov 2022 22:08:01 +0000
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
To: Jesper Dangaard Brouer <hawk@...nel.org>,
Ilias Apalodimas <ilias.apalodimas@...aro.org>
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
netdev@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH 22/24] page_pool: Pass a netmem to init_callback()
Convert the only user of init_callback.
Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
include/net/page_pool.h | 2 +-
net/bpf/test_run.c | 4 ++--
net/core/page_pool.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/net/page_pool.h b/include/net/page_pool.h
index e13e3a8e83d3..4878fe30f52c 100644
--- a/include/net/page_pool.h
+++ b/include/net/page_pool.h
@@ -164,7 +164,7 @@ 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_callback)(struct netmem *nmem, void *arg);
void *init_arg;
};
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index 6094ef7cffcd..921b085802af 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -116,9 +116,9 @@ struct xdp_test_data {
#define TEST_XDP_FRAME_SIZE (PAGE_SIZE - sizeof(struct xdp_page_head))
#define TEST_XDP_MAX_BATCH 256
-static void xdp_test_run_init_page(struct page *page, void *arg)
+static void xdp_test_run_init_page(struct netmem *nmem, void *arg)
{
- struct xdp_page_head *head = phys_to_virt(page_to_phys(page));
+ struct xdp_page_head *head = netmem_to_virt(nmem);
struct xdp_buff *new_ctx, *orig_ctx;
u32 headroom = XDP_PACKET_HEADROOM;
struct xdp_test_data *xdp = arg;
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 5be78ec93af8..bed40515e74c 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -334,7 +334,7 @@ static void page_pool_set_pp_info(struct page_pool *pool,
nmem->pp = pool;
nmem->pp_magic |= PP_SIGNATURE;
if (pool->p.init_callback)
- pool->p.init_callback(netmem_page(nmem), pool->p.init_arg);
+ pool->p.init_callback(nmem, pool->p.init_arg);
}
static void page_pool_clear_pp_info(struct netmem *nmem)
--
2.35.1
Powered by blists - more mailing lists