aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/page_pool.c
diff options
context:
space:
mode:
authorSamiullah Khawaja <[email protected]>2024-12-11 21:20:30 +0000
committerJakub Kicinski <[email protected]>2024-12-13 02:49:07 +0000
commitb400f4b87430c105d92550cee5a72aea01fdf3d6 (patch)
treed00d81f3d59142758985f901fc2f4b5de52eb693 /net/core/page_pool.c
parentnet: page_pool: create page_pool_alloc_netmem (diff)
downloadkernel-b400f4b87430c105d92550cee5a72aea01fdf3d6.tar.gz
kernel-b400f4b87430c105d92550cee5a72aea01fdf3d6.zip
page_pool: Set `dma_sync` to false for devmem memory provider
Move the `dma_map` and `dma_sync` checks to `page_pool_init` to make them generic. Set dma_sync to false for devmem memory provider because the dma_sync APIs should not be used for dma_buf backed devmem memory provider. Cc: Jason Gunthorpe <[email protected]> Signed-off-by: Samiullah Khawaja <[email protected]> Signed-off-by: Mina Almasry <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/page_pool.c')
-rw-r--r--net/core/page_pool.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 7a17af286a9e..275a7fd209d7 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -287,6 +287,9 @@ static int page_pool_init(struct page_pool *pool,
}
if (pool->mp_priv) {
+ if (!pool->dma_map || !pool->dma_sync)
+ return -EOPNOTSUPP;
+
err = mp_dmabuf_devmem_init(pool);
if (err) {
pr_warn("%s() mem-provider init failed %d\n", __func__,