[dpdk-stable] patch 'net/octeontx2: fix device configuration sequence' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:02:53 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/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 8e8fdd68f75c227e51551ad9d1398b5e18e206c3 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula at marvell.com>
Date: Sat, 4 Apr 2020 20:49:50 +0530
Subject: [PATCH] net/octeontx2: fix device configuration sequence

[ upstream commit b372fff7d490ba6f127de310bf52b3eb838267c8 ]

When an application invokes rte_eth_dev_configure consecutively without
setting up Rx/Tx queues, it will incorrectly return error while trying
to restore Rx/Tx queue configuration.

Fix configuration sequence by checking if any Rx/Tx queues are
previously configured before trying to restore them.

Fixes: 548b5839a32b ("net/octeontx2: add device configure operation")

Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
Acked-by: Jerin Jacob <jerinj at marvell.com>
---
 drivers/net/octeontx2/otx2_ethdev.c | 16 ++++++++++++----
 drivers/net/octeontx2/otx2_ethdev.h |  1 +
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index c86165b5ec..e450a5ae01 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -1115,10 +1115,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev)
 	txq = (struct otx2_eth_txq **)eth_dev->data->tx_queues;
 	for (i = 0; i < nb_txq; i++) {
 		if (txq[i] == NULL) {
-			otx2_err("txq[%d] is already released", i);
-			goto fail;
+			tx_qconf[i].valid = false;
+			otx2_info("txq[%d] is already released", i);
+			continue;
 		}
 		memcpy(&tx_qconf[i], &txq[i]->qconf, sizeof(*tx_qconf));
+		tx_qconf[i].valid = true;
 		otx2_nix_tx_queue_release(txq[i]);
 		eth_dev->data->tx_queues[i] = NULL;
 	}
@@ -1126,10 +1128,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev)
 	rxq = (struct otx2_eth_rxq **)eth_dev->data->rx_queues;
 	for (i = 0; i < nb_rxq; i++) {
 		if (rxq[i] == NULL) {
-			otx2_err("rxq[%d] is already released", i);
-			goto fail;
+			rx_qconf[i].valid = false;
+			otx2_info("rxq[%d] is already released", i);
+			continue;
 		}
 		memcpy(&rx_qconf[i], &rxq[i]->qconf, sizeof(*rx_qconf));
+		rx_qconf[i].valid = true;
 		otx2_nix_rx_queue_release(rxq[i]);
 		eth_dev->data->rx_queues[i] = NULL;
 	}
@@ -1184,6 +1188,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev)
 	 * queues are already setup in port_configure().
 	 */
 	for (i = 0; i < nb_txq; i++) {
+		if (!tx_qconf[i].valid)
+			continue;
 		rc = otx2_nix_tx_queue_setup(eth_dev, i, tx_qconf[i].nb_desc,
 					     tx_qconf[i].socket_id,
 					     &tx_qconf[i].conf.tx);
@@ -1199,6 +1205,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev)
 	free(tx_qconf); tx_qconf = NULL;
 
 	for (i = 0; i < nb_rxq; i++) {
+		if (!rx_qconf[i].valid)
+			continue;
 		rc = otx2_nix_rx_queue_setup(eth_dev, i, rx_qconf[i].nb_desc,
 					     rx_qconf[i].socket_id,
 					     &rx_qconf[i].conf.rx,
diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
index 483535ab12..fdc79633e4 100644
--- a/drivers/net/octeontx2/otx2_ethdev.h
+++ b/drivers/net/octeontx2/otx2_ethdev.h
@@ -192,6 +192,7 @@ struct otx2_eth_qconf {
 	void *mempool;
 	uint32_t socket_id;
 	uint16_t nb_desc;
+	uint8_t valid;
 };
 
 struct otx2_fc_info {
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:46.123128754 +0100
+++ 0038-net-octeontx2-fix-device-configuration-sequence.patch	2020-05-19 14:04:44.176647647 +0100
@@ -1,8 +1,10 @@
-From b372fff7d490ba6f127de310bf52b3eb838267c8 Mon Sep 17 00:00:00 2001
+From 8e8fdd68f75c227e51551ad9d1398b5e18e206c3 Mon Sep 17 00:00:00 2001
 From: Pavan Nikhilesh <pbhagavatula at marvell.com>
 Date: Sat, 4 Apr 2020 20:49:50 +0530
 Subject: [PATCH] net/octeontx2: fix device configuration sequence
 
+[ upstream commit b372fff7d490ba6f127de310bf52b3eb838267c8 ]
+
 When an application invokes rte_eth_dev_configure consecutively without
 setting up Rx/Tx queues, it will incorrectly return error while trying
 to restore Rx/Tx queue configuration.
@@ -11,7 +13,6 @@
 previously configured before trying to restore them.
 
 Fixes: 548b5839a32b ("net/octeontx2: add device configure operation")
-Cc: stable at dpdk.org
 
 Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
 Acked-by: Jerin Jacob <jerinj at marvell.com>
@@ -21,10 +22,10 @@
  2 files changed, 13 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
-index 19d32ba502..e10033ec57 100644
+index c86165b5ec..e450a5ae01 100644
 --- a/drivers/net/octeontx2/otx2_ethdev.c
 +++ b/drivers/net/octeontx2/otx2_ethdev.c
-@@ -1139,10 +1139,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev)
+@@ -1115,10 +1115,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev)
  	txq = (struct otx2_eth_txq **)eth_dev->data->tx_queues;
  	for (i = 0; i < nb_txq; i++) {
  		if (txq[i] == NULL) {
@@ -39,7 +40,7 @@
  		otx2_nix_tx_queue_release(txq[i]);
  		eth_dev->data->tx_queues[i] = NULL;
  	}
-@@ -1150,10 +1152,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev)
+@@ -1126,10 +1128,12 @@ nix_store_queue_cfg_and_then_release(struct rte_eth_dev *eth_dev)
  	rxq = (struct otx2_eth_rxq **)eth_dev->data->rx_queues;
  	for (i = 0; i < nb_rxq; i++) {
  		if (rxq[i] == NULL) {
@@ -54,7 +55,7 @@
  		otx2_nix_rx_queue_release(rxq[i]);
  		eth_dev->data->rx_queues[i] = NULL;
  	}
-@@ -1208,6 +1212,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev)
+@@ -1184,6 +1188,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev)
  	 * queues are already setup in port_configure().
  	 */
  	for (i = 0; i < nb_txq; i++) {
@@ -63,7 +64,7 @@
  		rc = otx2_nix_tx_queue_setup(eth_dev, i, tx_qconf[i].nb_desc,
  					     tx_qconf[i].socket_id,
  					     &tx_qconf[i].conf.tx);
-@@ -1223,6 +1229,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev)
+@@ -1199,6 +1205,8 @@ nix_restore_queue_cfg(struct rte_eth_dev *eth_dev)
  	free(tx_qconf); tx_qconf = NULL;
  
  	for (i = 0; i < nb_rxq; i++) {
@@ -73,10 +74,10 @@
  					     rx_qconf[i].socket_id,
  					     &rx_qconf[i].conf.rx,
 diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h
-index 1bfcda2fca..0fbf68b8e0 100644
+index 483535ab12..fdc79633e4 100644
 --- a/drivers/net/octeontx2/otx2_ethdev.h
 +++ b/drivers/net/octeontx2/otx2_ethdev.h
-@@ -196,6 +196,7 @@ struct otx2_eth_qconf {
+@@ -192,6 +192,7 @@ struct otx2_eth_qconf {
  	void *mempool;
  	uint32_t socket_id;
  	uint16_t nb_desc;


More information about the stable mailing list