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 70C60A09E9; Tue, 8 Dec 2020 21:12:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 80788C922; Tue, 8 Dec 2020 21:11:45 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by dpdk.org (Postfix) with ESMTP id 98B8FA3 for ; Tue, 8 Dec 2020 21:11:42 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id x15so7557691pll.2 for ; Tue, 08 Dec 2020 12:11:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=nO7YXD+wpLvax3o8JJncR5AxdXEhH7JUi6HlOIpmbxU=; b=AW9OhXgwdRFeH0L5ruJATutQXCSDc1ULRRpteYOwXCRXpoh6AfGKW0c5TS1bgj1CKD 1i9tNXSNNSzFX1eEoC4B1Gl20bgErC1cJoTu2ir7qfbEMFxJlCvUmQMMrnpbHTviaU0C IqfRDlK4aPHRBwaAtoOF4bDi1gPbgzM/E1KJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=nO7YXD+wpLvax3o8JJncR5AxdXEhH7JUi6HlOIpmbxU=; b=iqiqKLXc9a0tFBoBvVs373PgmddzIQbr7sl/CFnaorWXsN3I4Wr+SO4fXub9pQ8eSr 9iqYrcwXbL3KKVEVg4z3isCOeWrH2gSHsyh9gxsCSYKDexe/0TOZmbOLoZE4/JV+f4lw S0J7hzxWibzlqoPeRigNfx18Wo2xScBR0jHQ8txnhb9v3TJ6QHeyTka8vDUZH2kmtxgc V3fWrVVoxWoMMTE+WlxpDQasX/x/XfKS62nqzjohV98tEIzfgabLEuzvnJsN2Z7JxUMD zeY9fZ90faTwC4bHWtKFC47To33kRNY0P7/IlaCt+RYkxB6oon2ipE000c2B9m1Ra6np zEWw== X-Gm-Message-State: AOAM530ARkNRzREw7009PpYFTasAKphu8bkQ2ASZu6OjSWw3L7+dO5qX bRWNmf1C7MJHchliu1qqv3MCifgrP6OcWdEEdYGwHXMRSVJiiL8Ck3VBkHf43pbzbWG1NggURr8 FJiOBgGZSx2b3e2jkLnl86jZkTcVF0lCKX5N/xPIHh0Om/krQdvit2lEwshr8W9KKqQ== X-Google-Smtp-Source: ABdhPJyHjxI+H/z1ji2dNFpemgVEvy9wuiwRi7/nZeUi9peGiHPUm2vEuuyBk/S8hfHceT3UWLuX4Q== X-Received: by 2002:a17:902:eb0c:b029:db:c0d6:6289 with SMTP id l12-20020a170902eb0cb02900dbc0d66289mr3763004plb.12.1607458300093; Tue, 08 Dec 2020 12:11:40 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id x10sm5729187pfc.157.2020.12.08.12.11.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 12:11:39 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: Samik Gupta , stable@dpdk.org Date: Tue, 8 Dec 2020 12:11:18 -0800 Message-Id: <20201208201134.47844-2-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201208201134.47844-1-ajit.khaparde@broadcom.com> References: <20201208201134.47844-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [PATCH 01/17] net/bnxt: fix RX rings in RSS redirection table 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: Samik Gupta This commit introduces a limit on the number of RX rings included in the RSS redirection table to a value no larger than the size supported by Thor as defined by BNXT_RSS_TBL_SIZE_THOR. Fixes: d819382543f3 ("net/bnxt: add RSS redirection table operations") Cc: stable@dpdk.org Reviewed-by: Ajit Khaparde Signed-off-by: Samik Gupta --- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 90ced972c..9bd4f1da9 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -389,7 +389,7 @@ struct bnxt_coal { #define DBR_TYPE_NQ (0xaULL << 60) #define DBR_TYPE_NQ_ARM (0xbULL << 60) -#define BNXT_RSS_TBL_SIZE_THOR 512 +#define BNXT_RSS_TBL_SIZE_THOR 512U #define BNXT_RSS_ENTRIES_PER_CTX_THOR 64 #define BNXT_MAX_RSS_CTXTS_THOR \ (BNXT_RSS_TBL_SIZE_THOR / BNXT_RSS_ENTRIES_PER_CTX_THOR) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 81c8f8d79..c363c8427 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -207,12 +207,15 @@ int is_bnxt_in_error(struct bnxt *bp) static uint16_t bnxt_rss_ctxts(const struct bnxt *bp) { + unsigned int num_rss_rings = RTE_MIN(bp->rx_nr_rings, + BNXT_RSS_TBL_SIZE_THOR); + if (!BNXT_CHIP_THOR(bp)) return 1; - return RTE_ALIGN_MUL_CEIL(bp->rx_nr_rings, + return RTE_ALIGN_MUL_CEIL(num_rss_rings, BNXT_RSS_ENTRIES_PER_CTX_THOR) / - BNXT_RSS_ENTRIES_PER_CTX_THOR; + BNXT_RSS_ENTRIES_PER_CTX_THOR; } uint16_t bnxt_rss_hash_tbl_size(const struct bnxt *bp) @@ -424,6 +427,14 @@ static int bnxt_setup_one_vnic(struct bnxt *bp, uint16_t vnic_id) if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS) { int j, nr_ctxs = bnxt_rss_ctxts(bp); + if (bp->rx_nr_rings > BNXT_RSS_TBL_SIZE_THOR) { + PMD_DRV_LOG(ERR, "RxQ cnt %d > reta_size %d\n", + bp->rx_nr_rings, BNXT_RSS_TBL_SIZE_THOR); + PMD_DRV_LOG(ERR, + "Only queues 0-%d will be in RSS table\n", + BNXT_RSS_TBL_SIZE_THOR - 1); + } + rc = 0; for (j = 0; j < nr_ctxs; j++) { rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, j); -- 2.21.1 (Apple Git-122.3) -- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.