[dpdk-stable] patch 'net/bnxt: fix error handling in port start' has been queued to LTS release 18.11.3

Kevin Traynor ktraynor at redhat.com
Wed Aug 28 15:42:12 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.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 09/04/19. 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-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/0a273adbf5694c52c4c2b2babb423e97965052b2

Thanks.

Kevin Traynor

---
>From 0a273adbf5694c52c4c2b2babb423e97965052b2 Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Thu, 18 Jul 2019 09:05:55 +0530
Subject: [PATCH] net/bnxt: fix error handling in port start

[ upstream commit 6de4c538b393d5a1414a18b2dfb83293b9c429a1 ]

1. during port start, if bnxt_init_chip() return error
   bnxt_dev_start_op() invokes bnxt_shutdown_nic() which in turn calls
   bnxt_free_all_hwrm_resources() to free up resources. Hence remove the
   bnxt_free_all_hwrm_resources() from bnxt_init_chip() failure path.
2. fix to check the return value of rte_intr_enable() as this call
   can fail.
3. set bp->dev_stopped to 0 only when port start succeeds.
4. handle failure cases in bnxt_init_chip() routine to do proper
   cleanup and return correct error value.

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 94b3f4e41..e701b7b16 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -355,6 +355,7 @@ static int bnxt_init_chip(struct bnxt *bp)
 			return -ENOTSUP;
 		}
-		if (rte_intr_efd_enable(intr_handle, intr_vector))
-			return -1;
+		rc = rte_intr_efd_enable(intr_handle, intr_vector);
+		if (rc)
+			return rc;
 	}
 
@@ -367,5 +368,6 @@ static int bnxt_init_chip(struct bnxt *bp)
 			PMD_DRV_LOG(ERR, "Failed to allocate %d rx_queues"
 				" intr_vec", bp->eth_dev->data->nb_rx_queues);
-			return -ENOMEM;
+			rc = -ENOMEM;
+			goto err_disable;
 		}
 		PMD_DRV_LOG(DEBUG, "intr_handle->intr_vec = %p "
@@ -382,10 +384,12 @@ static int bnxt_init_chip(struct bnxt *bp)
 
 	/* enable uio/vfio intr/eventfd mapping */
-	rte_intr_enable(intr_handle);
+	rc = rte_intr_enable(intr_handle);
+	if (rc)
+		goto err_free;
 
 	rc = bnxt_get_hwrm_link_config(bp, &new);
 	if (rc) {
 		PMD_DRV_LOG(ERR, "HWRM Get link config failure rc: %x\n", rc);
-		goto err_out;
+		goto err_free;
 	}
 
@@ -395,5 +399,5 @@ static int bnxt_init_chip(struct bnxt *bp)
 			PMD_DRV_LOG(ERR,
 				"HWRM link config failure rc: %x\n", rc);
-			goto err_out;
+			goto err_free;
 		}
 	}
@@ -402,7 +406,9 @@ static int bnxt_init_chip(struct bnxt *bp)
 	return 0;
 
+err_free:
+	rte_free(intr_handle->intr_vec);
+err_disable:
+	rte_intr_efd_disable(intr_handle);
 err_out:
-	bnxt_free_all_hwrm_resources(bp);
-
 	/* Some of the error status returned by FW may not be from errno.h */
 	if (rc > 0)
@@ -630,5 +636,4 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 			bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS);
 	}
-	bp->dev_stopped = 0;
 
 	rc = bnxt_init_chip(bp);
@@ -648,4 +653,5 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 	bnxt_enable_int(bp);
 	bp->flags |= BNXT_FLAG_INIT_DONE;
+	bp->dev_stopped = 0;
 	return 0;
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-08-28 14:32:33.952855971 +0100
+++ 0037-net-bnxt-fix-error-handling-in-port-start.patch	2019-08-28 14:32:31.679956513 +0100
@@ -1 +1 @@
-From 6de4c538b393d5a1414a18b2dfb83293b9c429a1 Mon Sep 17 00:00:00 2001
+From 0a273adbf5694c52c4c2b2babb423e97965052b2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6de4c538b393d5a1414a18b2dfb83293b9c429a1 ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -26 +27 @@
-index 35e50f1db..39229f150 100644
+index 94b3f4e41..e701b7b16 100644
@@ -29 +30 @@
-@@ -395,6 +395,7 @@ static int bnxt_init_chip(struct bnxt *bp)
+@@ -355,6 +355,7 @@ static int bnxt_init_chip(struct bnxt *bp)
@@ -39 +40 @@
-@@ -407,5 +408,6 @@ static int bnxt_init_chip(struct bnxt *bp)
+@@ -367,5 +368,6 @@ static int bnxt_init_chip(struct bnxt *bp)
@@ -47 +48 @@
-@@ -422,10 +424,12 @@ static int bnxt_init_chip(struct bnxt *bp)
+@@ -382,10 +384,12 @@ static int bnxt_init_chip(struct bnxt *bp)
@@ -62 +63 @@
-@@ -435,5 +439,5 @@ static int bnxt_init_chip(struct bnxt *bp)
+@@ -395,5 +399,5 @@ static int bnxt_init_chip(struct bnxt *bp)
@@ -69 +70 @@
-@@ -442,7 +446,9 @@ static int bnxt_init_chip(struct bnxt *bp)
+@@ -402,7 +406,9 @@ static int bnxt_init_chip(struct bnxt *bp)
@@ -81 +82 @@
-@@ -760,5 +766,4 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+@@ -630,5 +636,4 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
@@ -87 +88 @@
-@@ -782,4 +787,5 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
+@@ -648,4 +653,5 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)


More information about the stable mailing list