From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3E22EA0032 for ; Fri, 18 Feb 2022 13:45:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3992140141; Fri, 18 Feb 2022 13:45:40 +0100 (CET) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mails.dpdk.org (Postfix) with ESMTP id 8455540E28 for ; Fri, 18 Feb 2022 13:45:38 +0100 (CET) Received: by mail-wr1-f41.google.com with SMTP id i14so14368657wrc.10 for ; Fri, 18 Feb 2022 04:45:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cSSPbvfyU4tglzU4VAzenk0RaKQkxgckM8TUDFoJ9kQ=; b=YL2ht6dHn+MPsISCDBjMTVnjAA2HbJl1zs02WwUBSKBUNHafEEID/G91t443F73avk 6hH+aw7f763Vw+6i661D8kLJvrbtM3hsNoKh3CB4g+Y4idg+92tJTTqrThCyl+tq0XaH SK94eduqfoxG1TNrBovI4QVQ5SOwCaI541sVXJdzo7DWXZMc9LnF6FM5kSqxyNqug53q 4dOSs2FxbWUWwmlXoMP+Z1QU850bvFh+53zKRcZoc1BLQ92JAROkXcZs9G6Y6SByH6w4 utJ+aZqrYmCcmCzagfI2O1qGTYkoDgjFtIg0yJKfmLscobzbxGK95X38KPDzUbDR3L8v aBGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cSSPbvfyU4tglzU4VAzenk0RaKQkxgckM8TUDFoJ9kQ=; b=Ns2xk9uVSWgJEsilg+lA2TEdyWVQKHIQGwseSyDMuyg50MaKO+POmJpry3tEDUsiS3 4qGlay1KvzEJPCzUrdOWMTpNsTopxItNqBehKGEdG7L9p2wxiinq1YsIhGlcOlOjUs2J aWux+xqp8J2J2dnxYiCCUnOelEbLTUnoxFpxBMWXCS1JzQYouKd7ws+g6Vn/hZYXHV9S nZFJhwHCUDsV/q635d5QSPH5kznL+KyYa7I5lz6SbjZPd1gD3w87YAYEvTUXFOUH73lN lnZE2jZwdkfwubearuaAK2ps3lgeyXVgf5kOBG4BRZyuns+gS2bjqd8SnObJS1NRfruc PGTA== X-Gm-Message-State: AOAM530Tv2xE+LRt8Gawa/bxeGyUTBx/xRnIXwWT8UgWQKgsWkaLY8PD 3QwW7ObsDG2yIz7tXmrD4MgtAoYebbcbJSMP X-Google-Smtp-Source: ABdhPJwivu8spU3YulduxK3rv/wRBKVKbUoGYt1JJJYFAsrzONJSDbLIb3wH/RCAoNgFzO4y0QhkDg== X-Received: by 2002:a05:6000:1141:b0:1e4:b28e:461d with SMTP id d1-20020a056000114100b001e4b28e461dmr5680797wrx.320.1645188338219; Fri, 18 Feb 2022 04:45:38 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id z3sm5843982wmp.42.2022.02.18.04.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:45:37 -0800 (PST) From: luca.boccassi@gmail.com To: Ajit Khaparde Cc: Somnath Kotur , Kalesh AP , dpdk stable Subject: patch 'net/bnxt: fix ring calculation for representors' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:39:27 +0000 Message-Id: <20220218123931.1749595-118-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/045d6f7c38225082358a11c79570dd5535197482 Thanks. Luca Boccassi --- >From 045d6f7c38225082358a11c79570dd5535197482 Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Wed, 26 Jan 2022 10:13:26 -0800 Subject: [PATCH] net/bnxt: fix ring calculation for representors [ upstream commit 59e62818877aa45c0066743470192c317670678c ] Currently the Tx and Rx ring count for representors is fixed. It does not consider the number of rings created for the parent function. And that can cause issues not only during initialization but while running traffic. Instead check the number of rings created for the parent function while configuring the ring resources for representors. In some cases VF rep ring init may happen before the parent function's rings have been setup. And this can cause representor ring count to be configured as 0. In such cases, initialize the VF representor ring count to 8. Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure") Signed-off-by: Ajit Khaparde Reviewed-by: Somnath Kotur Reviewed-by: Kalesh AP --- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bnxt/bnxt_reps.c | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index b1ed54dd35..30265d245b 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -798,7 +798,7 @@ struct bnxt { uint16_t max_rx_rings; #define MAX_STINGRAY_RINGS 128U -#define BNXT_MAX_VF_REP_RINGS 8 +#define BNXT_MAX_VF_REP_RINGS 8U uint16_t max_nq_rings; uint16_t max_l2_ctx; diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c index db780c3d2c..b35c54fe13 100644 --- a/drivers/net/bnxt/bnxt_reps.c +++ b/drivers/net/bnxt/bnxt_reps.c @@ -523,7 +523,10 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, dev_info->max_mac_addrs = parent_bp->max_l2_ctx; dev_info->max_hash_mac_addrs = 0; - max_rx_rings = BNXT_MAX_VF_REP_RINGS; + max_rx_rings = parent_bp->rx_nr_rings ? + RTE_MIN(parent_bp->rx_nr_rings, BNXT_MAX_VF_REP_RINGS) : + BNXT_MAX_VF_REP_RINGS; + /* For the sake of symmetry, max_rx_queues = max_tx_queues */ dev_info->max_rx_queues = max_rx_rings; dev_info->max_tx_queues = max_rx_rings; @@ -603,10 +606,10 @@ int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev, struct rte_mbuf **buf_ring; int rc = 0; - if (queue_idx >= BNXT_MAX_VF_REP_RINGS) { + if (queue_idx >= rep_bp->rx_nr_rings) { PMD_DRV_LOG(ERR, "Cannot create Rx ring %d. %d rings available\n", - queue_idx, BNXT_MAX_VF_REP_RINGS); + queue_idx, rep_bp->rx_nr_rings); return -EINVAL; } @@ -702,10 +705,10 @@ int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev, struct bnxt_tx_queue *parent_txq, *txq; struct bnxt_vf_rep_tx_queue *vfr_txq; - if (queue_idx >= BNXT_MAX_VF_REP_RINGS) { + if (queue_idx >= rep_bp->rx_nr_rings) { PMD_DRV_LOG(ERR, "Cannot create Tx rings %d. %d rings available\n", - queue_idx, BNXT_MAX_VF_REP_RINGS); + queue_idx, rep_bp->rx_nr_rings); return -EINVAL; } @@ -777,10 +780,10 @@ int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats) { struct bnxt_representor *rep_bp = eth_dev->data->dev_private; - int i; + unsigned int i; memset(stats, 0, sizeof(*stats)); - for (i = 0; i < BNXT_MAX_VF_REP_RINGS; i++) { + for (i = 0; i < rep_bp->rx_nr_rings; i++) { stats->obytes += rep_bp->tx_bytes[i]; stats->opackets += rep_bp->tx_pkts[i]; stats->ibytes += rep_bp->rx_bytes[i]; @@ -800,9 +803,9 @@ int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, int bnxt_rep_stats_reset_op(struct rte_eth_dev *eth_dev) { struct bnxt_representor *rep_bp = eth_dev->data->dev_private; - int i; + unsigned int i; - for (i = 0; i < BNXT_MAX_VF_REP_RINGS; i++) { + for (i = 0; i < rep_bp->rx_nr_rings; i++) { rep_bp->tx_pkts[i] = 0; rep_bp->tx_bytes[i] = 0; rep_bp->rx_pkts[i] = 0; -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:42.266148105 +0000 +++ 0118-net-bnxt-fix-ring-calculation-for-representors.patch 2022-02-18 12:37:37.878796119 +0000 @@ -1 +1 @@ -From 59e62818877aa45c0066743470192c317670678c Mon Sep 17 00:00:00 2001 +From 045d6f7c38225082358a11c79570dd5535197482 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 59e62818877aa45c0066743470192c317670678c ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -29 +30 @@ -index 433f1c80be..0cbb58b2cf 100644 +index b1ed54dd35..30265d245b 100644 @@ -32,2 +33 @@ -@@ -831,7 +831,7 @@ struct bnxt { - uint16_t max_tx_rings; +@@ -798,7 +798,7 @@ struct bnxt { @@ -35 +35,2 @@ - #define MAX_STINGRAY_RINGS 236U + #define MAX_STINGRAY_RINGS 128U + @@ -42 +43 @@ -index 5e140f0cdb..e773932681 100644 +index db780c3d2c..b35c54fe13 100644 @@ -45 +46 @@ -@@ -548,7 +548,10 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, +@@ -523,7 +523,10 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, @@ -57 +58 @@ -@@ -629,10 +632,10 @@ int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev, +@@ -603,10 +606,10 @@ int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev, @@ -70 +71 @@ -@@ -729,10 +732,10 @@ int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev, +@@ -702,10 +705,10 @@ int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev, @@ -83 +84 @@ -@@ -805,10 +808,10 @@ int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, +@@ -777,10 +780,10 @@ int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, @@ -96 +97 @@ -@@ -828,9 +831,9 @@ int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, +@@ -800,9 +803,9 @@ int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev,