[dpdk-stable] patch 'net/bnxt: fix crash in port stop while handling events' has been queued to stable release 19.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Feb 27 10:33:45 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/29/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 4af75ac529860ef485fe3fb04f3b789eb7d017ec Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Thu, 20 Feb 2020 09:42:13 +0530
Subject: [PATCH] net/bnxt: fix crash in port stop while handling events

[ upstream commit 0732bcb40f2f54397b70b6c63e0b1c7bdc03b8db ]

Check for bp->hwrm_cmd_resp_addr before using it in HWRM_PREP to avoid
segmentation fault when stop port and meanwhile receive events from FW.

Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index ad9ca7c6f1..7408412c9b 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -184,6 +184,10 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
  */
 #define HWRM_PREP(req, type, kong) do { \
 	rte_spinlock_lock(&bp->hwrm_lock); \
+	if (bp->hwrm_cmd_resp_addr == NULL) { \
+		rte_spinlock_unlock(&bp->hwrm_lock); \
+		return -EACCES; \
+	} \
 	memset(bp->hwrm_cmd_resp_addr, 0, bp->max_resp_len); \
 	req.req_type = rte_cpu_to_le_16(HWRM_##type); \
 	req.cmpl_ring = rte_cpu_to_le_16(-1); \
@@ -3087,9 +3091,9 @@ static void add_random_mac_if_needed(struct bnxt *bp,
 	}
 }
 
-static void reserve_resources_from_vf(struct bnxt *bp,
-				      struct hwrm_func_cfg_input *cfg_req,
-				      int vf)
+static int reserve_resources_from_vf(struct bnxt *bp,
+				     struct hwrm_func_cfg_input *cfg_req,
+				     int vf)
 {
 	struct hwrm_func_qcaps_input req = {0};
 	struct hwrm_func_qcaps_output *resp = bp->hwrm_cmd_resp_addr;
@@ -3123,6 +3127,8 @@ static void reserve_resources_from_vf(struct bnxt *bp,
 	bp->max_ring_grps -= rte_le_to_cpu_16(resp->max_hw_ring_grps);
 
 	HWRM_UNLOCK();
+
+	return 0;
 }
 
 int bnxt_hwrm_func_qcfg_current_vf_vlan(struct bnxt *bp, int vf)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-27 09:31:56.627338123 +0000
+++ 0025-net-bnxt-fix-crash-in-port-stop-while-handling-event.patch	2020-02-27 09:31:55.751945990 +0000
@@ -1,13 +1,14 @@
-From 0732bcb40f2f54397b70b6c63e0b1c7bdc03b8db Mon Sep 17 00:00:00 2001
+From 4af75ac529860ef485fe3fb04f3b789eb7d017ec Mon Sep 17 00:00:00 2001
 From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
 Date: Thu, 20 Feb 2020 09:42:13 +0530
 Subject: [PATCH] net/bnxt: fix crash in port stop while handling events
 
+[ upstream commit 0732bcb40f2f54397b70b6c63e0b1c7bdc03b8db ]
+
 Check for bp->hwrm_cmd_resp_addr before using it in HWRM_PREP to avoid
 segmentation fault when stop port and meanwhile receive events from FW.
 
 Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
-Cc: stable at dpdk.org
 
 Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
 Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
@@ -16,7 +17,7 @@
  1 file changed, 9 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
-index acecf27848..a9c9c7297c 100644
+index ad9ca7c6f1..7408412c9b 100644
 --- a/drivers/net/bnxt/bnxt_hwrm.c
 +++ b/drivers/net/bnxt/bnxt_hwrm.c
 @@ -184,6 +184,10 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
@@ -30,7 +31,7 @@
  	memset(bp->hwrm_cmd_resp_addr, 0, bp->max_resp_len); \
  	req.req_type = rte_cpu_to_le_16(HWRM_##type); \
  	req.cmpl_ring = rte_cpu_to_le_16(-1); \
-@@ -3096,9 +3100,9 @@ static void add_random_mac_if_needed(struct bnxt *bp,
+@@ -3087,9 +3091,9 @@ static void add_random_mac_if_needed(struct bnxt *bp,
  	}
  }
  
@@ -43,7 +44,7 @@
  {
  	struct hwrm_func_qcaps_input req = {0};
  	struct hwrm_func_qcaps_output *resp = bp->hwrm_cmd_resp_addr;
-@@ -3132,6 +3136,8 @@ static void reserve_resources_from_vf(struct bnxt *bp,
+@@ -3123,6 +3127,8 @@ static void reserve_resources_from_vf(struct bnxt *bp,
  	bp->max_ring_grps -= rte_le_to_cpu_16(resp->max_hw_ring_grps);
  
  	HWRM_UNLOCK();


More information about the stable mailing list