net: page_pool: add helper function to retrieve dma addresses
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 18 Jun 2019 13:05:12 +0000 (15:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2019 15:23:13 +0000 (11:23 -0400)
On a previous patch dma addr was stored in 'struct page'.
Use that to retrieve DMA addresses used by network drivers

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/page_pool.h

index 694d055e01efe70bd9310f130bbca0300f58e4d7..b885d86cb7a1d2d8df63ebb4bb3661b2dfcc1a92 100644 (file)
@@ -132,6 +132,11 @@ static inline void page_pool_recycle_direct(struct page_pool *pool,
        __page_pool_put_page(pool, page, true);
 }
 
+static inline dma_addr_t page_pool_get_dma_addr(struct page *page)
+{
+       return page->dma_addr;
+}
+
 static inline bool is_page_pool_compiled_in(void)
 {
 #ifdef CONFIG_PAGE_POOL