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 55D3BA0350 for ; Mon, 21 Feb 2022 16:43:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D3A5410E0; Mon, 21 Feb 2022 16:43:14 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 249894013F for ; Mon, 21 Feb 2022 16:43:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645458191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o4P/fcrbCn802AwUNSP+0lrhAdQ/xYNY5QEgXzst/A8=; b=SCxtzt8oZYV30O9WvO3EsxapJ90TCtIZYhnVyAqud3Kq7gpN9PetuQ/a9OcDCbYDXCBxSz 7fUr5zA4XeH2vTak3tD2xbFqeERg68n8t8qRST9vpFDR2uixR90LOIkNMDkFhF+IeYWsHk 23cjQC3zJnfIDlwFWIu+bpSy5WaNsak= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-574-7ET5OJmvOmePCUpGnuoiLg-1; Mon, 21 Feb 2022 10:43:06 -0500 X-MC-Unique: 7ET5OJmvOmePCUpGnuoiLg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 583901853026; Mon, 21 Feb 2022 15:43:05 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BA127E2E8; Mon, 21 Feb 2022 15:43:03 +0000 (UTC) From: Kevin Traynor 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 21.11.1 Date: Mon, 21 Feb 2022 15:36:07 +0000 Message-Id: <20220221153625.152324-178-ktraynor@redhat.com> In-Reply-To: <20220221153625.152324-1-ktraynor@redhat.com> References: <20220221153625.152324-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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 21.11.1 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/26/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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/863d7879427e6d05fcf13a2dac832c6bc6cca9b8 Thanks. Kevin --- >From 863d7879427e6d05fcf13a2dac832c6bc6cca9b8 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 433f1c80be..0cbb58b2cf 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -832,5 +832,5 @@ struct bnxt { uint16_t max_rx_rings; #define MAX_STINGRAY_RINGS 236U -#define BNXT_MAX_VF_REP_RINGS 8 +#define BNXT_MAX_VF_REP_RINGS 8U uint16_t max_nq_rings; diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c index a4ab64f511..b77cdeae96 100644 --- a/drivers/net/bnxt/bnxt_reps.c +++ b/drivers/net/bnxt/bnxt_reps.c @@ -550,5 +550,8 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, 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; @@ -631,8 +634,8 @@ int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev, 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; } @@ -731,8 +734,8 @@ int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev, 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; } @@ -807,8 +810,8 @@ int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, { 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]; @@ -830,7 +833,7 @@ 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; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-21 15:22:48.398393126 +0000 +++ 0178-net-bnxt-fix-ring-calculation-for-representors.patch 2022-02-21 15:22:44.350704709 +0000 @@ -1 +1 @@ -From 59e62818877aa45c0066743470192c317670678c Mon Sep 17 00:00:00 2001 +From 863d7879427e6d05fcf13a2dac832c6bc6cca9b8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 59e62818877aa45c0066743470192c317670678c ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -40 +41 @@ -index 5e140f0cdb..e773932681 100644 +index a4ab64f511..b77cdeae96 100644 @@ -43 +44 @@ -@@ -549,5 +549,8 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, +@@ -550,5 +550,8 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, @@ -53 +54 @@ -@@ -630,8 +633,8 @@ int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev, +@@ -631,8 +634,8 @@ int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev, @@ -64 +65 @@ -@@ -730,8 +733,8 @@ int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev, +@@ -731,8 +734,8 @@ int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev, @@ -75 +76 @@ -@@ -806,8 +809,8 @@ int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, +@@ -807,8 +810,8 @@ int bnxt_rep_stats_get_op(struct rte_eth_dev *eth_dev, @@ -86 +87 @@ -@@ -829,7 +832,7 @@ int bnxt_rep_stats_reset_op(struct rte_eth_dev *eth_dev) +@@ -830,7 +833,7 @@ int bnxt_rep_stats_reset_op(struct rte_eth_dev *eth_dev)