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 1573BA04DB; Thu, 10 Dec 2020 00:54:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7F1FDC950; Thu, 10 Dec 2020 00:53:57 +0100 (CET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by dpdk.org (Postfix) with ESMTP id 6968BBE79; Thu, 10 Dec 2020 00:53:55 +0100 (CET) Received: by mail-pf1-f169.google.com with SMTP id s21so2270816pfu.13; Wed, 09 Dec 2020 15:53:55 -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=FcO2kWWO/w6Y5QGmJOrwRxZZey9HJAXC+Guzx3TtYeSTx3Zly87Opq621plGPidvmm GxqEI/raHcCByOhDaPnkq5Szobb//2XjROIfmzZxstoaEOyD0R2vsRbXkOVwS4b9+dRE ayDndXBZIy8aGWTOiidzg6mNkSqJ4/1XbTcawQsPeRCi2L1m2B+vQDY7bU8LWjEGo0j4 HF//GF1lozvmSu/aFeGVyEmcUKw0i9PGqb83GTF6diaeElzFmsyGEWl1UwsPuh9joqQU Ga47gjJ2HTfbR5RwICC0N4MGYlLdhkGvl31G9YrGrHF9FWeoF/x2tnv/K1fweaItUxIW /C0w== 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=fBXY6YEBXAJ94isuYGDQ8PqRGfPbxyemk7aWoINyGQTfHGiozE3pfNzpA5n055SCZ6 l1LoyJfZPZcjoCLxq/7lUml3ILv5mXIGCxSgq46BfPpMfO33GtQx6wxCPqQGEhAtVrV8 ARtPgatpAnf+SeQep216pMQyRBRFbP9wpZymuDeC1MvhyHGBmaF1Xk/NfuyY+v6xHHST 96GmYBZyX9vrrFGAZuO7ttvA0OK5nJt9RYr9kFPfI4o53/wiEJon0mpvFxUYWURtbKx9 +eY0FVk0kuyGv7D/MMxhsZVAyfUJfE/PlMMm9DSx2jN+FsM3VUUPv/gEKgrUlvgiaij8 o1FQ== X-Gm-Message-State: AOAM531CZZO76Jfm6CxtQp0tB6N7Sh6zmyTa2evbWYa3OartXSmhyGxI mDdJPTs7Qo73kuJvBZwGun8AV+lEm11tz+dY X-Google-Smtp-Source: ABdhPJz29XfHt5IiJ9dRqp523t2Yvwo7Dw3q69Ld33kzRp3XTE/OJ0cxN5X5dpy5Lc137eU/8ijKsQ== X-Received: by 2002:a65:4801:: with SMTP id h1mr4127978pgs.44.1607558033377; Wed, 09 Dec 2020 15:53:53 -0800 (PST) Received: from localhost.localdomain ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id s7sm4047693pfh.207.2020.12.09.15.53.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Dec 2020 15:53:52 -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 15:53:31 -0800 Message-Id: <20201209235347.16180-2-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20201209235347.16180-1-ajit.khaparde@broadcom.com> References: <20201209192233.6518-1-ajit.khaparde@broadcom.com> <20201209235347.16180-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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)