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

index 0b21653..ad7d925 100644 (file)
@@ -3147,9 +3147,10 @@ skip_init:
                                sizeof(struct rx_port_stats) + 512);
                if (!mz) {
                        mz = rte_memzone_reserve(mz_name, total_alloc_len,
-                                                SOCKET_ID_ANY,
-                                                RTE_MEMZONE_2MB |
-                                                RTE_MEMZONE_SIZE_HINT_ONLY);
+                                       SOCKET_ID_ANY,
+                                       RTE_MEMZONE_2MB |
+                                       RTE_MEMZONE_SIZE_HINT_ONLY |
+                                       RTE_MEMZONE_IOVA_CONTIG);
                        if (mz == NULL)
                                return -ENOMEM;
                }
@@ -3181,10 +3182,12 @@ skip_init:
                total_alloc_len = RTE_CACHE_LINE_ROUNDUP(
                                sizeof(struct tx_port_stats) + 512);
                if (!mz) {
-                       mz = rte_memzone_reserve(mz_name, total_alloc_len,
-                                                SOCKET_ID_ANY,
-                                                RTE_MEMZONE_2MB |
-                                                RTE_MEMZONE_SIZE_HINT_ONLY);
+                       mz = rte_memzone_reserve(mz_name,
+                                       total_alloc_len,
+                                       SOCKET_ID_ANY,
+                                       RTE_MEMZONE_2MB |
+                                       RTE_MEMZONE_SIZE_HINT_ONLY |
+                                       RTE_MEMZONE_IOVA_CONTIG);
                        if (mz == NULL)
                                return -ENOMEM;
                }
index 8fb8972..0e8a6a2 100644 (file)
@@ -166,10 +166,11 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
        mz = rte_memzone_lookup(mz_name);
        if (!mz) {
                mz = rte_memzone_reserve_aligned(mz_name, total_alloc_len,
-                                        SOCKET_ID_ANY,
-                                        RTE_MEMZONE_2MB |
-                                        RTE_MEMZONE_SIZE_HINT_ONLY,
-                                        getpagesize());
+                               SOCKET_ID_ANY,
+                               RTE_MEMZONE_2MB |
+                               RTE_MEMZONE_SIZE_HINT_ONLY |
+                               RTE_MEMZONE_IOVA_CONTIG,
+                               getpagesize());
                if (mz == NULL)
                        return -ENOMEM;
        }
index d4aeb4c..9ccc67e 100644 (file)
@@ -185,10 +185,10 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)
        mz = rte_memzone_lookup(mz_name);
        if (!mz) {
                mz = rte_memzone_reserve(mz_name,
-                                        entry_length * max_vnics,
-                                        SOCKET_ID_ANY,
-                                        RTE_MEMZONE_2MB |
-                                        RTE_MEMZONE_SIZE_HINT_ONLY);
+                               entry_length * max_vnics, SOCKET_ID_ANY,
+                               RTE_MEMZONE_2MB |
+                               RTE_MEMZONE_SIZE_HINT_ONLY |
+                               RTE_MEMZONE_IOVA_CONTIG);
                if (!mz)
                        return -ENOMEM;
        }