* [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve dma addresses
@ 2019-03-28 14:47 Ilias Apalodimas
2019-03-28 14:47 ` [net-next, PATCH 2/2] net: page_pool: add helper funtion to unmap " Ilias Apalodimas
2019-03-29 18:14 ` [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve " David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Ilias Apalodimas @ 2019-03-28 14:47 UTC (permalink / raw)
To: brouer, netdev; +Cc: tariqt, davem, toke, mcroce, Ilias Apalodimas
The page_pool API has no users for it's DMA capabilities yet.
Retrieving DMA addresses used by network drivers will be needed for real
users.
commit 1567b85eb8ad ("net: page_pool: don't use page->private to store dma_addr_t")
uses 'struct page' to store the addresses.
This patch provides a helper for retrieving them.
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
include/net/page_pool.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/net/page_pool.h b/include/net/page_pool.h
index 694d055..b885d86 100644
--- a/include/net/page_pool.h
+++ b/include/net/page_pool.h
@@ -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
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* [net-next, PATCH 2/2] net: page_pool: add helper funtion to unmap dma addresses
2019-03-28 14:47 [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve dma addresses Ilias Apalodimas
@ 2019-03-28 14:47 ` Ilias Apalodimas
2019-03-29 18:14 ` [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve " David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Ilias Apalodimas @ 2019-03-28 14:47 UTC (permalink / raw)
To: brouer, netdev; +Cc: tariqt, davem, toke, mcroce, Ilias Apalodimas
The page_pool API has no users for it's DMA capabilities yet.
Unmapping DMA addresses used by network drivers will be needed for real
users.
commit 1567b85eb8ad ("net: page_pool: don't use page->private to store dma_addr_t")
uses 'struct page' to store the addresses.
This patch provides a helper for unmapping them.
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
---
include/net/page_pool.h | 1 +
net/core/page_pool.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/include/net/page_pool.h b/include/net/page_pool.h
index b885d86..ad218ce 100644
--- a/include/net/page_pool.h
+++ b/include/net/page_pool.h
@@ -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,
diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 897a69a..83b4ba2 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -189,6 +189,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)
{
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve dma addresses
2019-03-28 14:47 [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve dma addresses Ilias Apalodimas
2019-03-28 14:47 ` [net-next, PATCH 2/2] net: page_pool: add helper funtion to unmap " Ilias Apalodimas
@ 2019-03-29 18:14 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-03-29 18:14 UTC (permalink / raw)
To: ilias.apalodimas; +Cc: brouer, netdev, tariqt, toke, mcroce
Please submit these patches alongside the first real user of these interfaces.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-01 18:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-28 14:47 [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve dma addresses Ilias Apalodimas
2019-03-28 14:47 ` [net-next, PATCH 2/2] net: page_pool: add helper funtion to unmap " Ilias Apalodimas
2019-03-29 18:14 ` [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve " David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).