Skip to content

Commit

Permalink
net: page_pool: add helper function for retrieving dma direction
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Jesper Dangaard Brouer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
apalos authored and davem330 committed Jul 2, 2019
1 parent 5c67bf0 commit bb005f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/net/page_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bb005f2

Please sign in to comment.