From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8AF51A0471 for ; Thu, 18 Jul 2019 05:38:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E42D51BDFC; Thu, 18 Jul 2019 05:37:11 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id A63B01B957 for ; Thu, 18 Jul 2019 05:36:57 +0200 (CEST) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 4D78930C390; Wed, 17 Jul 2019 20:36:55 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 4D78930C390 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1563421015; bh=RYO15Y4aIMM4+gpzItMfYqweJfwzoMd8UKHS82iZ/OY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W8lL/NuAPJf88yfHcmbJ3grYzxuLv3L5ob8uCnpD0kwZGHlsRN4WyV84hhoz/ce0K TIFWM9eq79yDcrJyfOnoNG/dSnGSBw7FxhlyJ/i3HBUP/BJ/J18vB1IjJkKjD3ggmJ Nlnu2DJMaMCzb+aJ6yPz1gOyk+WqSKO5i5Fa3Jbg= Received: from C02VPB22HTD6.wifi.broadcom.net (c02vpb22htd6.wifi.broadcom.net [10.122.43.105]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id EF774AC0761; Wed, 17 Jul 2019 20:36:54 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Lance Richardson , Somnath Kotur Date: Thu, 18 Jul 2019 09:06:09 +0530 Message-Id: <20190718033616.37605-16-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190718033616.37605-1-ajit.khaparde@broadcom.com> References: <20190718033616.37605-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 15/22] net/bnxt: use correct RSS table sizes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Lance Richardson RSS table size is variable with BCM57500-based adapters. Use correct size when allocating memory for RSS state. Fixes: 05375e6f58df ("net/bnxt: enable rss for thor-based adapters") Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur Signed-off-by: Lance Richardson --- drivers/net/bnxt/bnxt_vnic.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index c652b8f03..98415633e 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 + -- 2.20.1 (Apple Git-117)