mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 20:02:17 +00:00
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>
This commit is contained in:
parent
5c67bf0ec4
commit
bb005f2a70
1 changed files with 9 additions and 0 deletions
|
@ -112,6 +112,15 @@ static inline struct page *page_pool_dev_alloc_pages(struct page_pool *pool)
|
||||||
return page_pool_alloc_pages(pool, gfp);
|
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);
|
struct page_pool *page_pool_create(const struct page_pool_params *params);
|
||||||
|
|
||||||
void __page_pool_free(struct page_pool *pool);
|
void __page_pool_free(struct page_pool *pool);
|
||||||
|
|
Loading…
Reference in a new issue