From 17766722cc45c21ee80a713a25414e62735f004e Mon Sep 17 00:00:00 2001 From: Lance Richardson Date: Thu, 3 Oct 2019 20:48:56 -0700 Subject: [PATCH] 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 Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ring.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c index e650906dbf..b4c114de86 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); -- 2.20.1