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 AFD85A04DB; Wed, 9 Dec 2020 20:23:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AEF0AC950; Wed, 9 Dec 2020 20:22:45 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by dpdk.org (Postfix) with ESMTP id B3E35BE79; Wed, 9 Dec 2020 20:22:41 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id g20so637578plo.2; Wed, 09 Dec 2020 11:22:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2ZxiPBdi7vTyi6zR73rUMtvlKA6+NjerGb6zulWcr+8=; b=jtMPE4ZojuzHdUaP3QargaIA47yR7tn3+Fs7QQXz3WPNA5FHX2TVPmdKHFQG+gwW37 nfmem68tnn9duoX6i4GmCbKBjPDCquXTlkH6he19Npo4GC3izKGTBU4TnFF6pJhE85Ns 3h4ynrmUk1q7EBmf/WgBdJl4DehoK4Z18czfVFYZXGlnkGIU+DZMpW8JG3DF85wqJ5dC +nwxFAxUOoD0/JZqOSccoaXy6S+xbjQYvgXnBm4QR5n7uNWL+S1bi2ditXzt5QnmU4AY 4QlSiU1Nd6aegQ9B9LLinwGVD/XTuoJ9307WjulTswg/pdi7i6AmrQxGNK+4TDMpCS62 9iQA== 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:content-transfer-encoding; bh=2ZxiPBdi7vTyi6zR73rUMtvlKA6+NjerGb6zulWcr+8=; b=Vv48LHCXa6CWra3JIhoIkwuKn1NQADNuTfr7QoASWoOInqbHarrwRtU3QPwXs0uC5w IgCf8N7gYDfanBJeloelxFGO8WmpwWkXxt7B1vyipEhoO4w5jJ7qPkEp+6MYC4VHDRNR 6DqgMstwY4ym+A1vTw0MpAZpi+w6ry+6jqrE5+K15DjMSze5LyRTJOKEq6PiVTgw895H boj5Hv160nUUO91wPVEL3ArtvfjTPL8V2aY+Zeo5zkT9AusVKisHvxSGDYus+Ooj2Wpk TdetRo7pwuWQknnTePipYRGdrPhWTSJTpV1Sky5P/INLWAbOCem6uTJ3PEr0M0b1bhp6 39BQ== X-Gm-Message-State: AOAM530+fWqRBs7K2OWzbxYufc/z+MvrxIK+/51V2yufW5sQgSMUbsoI qEIvOymST/JXC4ODXVfzsf4sJ8kbXv0CImTH X-Google-Smtp-Source: ABdhPJz+3ETnCeBXjmH7T10QtrEJdSaSUeFGn5tbllQwiDf1uPl3Egrod5Z+rLKoJ3rSFvJOETPejw== X-Received: by 2002:a17:902:ab95:b029:da:3142:5fd with SMTP id f21-20020a170902ab95b02900da314205fdmr3334459plr.33.1607541759597; Wed, 09 Dec 2020 11:22:39 -0800 (PST) Received: from localhost.localdomain ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id y1sm3342449pfe.80.2020.12.09.11.22.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 11:22:39 -0800 (PST) From: Ajit Khaparde X-Google-Original-From: Ajit Khaparde To: dev@dpdk.org Cc: Samik Gupta , stable@dpdk.org Date: Wed, 9 Dec 2020 11:22:17 -0800 Message-Id: <20201209192233.6518-2-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201209192233.6518-1-ajit.khaparde@broadcom.com> References: <20201209192233.6518-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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)