net/bnx2x: use contiguous allocation for DMA memory
authorAnatoly Burakov <anatoly.burakov@intel.com>
Wed, 11 Apr 2018 12:29:50 +0000 (13:29 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 11 Apr 2018 17:45:33 +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>
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/bnx2x/bnx2x.c
drivers/net/bnx2x/bnx2x_rxtx.c

index fb02d0f..382b50f 100644 (file)
@@ -177,9 +177,9 @@ bnx2x_dma_alloc(struct bnx2x_softc *sc, size_t size, struct bnx2x_dma *dma,
                        rte_get_timer_cycles());
 
        /* Caller must take care that strlen(mz_name) < RTE_MEMZONE_NAMESIZE */
-       z = rte_memzone_reserve_aligned(mz_name, (uint64_t) (size),
+       z = rte_memzone_reserve_aligned(mz_name, (uint64_t)size,
                                        SOCKET_ID_ANY,
-                                       0, align);
+                                       RTE_MEMZONE_IOVA_CONTIG, align);
        if (z == NULL) {
                PMD_DRV_LOG(ERR, "DMA alloc failed for %s", msg);
                return -ENOMEM;
index a0d4ac9..6be7277 100644 (file)
@@ -26,7 +26,8 @@ ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,
        if (mz)
                return mz;
 
-       return rte_memzone_reserve_aligned(z_name, ring_size, socket_id, 0, BNX2X_PAGE_SIZE);
+       return rte_memzone_reserve_aligned(z_name, ring_size, socket_id,
+                       RTE_MEMZONE_IOVA_CONTIG, BNX2X_PAGE_SIZE);
 }
 
 static void