net: page_pool: add helper function to unmap dma addresses
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 18 Jun 2019 13:05:17 +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 unmap 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
net/core/page_pool.c

index b885d86cb7a1d2d8df63ebb4bb3661b2dfcc1a92..ad218cef88c5482f617e128fa35cb2795768d564 100644 (file)
@@ -110,6 +110,7 @@ static inline struct page *page_pool_dev_alloc_pages(struct page_pool *pool)
 struct page_pool *page_pool_create(const struct page_pool_params *params);
 
 void page_pool_destroy(struct page_pool *pool);
+void page_pool_unmap_page(struct page_pool *pool, struct page *page);
 
 /* Never call this directly, use helpers below */
 void __page_pool_put_page(struct page_pool *pool,
index 5b2252c6d49baf58e7cc3f399adb299b5147bf60..205af7bd6d098e27288a8f4f61233338b74eb037 100644 (file)
@@ -190,6 +190,13 @@ static void __page_pool_clean_page(struct page_pool *pool,
        page->dma_addr = 0;
 }
 
+/* unmap the page and clean our state */
+void page_pool_unmap_page(struct page_pool *pool, struct page *page)
+{
+       __page_pool_clean_page(pool, page);
+}
+EXPORT_SYMBOL(page_pool_unmap_page);
+
 /* Return a page to the page allocator, cleaning up our state */
 static void __page_pool_return_page(struct page_pool *pool, struct page *page)
 {