From: Lance Richardson Date: Thu, 18 Jul 2019 03:36:09 +0000 (+0530) Subject: net/bnxt: fix RSS table sizes X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4ab48e8241e67f691b210d83029a339efa7ff344;p=dpdk.git net/bnxt: fix RSS table sizes RSS table size is variable with BCM57500-based adapters. Use correct size when allocating memory for RSS state. Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers") Signed-off-by: Lance Richardson Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index c652b8f03e..98415633e4 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -117,6 +117,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) const struct rte_memzone *mz; char mz_name[RTE_MEMZONE_NAMESIZE]; uint32_t entry_length; + size_t rss_table_size; uint16_t max_vnics; int i; rte_iova_t mz_phys_addr; @@ -125,11 +126,12 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) BNXT_MAX_MC_ADDRS * RTE_ETHER_ADDR_LEN; if (BNXT_CHIP_THOR(bp)) - entry_length += BNXT_RSS_TBL_SIZE_THOR * - 2 * sizeof(*vnic->rss_table); + rss_table_size = BNXT_RSS_TBL_SIZE_THOR * + 2 * sizeof(*vnic->rss_table); else - entry_length += HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table); - entry_length = RTE_CACHE_LINE_ROUNDUP(entry_length); + rss_table_size = HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table); + + entry_length = RTE_CACHE_LINE_ROUNDUP(entry_length + rss_table_size); max_vnics = bp->max_vnics; snprintf(mz_name, RTE_MEMZONE_NAMESIZE, @@ -170,10 +172,10 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) vnic->rss_table_dma_addr = mz_phys_addr + (entry_length * i); vnic->rss_hash_key = (void *)((char *)vnic->rss_table + - HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table)); + rss_table_size); vnic->rss_hash_key_dma_addr = vnic->rss_table_dma_addr + - HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table); + rss_table_size; vnic->mc_list = (void *)((char *)vnic->rss_hash_key + HW_HASH_KEY_SIZE); vnic->mc_list_dma_addr = vnic->rss_hash_key_dma_addr +