summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLance Richardson <lance.richardson@broadcom.com>2019-10-03 20:48:56 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-08 12:14:32 +0200
commit17766722cc45c21ee80a713a25414e62735f004e (patch)
tree7a86b76a5db83cc36a062d63a15fca06671b7d06 /drivers
parentcc5e26b8ef98f6e10206245ab0ad578511ae5ed2 (diff)
downloaddpdk-17766722cc45c21ee80a713a25414e62735f004e.zip
dpdk-17766722cc45c21ee80a713a25414e62735f004e.tar.gz
dpdk-17766722cc45c21ee80a713a25414e62735f004e.tar.xz
net/bnxt: fix ring alignment for Thor-based adapters
When using transmit/receive queue sizes smaller than 256, alignment requirements are not being met for Thor-based adapters. Fix by forcing memory addresses used for transmit/receive/aggregation ring allocations to be on 4K boundaries. Fixes: f8168ca0e690 ("net/bnxt: support thor controller") Cc: stable@dpdk.org Signed-off-by: Lance Richardson <lance.richardson@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bnxt/bnxt_ring.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index e650906..b4c114d 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -162,18 +162,21 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
int nq_ring_len = BNXT_CHIP_THOR(bp) ? cp_ring_len : 0;
int tx_ring_start = nq_ring_start + nq_ring_len;
+ tx_ring_start = RTE_ALIGN(tx_ring_start, 4096);
int tx_ring_len = tx_ring_info ?
RTE_CACHE_LINE_ROUNDUP(tx_ring_info->tx_ring_struct->ring_size *
sizeof(struct tx_bd_long)) : 0;
tx_ring_len = RTE_ALIGN(tx_ring_len, 4096);
int rx_ring_start = tx_ring_start + tx_ring_len;
+ rx_ring_start = RTE_ALIGN(rx_ring_start, 4096);
int rx_ring_len = rx_ring_info ?
RTE_CACHE_LINE_ROUNDUP(rx_ring_info->rx_ring_struct->ring_size *
sizeof(struct rx_prod_pkt_bd)) : 0;
rx_ring_len = RTE_ALIGN(rx_ring_len, 4096);
int ag_ring_start = rx_ring_start + rx_ring_len;
+ ag_ring_start = RTE_ALIGN(ag_ring_start, 4096);
int ag_ring_len = rx_ring_len * AGG_RING_SIZE_FACTOR;
ag_ring_len = RTE_ALIGN(ag_ring_len, 4096);