net/bnxt: use contiguous allocation for DMA memory
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>
This commit is contained in:
parent
66291ed828
commit
5da1f2d8eb
@ -3147,9 +3147,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
|
||||
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 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
|
||||
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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user