[dpdk-stable] patch 'net/bnxt: check access denied for HWRM commands' has been queued to stable release 18.05.1

Christian Ehrhardt christian.ehrhardt at canonical.com
Tue Aug 14 13:06:18 CEST 2018


Hi,

FYI, your patch has been queued to stable release 18.05.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 08/16/18. So please
shout if anyone has objections.

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 90ac8fc9fa88af097d7cbec0dafb888a39fb7815 Mon Sep 17 00:00:00 2001
From: Ajit Khaparde <ajit.khaparde at broadcom.com>
Date: Wed, 25 Jul 2018 18:15:47 -0700
Subject: [PATCH] net/bnxt: check access denied for HWRM commands

[ upstream commit 6dc875ab5ff76377376906aa6d05d95ffd34b9f9 ]

Firmware can restrict access to certain resources in the hardware
depending on various factors. In such cases when the PMD tries to
configure these resources the firmware will return
HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED error. Parse this and return
the standard EACCES error to the applications.

Fixes: 804e746c7b73 ("net/bnxt: add hardware resource manager init code")

Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index b800b1a51..d734eb94e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -170,6 +170,10 @@ err_ret:
 	if (rc) { \
 		PMD_DRV_LOG(ERR, "failed rc:%d\n", rc); \
 		rte_spinlock_unlock(&bp->hwrm_lock); \
+		if (rc == HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED) \
+			rc = -EACCES; \
+		else if (rc > 0) \
+			rc = -EINVAL; \
 		return rc; \
 	} \
 	if (resp->error_code) { \
@@ -188,6 +192,10 @@ err_ret:
 			PMD_DRV_LOG(ERR, "error %d\n", rc); \
 		} \
 		rte_spinlock_unlock(&bp->hwrm_lock); \
+		if (rc == HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED) \
+			rc = -EACCES; \
+		else if (rc > 0) \
+			rc = -EINVAL; \
 		return rc; \
 	} \
 } while (0)
-- 
2.17.1



More information about the stable mailing list