patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/bnxt: fix return values to standard error codes' has been queued to LTS release 18.11.3
Date: Wed, 28 Aug 2019 14:42:20 +0100	[thread overview]
Message-ID: <20190828134234.20547-44-ktraynor@redhat.com> (raw)
In-Reply-To: <20190828134234.20547-1-ktraynor@redhat.com>

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/1f49e67da91ba94cc3f3a03f7e17070cc0d3696e

Thanks.

Kevin Traynor

---
From 1f49e67da91ba94cc3f3a03f7e17070cc0d3696e Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Date: Thu, 18 Jul 2019 09:06:06 +0530
Subject: [PATCH] net/bnxt: fix return values to standard error codes

[ upstream commit e67daabd224bbd3d95a03f1192ea78db6314c0f4 ]

Fixed the return values of few routines to return standard error code.
Also fixed few error logs to more meaningful one.

Fixes: 804e746c7b73 ("net/bnxt: add hardware resource manager init code")
Fixes: e3d8f1e6a665 ("net/bnxt: cache address of doorbell to subsequent access")
Fixes: 19e6af01bb36 ("net/bnxt: support get/set EEPROM")
Fixes: b7435d660a8c ("net/bnxt: add ntuple filtering support")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 44 +++++++---------------------------
 drivers/net/bnxt/bnxt_hwrm.c   | 30 ++++++++++-------------
 2 files changed, 20 insertions(+), 54 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 0bfa386aa..611a5302d 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1974,5 +1974,5 @@ bnxt_ethertype_filter(struct rte_eth_dev *dev,
 		filter1 = bnxt_get_l2_filter(bp, bfilter, vnic0);
 		if (filter1 == NULL) {
-			ret = -1;
+			ret = -EINVAL;
 			goto cleanup;
 		}
@@ -2168,5 +2168,5 @@ bnxt_cfg_ntuple_filter(struct bnxt *bp,
 	filter1 = STAILQ_FIRST(&vnic0->filter);
 	if (filter1 == NULL) {
-		ret = -1;
+		ret = -EINVAL;
 		goto free_filter;
 	}
@@ -3108,5 +3108,4 @@ bnxt_set_eeprom_op(struct rte_eth_dev *dev,
 	return bnxt_hwrm_flash_nvram(bp, type, ordinal, ext, attr,
 				     in_eeprom->data, in_eeprom->length);
-	return 0;
 }
 
@@ -3210,14 +3209,13 @@ bool bnxt_stratus_device(struct bnxt *bp)
 static int bnxt_init_board(struct rte_eth_dev *eth_dev)
 {
-	struct bnxt *bp = eth_dev->data->dev_private;
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
-	int rc;
+	struct bnxt *bp = eth_dev->data->dev_private;
 
 	/* enable device (incl. PCI PM wakeup), and bus-mastering */
-	if (!pci_dev->mem_resource[0].addr) {
-		PMD_DRV_LOG(ERR,
-			"Cannot find PCI device base address, aborting\n");
-		rc = -ENODEV;
-		goto init_err_disable;
+	bp->bar0 = (void *)pci_dev->mem_resource[0].addr;
+	bp->doorbell_base = (void *)pci_dev->mem_resource[2].addr;
+	if (!bp->bar0 || !bp->doorbell_base) {
+		PMD_DRV_LOG(ERR, "Unable to access Hardware\n");
+		return -ENODEV;
 	}
 
@@ -3225,31 +3223,5 @@ static int bnxt_init_board(struct rte_eth_dev *eth_dev)
 	bp->pdev = pci_dev;
 
-	bp->bar0 = (void *)pci_dev->mem_resource[0].addr;
-	if (!bp->bar0) {
-		PMD_DRV_LOG(ERR, "Cannot map device registers, aborting\n");
-		rc = -ENOMEM;
-		goto init_err_release;
-	}
-
-	if (!pci_dev->mem_resource[2].addr) {
-		PMD_DRV_LOG(ERR,
-			    "Cannot find PCI device BAR 2 address, aborting\n");
-		rc = -ENODEV;
-		goto init_err_release;
-	} else {
-		bp->doorbell_base = (void *)pci_dev->mem_resource[2].addr;
-	}
-
 	return 0;
-
-init_err_release:
-	if (bp->bar0)
-		bp->bar0 = NULL;
-	if (bp->doorbell_base)
-		bp->doorbell_base = NULL;
-
-init_err_disable:
-
-	return rc;
 }
 
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 0713e86f9..865b42870 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -140,12 +140,9 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
 
 	if (i >= HWRM_CMD_TIMEOUT) {
-		PMD_DRV_LOG(ERR, "Error sending msg 0x%04x\n",
-			req->req_type);
-		goto err_ret;
+		PMD_DRV_LOG(ERR, "Error(timeout) sending msg 0x%04x\n",
+			    req->req_type);
+		return -ETIMEDOUT;
 	}
 	return 0;
-
-err_ret:
-	return -1;
 }
 
@@ -1134,5 +1131,5 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
 			ring_type);
 		HWRM_UNLOCK();
-		return -1;
+		return -EINVAL;
 	}
 	req.enables = rte_cpu_to_le_32(enables);
