The page_pool API is using page->private to store DMA addresses.
As pointed out by David Miller we can't use that on 32-bit architectures
with 64-bit DMA

This patch adds a new dma_addr_t struct to allow storing DMA addresses

Signed-off-by: Jesper Dangaard Brouer <bro...@redhat.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodi...@linaro.org>
---
 include/linux/mm_types.h |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 2c471a2c43fa..3060700752cc 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -95,6 +95,14 @@ struct page {
                         */
                        unsigned long private;
                };
+               struct {        /* page_pool used by netstack */
+                       /**
+                        * @dma_addr: Page_pool need to store DMA-addr, and
+                        * cannot use @private, as DMA-mappings can be 64-bit
+                        * even on 32-bit Architectures.
+                        */
+                       dma_addr_t dma_addr; /* Shares area with @lru */
+               };
                struct {        /* slab, slob and slub */
                        union {
                                struct list_head slab_list;     /* uses lru */

Reply via email to