lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Mar 2019 16:47:17 +0200
From:   Ilias Apalodimas <ilias.apalodimas@...aro.org>
To:     brouer@...hat.com, netdev@...r.kernel.org
Cc:     tariqt@...lanox.com, davem@...emloft.net, toke@...hat.com,
        mcroce@...hat.com, Ilias Apalodimas <ilias.apalodimas@...aro.org>
Subject: [net-next, PATCH 1/2] net: page_pool: add helper funtion to retrieve dma addresses

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@...aro.org>
Signed-off-by: Jesper Dangaard Brouer <brouer@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