@@ -2703,5 +2700,5 @@ int bnxt_hwrm_allocate_pf_only(struct bnxt *bp)
 	if (!BNXT_PF(bp)) {
 		PMD_DRV_LOG(ERR, "Attempt to allcoate VFs on a VF!\n");
-		return -1;
+		return -EINVAL;
 	}
 
@@ -2730,5 +2727,5 @@ int bnxt_hwrm_allocate_vfs(struct bnxt *bp, int num_vfs)
 	if (!BNXT_PF(bp)) {
 		PMD_DRV_LOG(ERR, "Attempt to allcoate VFs on a VF!\n");
-		return -1;
+		return -EINVAL;
 	}
 
@@ -3582,8 +3579,7 @@ int bnxt_hwrm_func_vf_vnic_query_and_config(struct bnxt *bp, uint16_t vf,
 	vnic_ids = rte_malloc("bnxt_hwrm_vf_vnic_ids_query", vnic_id_sz,
 			RTE_CACHE_LINE_SIZE);
-	if (vnic_ids == NULL) {
-		rc = -ENOMEM;
-		return rc;
-	}
+	if (vnic_ids == NULL)
+		return -ENOMEM;
+
 	for (sz = 0; sz < vnic_id_sz; sz += getpagesize())
 		rte_mem_lock_page(((char *)vnic_ids) + sz);
@@ -3652,8 +3648,6 @@ int bnxt_hwrm_func_qcfg_vf_dflt_vnic_id(struct bnxt *bp, int vf)
 	vnic_ids = rte_malloc("bnxt_hwrm_vf_vnic_ids_query", vnic_id_sz,
 			RTE_CACHE_LINE_SIZE);
-	if (vnic_ids == NULL) {
-		rc = -ENOMEM;
-		return rc;
-	}
+	if (vnic_ids == NULL)
+		return -ENOMEM;
 
 	for (sz = 0; sz < vnic_id_sz; sz += getpagesize())
@@ -3686,5 +3680,5 @@ int bnxt_hwrm_func_qcfg_vf_dflt_vnic_id(struct bnxt *bp, int vf)
 exit:
 	rte_free(vnic_ids);
-	return -1;
+	return rc;
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-08-28 14:32:34.456056820 +0100
+++ 0045-net-bnxt-fix-return-values-to-standard-error-codes.patch	2019-08-28 14:32:31.707955889 +0100
@@ -1 +1 @@
-From e67daabd224bbd3d95a03f1192ea78db6314c0f4 Mon Sep 17 00:00:00 2001
+From 1f49e67da91ba94cc3f3a03f7e17070cc0d3696e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e67daabd224bbd3d95a03f1192ea78db6314c0f4 ]
+
@@ -13 +14,0 @@
-Cc: stable@dpdk.org
@@ -18,3 +19,3 @@
- drivers/net/bnxt/bnxt_ethdev.c | 46 +++++++---------------------------
- drivers/net/bnxt/bnxt_hwrm.c   | 30 +++++++++-------------
- 2 files changed, 21 insertions(+), 55 deletions(-)
+ drivers/net/bnxt/bnxt_ethdev.c | 44 +++++++---------------------------
+ drivers/net/bnxt/bnxt_hwrm.c   | 30 ++++++++++-------------
+ 2 files changed, 20 insertions(+), 54 deletions(-)
@@ -23 +24 @@
-index 3368508df..69244b8c5 100644
+index 0bfa386aa..611a5302d 100644
@@ -26 +27 @@
-@@ -2153,5 +2153,5 @@ bnxt_ethertype_filter(struct rte_eth_dev *dev,
+@@ -1974,5 +1974,5 @@ bnxt_ethertype_filter(struct rte_eth_dev *dev,
@@ -33 +34 @@
-@@ -2347,5 +2347,5 @@ bnxt_cfg_ntuple_filter(struct bnxt *bp,
+@@ -2168,5 +2168,5 @@ bnxt_cfg_ntuple_filter(struct bnxt *bp,
@@ -40 +41 @@
-@@ -3289,5 +3289,4 @@ bnxt_set_eeprom_op(struct rte_eth_dev *dev,
+@@ -3108,5 +3108,4 @@ bnxt_set_eeprom_op(struct rte_eth_dev *dev,
@@ -46 +47 @@
-@@ -3392,14 +3391,13 @@ bool bnxt_stratus_device(struct bnxt *bp)
+@@ -3210,14 +3209,13 @@ bool bnxt_stratus_device(struct bnxt *bp)
@@ -67 +68 @@
-@@ -3407,31 +3405,5 @@ static int bnxt_init_board(struct rte_eth_dev *eth_dev)
+@@ -3225,31 +3223,5 @@ static int bnxt_init_board(struct rte_eth_dev *eth_dev)
@@ -99,7 +99,0 @@
-@@ -3673,5 +3645,5 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
- 		ctx->flags |= BNXT_CTX_FLAG_INITED;
- 
--	return 0;
-+	return rc;
- }
- 
@@ -107 +101 @@
-index abc6d4220..456cc76b8 100644
+index 0713e86f9..865b42870 100644
@@ -110 +104 @@
-@@ -153,12 +153,9 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
+@@ -140,12 +140,9 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg,
@@ -126 +120 @@
-@@ -1218,5 +1215,5 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
+@@ -1134,5 +1131,5 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
@@ -133 +127 @@
-@@ -2931,5 +2928,5 @@ int bnxt_hwrm_allocate_pf_only(struct bnxt *bp)
+@@ -2703,5 +2700,5 @@ int bnxt_hwrm_allocate_pf_only(struct bnxt *bp)
@@ -140 +134 @@
-@@ -2959,5 +2956,5 @@ int bnxt_hwrm_allocate_vfs(struct bnxt *bp, int num_vfs)
+@@ -2730,5 +2727,5 @@ int bnxt_hwrm_allocate_vfs(struct bnxt *bp, int num_vfs)
@@ -147 +141 @@
-@@ -3801,8 +3798,7 @@ int bnxt_hwrm_func_vf_vnic_query_and_config(struct bnxt *bp, uint16_t vf,
+@@ -3582,8 +3579,7 @@ int bnxt_hwrm_func_vf_vnic_query_and_config(struct bnxt *bp, uint16_t vf,
@@ -159 +153 @@
-@@ -3871,8 +3867,6 @@ int bnxt_hwrm_func_qcfg_vf_dflt_vnic_id(struct bnxt *bp, int vf)
+@@ -3652,8 +3648,6 @@ int bnxt_hwrm_func_qcfg_vf_dflt_vnic_id(struct bnxt *bp, int vf)
@@ -170 +164 @@
-@@ -3905,5 +3899,5 @@ int bnxt_hwrm_func_qcfg_vf_dflt_vnic_id(struct bnxt *bp, int vf)
+@@ -3686,5 +3680,5 @@ int bnxt_hwrm_func_qcfg_vf_dflt_vnic_id(struct bnxt *bp, int vf)

  parent reply	other threads:[~2019-08-28 13:43 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 13:41 [dpdk-stable] patch 'crypto/openssl: fix free of asymmetric crypto keys' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'kni: fix segmented mbuf data overflow' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'crypto/dpaa2_sec: fix handling of session init failure' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'mk: fix custom kernel directory name' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'examples/ip_frag: fix stale content of ethdev info' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/bnx2x: fix reading VF id' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/bnx2x: fix link events polling for SRIOV' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/bnx2x: fix fastpath SB allocation " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/tap: remove redundant declarations' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/af_packet: remove redundant declaration' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/vhost: " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/null: " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/pcap: " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/ring: " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/virtio_user: " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'raw/skeleton: " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'raw/dpaa2_cmdif: " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net: adjust L2 length on soft VLAN insertion' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/pcap: fix possible mbuf double freeing' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/iavf: fix driver crash when enable TSO' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'app/testpmd: fix show port info routine' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/ena: fix admin CQ polling for 32-bit' " Kevin Traynor
2019-08-28 13:41 ` [dpdk-stable] patch 'net/bnxt: fix crash on probe failure' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix Tx hang after port stop/start' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix L4 checksum error indication in Rx' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: save the number of EM flow count' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix enabling/disabling interrupts' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: check invalid VNIC in cleanup path' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix compiler warning' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix RxQ count if ntuple filtering is disabled' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: check invalid VNIC id for firmware' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/avf: fix Rx bytes stats' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/i40e: fix MAC removal check' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/i40e: fix SFP X722 with FW4.16' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'doc: fix ethernet addresses in flow API guide' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix error handling in port start' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix check of address mapping' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix adding MAC address' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix unconditional wait in link update' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix setting primary MAC address' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix device init error path' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: reset filters before registering interrupts' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: retry IRQ callback deregistration' " Kevin Traynor
2019-08-28 13:42 ` Kevin Traynor [this message]
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix lock release on getting NVM info' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix getting statistics' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix checking result of HWRM command' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix Rx interrupt vector' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: fix interrupt rearm logic' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/bnxt: remove unnecessary interrupt disable' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/e1000: fix buffer overrun while i219 processing DMA' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/mlx5: fix typos in comments' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/dpaa: check multi-segment external buffers' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/dpaa2: fix multi-segment Tx' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/ark: fix queue packet replacement' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/i40e: fix ethernet flow rule' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/i40e: fix flow director rule destroy' " Kevin Traynor
2019-08-28 13:42 ` [dpdk-stable] patch 'net/mlx5: remove redundant item from union' " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190828134234.20547-44-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).