net/ena: use contiguous allocation for DMA memory
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 11 Apr 2018 12:29:53 +0000 (13:29 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 11 Apr 2018 17:45:38 +0000 (19:45 +0200)
All hardware drivers should allocate IOVA-contiguous
memzones for their hardware resources.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
Tested-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
drivers/net/ena/base/ena_plat_dpdk.h

index 8cba319..9334519 100644 (file)
@@ -188,7 +188,8 @@ typedef uint64_t dma_addr_t;
                ENA_TOUCH(dmadev); ENA_TOUCH(handle);                   \
                snprintf(z_name, sizeof(z_name),                        \
                                "ena_alloc_%d", ena_alloc_cnt++);       \
-               mz = rte_memzone_reserve(z_name, size, SOCKET_ID_ANY, 0); \
+               mz = rte_memzone_reserve(z_name, size, SOCKET_ID_ANY,   \
+                               RTE_MEMZONE_IOVA_CONTIG);               \
                memset(mz->addr, 0, size);                              \
                virt = mz->addr;                                        \
                phys = mz->iova;                                        \
@@ -206,7 +207,8 @@ typedef uint64_t dma_addr_t;
                ENA_TOUCH(dmadev); ENA_TOUCH(dev_node);                 \
                snprintf(z_name, sizeof(z_name),                        \
                                "ena_alloc_%d", ena_alloc_cnt++);       \
-               mz = rte_memzone_reserve(z_name, size, node, 0); \
+               mz = rte_memzone_reserve(z_name, size, node,            \
+                               RTE_MEMZONE_IOVA_CONTIG);               \
                memset(mz->addr, 0, size);                              \
                virt = mz->addr;                                        \
                phys = mz->iova;                                        \
@@ -219,7 +221,8 @@ typedef uint64_t dma_addr_t;
                ENA_TOUCH(dmadev); ENA_TOUCH(dev_node);                 \
                snprintf(z_name, sizeof(z_name),                        \
                                "ena_alloc_%d", ena_alloc_cnt++);       \
-               mz = rte_memzone_reserve(z_name, size, node, 0); \
+               mz = rte_memzone_reserve(z_name, size, node,            \
+                               RTE_MEMZONE_IOVA_CONTIG);               \
                memset(mz->addr, 0, size);                              \
                virt = mz->addr;                                        \
        } while (0)