summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2019-06-29 08:23:24 +0300
committerDavid S. Miller <davem@davemloft.net>2019-07-01 19:27:08 -0700
commitbb005f2a70742d66f8fe44d57e217c696e805d97 (patch)
tree93059125b245d106b32c34a45cc516fbe8bc7987 /include/net
parent5c67bf0ec4d0e6ff3c384ddc7846ed243b41251b (diff)
downloadlinux-bb005f2a70742d66f8fe44d57e217c696e805d97.tar.bz2
net: page_pool: add helper function for retrieving dma direction
Since the dma direction is stored in page pool params, offer an API helper for driver that choose not to keep track of it locally Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/page_pool.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/page_pool.h b/include/net/page_pool.h
index f07c518ef8a5..ee9c871d2043 100644
--- a/include/net/page_pool.h
+++ b/include/net/page_pool.h
@@ -112,6 +112,15 @@ static inline struct page *page_pool_dev_alloc_pages(struct page_pool *pool)
return page_pool_alloc_pages(pool, gfp);
}
+/* get the stored dma direction. A driver might decide to treat this locally and
+ * avoid the extra cache line from page_pool to determine the direction
+ */
+static
+inline enum dma_data_direction page_pool_get_dma_dir(struct page_pool *pool)
+{
+ return pool->p.dma_dir;
+}
+
struct page_pool *page_pool_create(const struct page_pool_params *params);
void __page_pool_free(struct page_pool *pool);