[dpdk-stable] patch 'net/bnxt: fix Tx queue profile selection' has been queued to stable release 19.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Feb 11 12:19:59 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.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/13/20. 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.

Thanks.

Luca Boccassi

---
>From 46007e06afa0f6112fe7c64f95472b94e58ae1d3 Mon Sep 17 00:00:00 2001
From: Somnath Kotur <somnath.kotur at broadcom.com>
Date: Fri, 20 Dec 2019 18:29:37 -0800
Subject: [PATCH] net/bnxt: fix Tx queue profile selection

[ upstream commit 816eacad1116b06581df3ca6b269990d24f63dac ]

In the case when CoS classification is disabled, driver was iterating
looking for only lossy profiles as that is what is expected to be used
for regular NIC operations. But in certain custom profiles, there were
no lossy profiles configured, only lossless profiles instead.
To handle such cases, it is better to fallback to using the first valid
profile.

Fixes: 698aa7e95325 ("net/bnxt: add code to determine the Tx COS queue")

Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 44 +++++++++++++++++++++++++++++-------
 drivers/net/bnxt/bnxt_hwrm.h |  3 +++
 2 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 6b8ebbe5b8..7628ae9402 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1216,6 +1216,35 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,
 	return rc;
 }
 
+static bool bnxt_find_lossy_profile(struct bnxt *bp)
+{
+	int i = 0;
+
+	for (i = BNXT_COS_QUEUE_COUNT - 1; i >= 0; i--) {
+		if (bp->tx_cos_queue[i].profile ==
+		    HWRM_QUEUE_SERVICE_PROFILE_LOSSY) {
+			bp->tx_cosq_id[0] = bp->tx_cos_queue[i].id;
+			return true;
+		}
+	}
+	return false;
+}
+
+static void bnxt_find_first_valid_profile(struct bnxt *bp)
+{
+	int i = 0;
+
+	for (i = BNXT_COS_QUEUE_COUNT - 1; i >= 0; i--) {
+		if (bp->tx_cos_queue[i].profile !=
+		    HWRM_QUEUE_SERVICE_PROFILE_UNKNOWN &&
+		    bp->tx_cos_queue[i].id !=
+		    HWRM_QUEUE_SERVICE_PROFILE_UNKNOWN) {
+			bp->tx_cosq_id[0] = bp->tx_cos_queue[i].id;
+			break;
+		}
+	}
+}
+
 int bnxt_hwrm_queue_qportcfg(struct bnxt *bp)
 {
 	int rc = 0;
@@ -1275,14 +1304,13 @@ get_rx_info:
 						bp->tx_cos_queue[i].id;
 			}
 		} else {
-			for (i = BNXT_COS_QUEUE_COUNT - 1; i >= 0; i--) {
-				if (bp->tx_cos_queue[i].profile ==
-					HWRM_QUEUE_SERVICE_PROFILE_LOSSY) {
-					bp->tx_cosq_id[0] =
-						bp->tx_cos_queue[i].id;
-					break;
-				}
-			}
+			/* When CoS classification is disabled, for normal NIC
+			 * operations, ideally we should look to use LOSSY.
+			 * If not found, fallback to the first valid profile
+			 */
+			if (!bnxt_find_lossy_profile(bp))
+				bnxt_find_first_valid_profile(bp);
+
 		}
 	}
 
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index abe5de9db6..d8d1360f91 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -35,6 +35,9 @@ struct bnxt_cp_ring_info;
 #define HWRM_QUEUE_SERVICE_PROFILE_LOSSY \
 	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY
 
+#define HWRM_QUEUE_SERVICE_PROFILE_UNKNOWN \
+	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
+
 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MINIMAL_STATIC \
 	HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC
 #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MAXIMAL \
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-11 11:17:40.921961807 +0000
+++ 0053-net-bnxt-fix-Tx-queue-profile-selection.patch	2020-02-11 11:17:38.424001795 +0000
@@ -1,8 +1,10 @@
-From 816eacad1116b06581df3ca6b269990d24f63dac Mon Sep 17 00:00:00 2001
+From 46007e06afa0f6112fe7c64f95472b94e58ae1d3 Mon Sep 17 00:00:00 2001
 From: Somnath Kotur <somnath.kotur at broadcom.com>
 Date: Fri, 20 Dec 2019 18:29:37 -0800
 Subject: [PATCH] net/bnxt: fix Tx queue profile selection
 
+[ upstream commit 816eacad1116b06581df3ca6b269990d24f63dac ]
+
 In the case when CoS classification is disabled, driver was iterating
 looking for only lossy profiles as that is what is expected to be used
 for regular NIC operations. But in certain custom profiles, there were
@@ -11,7 +13,6 @@
 profile.
 
 Fixes: 698aa7e95325 ("net/bnxt: add code to determine the Tx COS queue")
-Cc: stable at dpdk.org
 
 Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
 Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
@@ -21,10 +22,10 @@
  2 files changed, 39 insertions(+), 8 deletions(-)
 
 diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
-index d0dcd561c1..bee4c154fd 100644
+index 6b8ebbe5b8..7628ae9402 100644
 --- a/drivers/net/bnxt/bnxt_hwrm.c
 +++ b/drivers/net/bnxt/bnxt_hwrm.c
-@@ -1210,6 +1210,35 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,
+@@ -1216,6 +1216,35 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,
  	return rc;
  }
  
@@ -60,7 +61,7 @@
  int bnxt_hwrm_queue_qportcfg(struct bnxt *bp)
  {
  	int rc = 0;
-@@ -1269,14 +1298,13 @@ get_rx_info:
+@@ -1275,14 +1304,13 @@ get_rx_info:
  						bp->tx_cos_queue[i].id;
  			}
  		} else {


More information about the stable mailing list