From: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
To: grygorii.strashko@ti.com, hawk@kernel.org, davem@davemloft.net
Cc: ast@kernel.org, linux-kernel@vger.kernel.org,
linux-omap@vger.kernel.org, xdp-newbies@vger.kernel.org,
ilias.apalodimas@linaro.org, netdev@vger.kernel.org,
daniel@iogearbox.net, jakub.kicinski@netronome.com,
john.fastabend@gmail.com,
Jesper Dangaard Brouer <brouer@redhat.com>,
Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Subject: [PATCH v3 net-next 2/7] net: page_pool: add helper function to unmap dma addresses
Date: Wed, 5 Jun 2019 16:20:04 +0300 [thread overview]
Message-ID: <20190605132009.10734-3-ivan.khoronzhuk@linaro.org> (raw)
In-Reply-To: <20190605132009.10734-1-ivan.khoronzhuk@linaro.org>
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
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: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
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 b885d86cb7a1..ad218cef88c5 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 5b2252c6d49b..205af7bd6d09 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -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)
{
--
2.17.1
next prev parent reply other threads:[~2019-06-05 13:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-05 13:20 [PATCH v3 net-next 0/7] net: ethernet: ti: cpsw: Add XDP support Ivan Khoronzhuk
2019-06-05 13:20 ` [PATCH v3 net-next 1/7] net: page_pool: add helper function to retrieve dma addresses Ivan Khoronzhuk
2019-06-05 13:20 ` Ivan Khoronzhuk [this message]
2019-06-05 13:20 ` [PATCH v3 net-next 3/7] net: ethernet: ti: cpsw: use cpsw as drv data Ivan Khoronzhuk
2019-06-05 13:20 ` [PATCH v3 net-next 4/7] net: ethernet: ti: cpsw_ethtool: simplify slave loops Ivan Khoronzhuk
2019-06-05 13:20 ` [PATCH v3 net-next 5/7] net: ethernet: ti: davinci_cpdma: add dma mapped submit Ivan Khoronzhuk
2019-06-05 13:20 ` [PATCH v3 net-next 6/7] net: ethernet: ti: davinci_cpdma: return handler status Ivan Khoronzhuk
2019-06-05 13:20 ` [PATCH v3 net-next 7/7] net: ethernet: ti: cpsw: add XDP support Ivan Khoronzhuk
2019-06-05 19:14 ` [PATCH v3 net-next 0/7] net: ethernet: ti: cpsw: Add " David Miller
2019-06-06 8:08 ` Jesper Dangaard Brouer
2019-06-06 13:24 ` Ivan Khoronzhuk
2019-06-06 20:56 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190605132009.10734-3-ivan.khoronzhuk@linaro.org \
--to=ivan.khoronzhuk@linaro.org \
--cc=ast@kernel.org \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=grygorii.strashko@ti.com \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jakub.kicinski@netronome.com \
--cc=john.fastabend@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xdp-newbies@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).