DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev] [PATCH 00/15] bnxt patch series
@ 2019-07-12  6:06 Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
                   ` (15 more replies)
  0 siblings, 16 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

Patchset fixing various bugs in bnxt PMD based on recent patch submission.
https://patchwork.dpdk.org/patch/56311/

Ajit Khaparde (3):
  net/bnxt: fix for doorbell register offset for Tx ring.
  net/bnxt: save the number of EM flow count
  net/bnxt: fix a compilation warning

Jay Ding (1):
  net/bnxt: fix to avoid sending invalid VNIC id to firmware

Kalesh AP (5):
  net/bnxt: fix extended port counter statistics
  net/bnxt: fix possible segfault in case of probe failure
  net/bnxt: do not fail VF probe when the MAC address is zero
  net/bnxt: fix to enable disable interrupts correctly in start stop
  net/bnxt: fix to check for invalid VNIC in cleanup path

Lance Richardson (4):
  net/bnxt: fix Tx hang after port stop/start
  net/bnxt: reset Rx allocation state on port restart
  net/bnxt: nq doorbell cleanups
  net/bnxt: avoid null pointer dereference

Qingmin Liu (1):
  net/bnxt: fix rxq count if ntuple filtering is disabled

Rahul Gupta (1):
  net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel
    packets

 drivers/net/bnxt/bnxt.h        |   3 +
 drivers/net/bnxt/bnxt_ethdev.c | 307 +++++++++++++++++++--------------
 drivers/net/bnxt/bnxt_hwrm.c   |  56 +++++-
 drivers/net/bnxt/bnxt_hwrm.h   |   1 +
 drivers/net/bnxt/bnxt_irq.c    |   5 +-
 drivers/net/bnxt/bnxt_ring.c   |  11 +-
 drivers/net/bnxt/bnxt_ring.h   |  23 ++-
 drivers/net/bnxt/bnxt_rxr.c    |  43 +++--
 drivers/net/bnxt/bnxt_rxr.h    | 120 ++++++++++---
 drivers/net/bnxt/bnxt_util.c   |  11 ++
 drivers/net/bnxt/bnxt_util.h   |   1 +
 drivers/net/bnxt/bnxt_vnic.c   |   3 +
 12 files changed, 409 insertions(+), 175 deletions(-)

-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 01/15] net/bnxt: fix extended port counter statistics
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12 15:04   ` Stephen Hemminger
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 02/15] net/bnxt: fix possible segfault in case of probe failure Ajit Khaparde
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

1. refactor stats allocation code to new routine
2. check for extended statistics support depends on "hwrm_spec_code"
   which is set in bnxt_hwrm_ver_get called later. Hence we were never
   querying extended port stats as flags field was not updated. Fixed
   this by moving the stats allocation after the call to
   bnxt_hwrm_ver_get.
3. we were incorrectly passing the host address used for port
   statistics to PORT_QSTATS_EXT command. Fixed this by passing the
   correct extended stats address.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |   1 +
 drivers/net/bnxt/bnxt_ethdev.c | 226 +++++++++++++++++----------------
 drivers/net/bnxt/bnxt_hwrm.c   |   7 +-
 3 files changed, 125 insertions(+), 109 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 942da7ff0..45e7359b2 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -350,6 +350,7 @@ struct bnxt {
 #define BNXT_FLAG_TRUSTED_VF_EN	(1 << 11)
 #define BNXT_FLAG_DFLT_VNIC_SET	(1 << 12)
 #define BNXT_FLAG_THOR_CHIP	(1 << 13)
+#define BNXT_FLAG_EXT_STATS_SUPPORTED	(1 << 29)
 #define BNXT_FLAG_NEW_RM	(1 << 30)
 #define BNXT_FLAG_INIT_DONE	(1U << 31)
 #define BNXT_PF(bp)		(!((bp)->flags & BNXT_FLAG_VF))
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 14b69a480..1ce6e81e5 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3639,6 +3639,120 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
 	return 0;
 }
 
+static int bnxt_alloc_stats_mem(struct bnxt *bp)
+{
+	struct rte_pci_device *pci_dev = bp->pdev;
+	char mz_name[RTE_MEMZONE_NAMESIZE];
+	const struct rte_memzone *mz = NULL;
+	uint32_t total_alloc_len;
+	rte_iova_t mz_phys_addr;
+
+	if (pci_dev->id.device_id == BROADCOM_DEV_ID_NS2)
+		return 0;
+
+	snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
+		 "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
+		 pci_dev->addr.bus, pci_dev->addr.devid,
+		 pci_dev->addr.function, "rx_port_stats");
+	mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
+	mz = rte_memzone_lookup(mz_name);
+	total_alloc_len =
+		RTE_CACHE_LINE_ROUNDUP(sizeof(struct rx_port_stats) +
+				       sizeof(struct rx_port_stats_ext) + 512);
+	if (!mz) {
+		mz = rte_memzone_reserve(mz_name, total_alloc_len,
+					 SOCKET_ID_ANY,
+					 RTE_MEMZONE_2MB |
+					 RTE_MEMZONE_SIZE_HINT_ONLY |
+					 RTE_MEMZONE_IOVA_CONTIG);
+		if (mz == NULL)
+			return -ENOMEM;
+	}
+	memset(mz->addr, 0, mz->len);
+	mz_phys_addr = mz->iova;
+	if ((unsigned long)mz->addr == mz_phys_addr) {
+		PMD_DRV_LOG(WARNING,
+			    "Memzone physical address same as virtual.\n");
+		PMD_DRV_LOG(WARNING,
+			    "Using rte_mem_virt2iova()\n");
+		mz_phys_addr = rte_mem_virt2iova(mz->addr);
+		if (mz_phys_addr == 0) {
+			PMD_DRV_LOG(ERR,
+				    "Can't map address to physical memory\n");
+			return -ENOMEM;
+		}
+	}
+
+	bp->rx_mem_zone = (const void *)mz;
+	bp->hw_rx_port_stats = mz->addr;
+	bp->hw_rx_port_stats_map = mz_phys_addr;
+
+	snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
+		 "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
+		 pci_dev->addr.bus, pci_dev->addr.devid,
+		 pci_dev->addr.function, "tx_port_stats");
+	mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
+	mz = rte_memzone_lookup(mz_name);
+	total_alloc_len =
+		RTE_CACHE_LINE_ROUNDUP(sizeof(struct tx_port_stats) +
+				       sizeof(struct tx_port_stats_ext) + 512);
+	if (!mz) {
+		mz = rte_memzone_reserve(mz_name,
+					 total_alloc_len,
+					 SOCKET_ID_ANY,
+					 RTE_MEMZONE_2MB |
+					 RTE_MEMZONE_SIZE_HINT_ONLY |
+					 RTE_MEMZONE_IOVA_CONTIG);
+		if (mz == NULL)
+			return -ENOMEM;
+	}
+	memset(mz->addr, 0, mz->len);
+	mz_phys_addr = mz->iova;
+	if ((unsigned long)mz->addr == mz_phys_addr) {
+		PMD_DRV_LOG(WARNING,
+			    "Memzone physical address same as virtual\n");
+		PMD_DRV_LOG(WARNING,
+			    "Using rte_mem_virt2iova()\n");
+		mz_phys_addr = rte_mem_virt2iova(mz->addr);
+		if (mz_phys_addr == 0) {
+			PMD_DRV_LOG(ERR,
+				    "Can't map address to physical memory\n");
+			return -ENOMEM;
+		}
+	}
+
+	bp->tx_mem_zone = (const void *)mz;
+	bp->hw_tx_port_stats = mz->addr;
+	bp->hw_tx_port_stats_map = mz_phys_addr;
+	bp->flags |= BNXT_FLAG_PORT_STATS;
+
+	/* Display extended statistics if FW supports it */
+	if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_8_4 ||
+	    bp->hwrm_spec_code == HWRM_SPEC_CODE_1_9_0 ||
+	    !(bp->flags & BNXT_FLAG_EXT_STATS_SUPPORTED))
+		return 0;
+
+	bp->hw_rx_port_stats_ext = (void *)
+		((uint8_t *)bp->hw_rx_port_stats +
+		 sizeof(struct rx_port_stats));
+	bp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map +
+		sizeof(struct rx_port_stats);
+	bp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS;
+
+	if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2 ||
+	    bp->flags & BNXT_FLAG_EXT_STATS_SUPPORTED) {
+		bp->hw_tx_port_stats_ext = (void *)
+			((uint8_t *)bp->hw_tx_port_stats +
+			 sizeof(struct tx_port_stats));
+		bp->hw_tx_port_stats_ext_map =
+			bp->hw_tx_port_stats_map +
+			sizeof(struct tx_port_stats);
+		bp->flags |= BNXT_FLAG_EXT_TX_PORT_STATS;
+	}
+
+	return 0;
+}
+
 #define ALLOW_FUNC(x)	\
 	{ \
 		uint32_t arg = (x); \
@@ -3649,11 +3763,7 @@ static int
 bnxt_dev_init(struct rte_eth_dev *eth_dev)
 {
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
-	char mz_name[RTE_MEMZONE_NAMESIZE];
-	const struct rte_memzone *mz = NULL;
 	static int version_printed;
-	uint32_t total_alloc_len;
-	rte_iova_t mz_phys_addr;
 	struct bnxt *bp;
 	uint16_t mtu;
 	int rc;
@@ -3692,109 +3802,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
-	if (pci_dev->id.device_id != BROADCOM_DEV_ID_NS2) {
-		snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
-			 "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
-			 pci_dev->addr.bus, pci_dev->addr.devid,
-			 pci_dev->addr.function, "rx_port_stats");
-		mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
-		mz = rte_memzone_lookup(mz_name);
-		total_alloc_len = RTE_CACHE_LINE_ROUNDUP(
-					sizeof(struct rx_port_stats) +
-					sizeof(struct rx_port_stats_ext) +
-					512);
-		if (!mz) {
-			mz = rte_memzone_reserve(mz_name, total_alloc_len,
-					SOCKET_ID_ANY,
-					RTE_MEMZONE_2MB |
-					RTE_MEMZONE_SIZE_HINT_ONLY |
-					RTE_MEMZONE_IOVA_CONTIG);
-			if (mz == NULL)
-				return -ENOMEM;
-		}
-		memset(mz->addr, 0, mz->len);
-		mz_phys_addr = mz->iova;
-		if ((unsigned long)mz->addr == mz_phys_addr) {
-			PMD_DRV_LOG(INFO,
-				"Memzone physical address same as virtual using rte_mem_virt2iova()\n");
-			mz_phys_addr = rte_mem_virt2iova(mz->addr);
-			if (mz_phys_addr == 0) {
-				PMD_DRV_LOG(ERR,
-				"unable to map address to physical memory\n");
-				return -ENOMEM;
-			}
-		}
-
-		bp->rx_mem_zone = (const void *)mz;
-		bp->hw_rx_port_stats = mz->addr;
-		bp->hw_rx_port_stats_map = mz_phys_addr;
-
-		snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
-			 "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
-			 pci_dev->addr.bus, pci_dev->addr.devid,
-			 pci_dev->addr.function, "tx_port_stats");
-		mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
-		mz = rte_memzone_lookup(mz_name);
-		total_alloc_len = RTE_CACHE_LINE_ROUNDUP(
-					sizeof(struct tx_port_stats) +
-					sizeof(struct tx_port_stats_ext) +
-					512);
-		if (!mz) {
-			mz = rte_memzone_reserve(mz_name,
-					total_alloc_len,
-					SOCKET_ID_ANY,
-					RTE_MEMZONE_2MB |
-					RTE_MEMZONE_SIZE_HINT_ONLY |
-					RTE_MEMZONE_IOVA_CONTIG);
-			if (mz == NULL)
-				return -ENOMEM;
-		}
-		memset(mz->addr, 0, mz->len);
-		mz_phys_addr = mz->iova;
-		if ((unsigned long)mz->addr == mz_phys_addr) {
-			PMD_DRV_LOG(WARNING,
-				"Memzone physical address same as virtual.\n");
-			PMD_DRV_LOG(WARNING,
-				"Using rte_mem_virt2iova()\n");
-			mz_phys_addr = rte_mem_virt2iova(mz->addr);
-			if (mz_phys_addr == 0) {
-				PMD_DRV_LOG(ERR,
-				"unable to map address to physical memory\n");
-				return -ENOMEM;
-			}
-		}
-
-		bp->tx_mem_zone = (const void *)mz;
-		bp->hw_tx_port_stats = mz->addr;
-		bp->hw_tx_port_stats_map = mz_phys_addr;
-
-		bp->flags |= BNXT_FLAG_PORT_STATS;
-
-		/* Display extended statistics if FW supports it */
-		if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_8_4 ||
-		    bp->hwrm_spec_code == HWRM_SPEC_CODE_1_9_0)
-			goto skip_ext_stats;
-
-		bp->hw_rx_port_stats_ext = (void *)
-			((uint8_t *)bp->hw_rx_port_stats +
-			 sizeof(struct rx_port_stats));
-		bp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map +
-			sizeof(struct rx_port_stats);
-		bp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS;
-
-
-		if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2) {
-			bp->hw_tx_port_stats_ext = (void *)
-				((uint8_t *)bp->hw_tx_port_stats +
-				 sizeof(struct tx_port_stats));
-			bp->hw_tx_port_stats_ext_map =
-				bp->hw_tx_port_stats_map +
-				sizeof(struct tx_port_stats);
-			bp->flags |= BNXT_FLAG_EXT_TX_PORT_STATS;
-		}
-	}
-
-skip_ext_stats:
 	rc = bnxt_alloc_hwrm_resources(bp);
 	if (rc) {
 		PMD_DRV_LOG(ERR,
@@ -3823,6 +3830,11 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		PMD_DRV_LOG(ERR, "hwrm query capability failure rc: %x\n", rc);
 		goto error_free;
 	}
+
+	rc = bnxt_alloc_stats_mem(bp);
+	if (rc)
+		goto error_free;
+
 	if (bp->max_tx_rings == 0) {
 		PMD_DRV_LOG(ERR, "No TX rings available!\n");
 		rc = -EBUSY;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 8f0d33dca..f691922bd 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -611,6 +611,9 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 		}
 	}
 
+	if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED)
+		bp->flags |= BNXT_FLAG_EXT_STATS_SUPPORTED;
+
 	HWRM_UNLOCK();
 
 	return rc;
@@ -4495,13 +4498,13 @@ int bnxt_hwrm_ext_port_qstats(struct bnxt *bp)
 	req.port_id = rte_cpu_to_le_16(pf->port_id);
 	if (bp->flags & BNXT_FLAG_EXT_TX_PORT_STATS) {
 		req.tx_stat_host_addr =
-			rte_cpu_to_le_64(bp->hw_tx_port_stats_map);
+			rte_cpu_to_le_64(bp->hw_tx_port_stats_ext_map);
 		req.tx_stat_size =
 			rte_cpu_to_le_16(sizeof(struct tx_port_stats_ext));
 	}
 	if (bp->flags & BNXT_FLAG_EXT_RX_PORT_STATS) {
 		req.rx_stat_host_addr =
-			rte_cpu_to_le_64(bp->hw_rx_port_stats_map);
+			rte_cpu_to_le_64(bp->hw_rx_port_stats_ext_map);
 		req.rx_stat_size =
 			rte_cpu_to_le_16(sizeof(struct rx_port_stats_ext));
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 02/15] net/bnxt: fix possible segfault in case of probe failure
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 03/15] net/bnxt: do not fail VF probe when the MAC address is zero Ajit Khaparde
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Fixed couple of possible segfaults due to NULL pointer
dereference in case of probe failure.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_irq.c  | 3 +++
 drivers/net/bnxt/bnxt_vnic.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 0bb3eb4fa..61f7498a5 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -52,6 +52,9 @@ void bnxt_free_int(struct bnxt *bp)
 {
 	struct bnxt_irq *irq;
 
+	if (bp->irq_tbl == NULL)
+		return;
+
 	irq = bp->irq_tbl;
 	if (irq) {
 		if (irq->requested) {
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 262cfc18d..20e5bf2d1 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -89,6 +89,9 @@ void bnxt_free_vnic_attributes(struct bnxt *bp)
 	struct bnxt_vnic_info *vnic;
 	unsigned int i;
 
+	if (bp->vnic_info == NULL)
+		return;
+
 	for (i = 0; i < bp->max_vnics; i++) {
 		vnic = &bp->vnic_info[i];
 		if (vnic->rss_table) {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 03/15] net/bnxt: do not fail VF probe when the MAC address is zero
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 02/15] net/bnxt: fix possible segfault in case of probe failure Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 04/15] net/bnxt: fix Tx hang after port stop/start Ajit Khaparde
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

VF driver should not fail probe if the host PF driver has not assigned
any MAC address for the VF. It should generate a random MAC address and
configure the MAC and then continue probing the device.

Fixes: be160484a48d ("net/bnxt: check if MAC address is all zeros")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 62 +++++++++++++++++++++++-----------
 drivers/net/bnxt/bnxt_hwrm.c   | 25 ++++++++++++++
 drivers/net/bnxt/bnxt_hwrm.h   |  1 +
 drivers/net/bnxt/bnxt_util.c   | 11 ++++++
 drivers/net/bnxt/bnxt_util.h   |  1 +
 5 files changed, 80 insertions(+), 20 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 1ce6e81e5..523a8f1c5 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3753,6 +3753,46 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
 	return 0;
 }
 
+static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev)
+{
+	struct bnxt *bp = eth_dev->data->dev_private;
+	int rc = 0;
+
+	eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
+					       RTE_ETHER_ADDR_LEN *
+					       bp->max_l2_ctx,
+					       0);
+	if (eth_dev->data->mac_addrs == NULL) {
+		PMD_DRV_LOG(ERR, "Failed to alloc MAC addr tbl\n");
+		return -ENOMEM;
+	}
+
+	if (bnxt_check_zero_bytes(bp->dflt_mac_addr, RTE_ETHER_ADDR_LEN)) {
+		if (BNXT_PF(bp))
+			return -EINVAL;
+
+		/* Generate a random MAC address, if none was assigned by PF */
+		PMD_DRV_LOG(INFO, "VF MAC address not assigned by Host PF\n");
+		bnxt_eth_hw_addr_random(bp->mac_addr);
+		PMD_DRV_LOG(INFO,
+			    "Assign random MAC:%02X:%02X:%02X:%02X:%02X:%02X\n",
+			    bp->mac_addr[0], bp->mac_addr[1], bp->mac_addr[2],
+			    bp->mac_addr[3], bp->mac_addr[4], bp->mac_addr[5]);
+
+		rc = bnxt_hwrm_set_mac(bp);
+		if (!rc)
+			memcpy(&bp->eth_dev->data->mac_addrs[0], bp->mac_addr,
+			       RTE_ETHER_ADDR_LEN);
+		return rc;
+	}
+
+	/* Copy the permanent MAC from the FUNC_QCAPS response */
+	memcpy(bp->mac_addr, bp->dflt_mac_addr, RTE_ETHER_ADDR_LEN);
+	memcpy(&eth_dev->data->mac_addrs[0], bp->mac_addr, RTE_ETHER_ADDR_LEN);
+
+	return rc;
+}
+
 #define ALLOW_FUNC(x)	\
 	{ \
 		uint32_t arg = (x); \
@@ -3840,28 +3880,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		rc = -EBUSY;
 		goto error_free;
 	}
-	eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
-					RTE_ETHER_ADDR_LEN * bp->max_l2_ctx, 0);
-	if (eth_dev->data->mac_addrs == NULL) {
-		PMD_DRV_LOG(ERR,
-			"Failed to alloc %u bytes needed to store MAC addr tbl",
-			RTE_ETHER_ADDR_LEN * bp->max_l2_ctx);
-		rc = -ENOMEM;
-		goto error_free;
-	}
 
-	if (bnxt_check_zero_bytes(bp->dflt_mac_addr, RTE_ETHER_ADDR_LEN)) {
-		PMD_DRV_LOG(ERR,
-			    "Invalid MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n",
-			    bp->dflt_mac_addr[0], bp->dflt_mac_addr[1],
-			    bp->dflt_mac_addr[2], bp->dflt_mac_addr[3],
-			    bp->dflt_mac_addr[4], bp->dflt_mac_addr[5]);
-		rc = -EINVAL;
+	rc = bnxt_setup_mac_addr(eth_dev);
+	if (rc)
 		goto error_free;
-	}
-	/* Copy the permanent MAC from the qcap response address now. */
-	memcpy(bp->mac_addr, bp->dflt_mac_addr, sizeof(bp->mac_addr));
-	memcpy(&eth_dev->data->mac_addrs[0], bp->mac_addr, RTE_ETHER_ADDR_LEN);
 
 	/* THOR does not support ring groups.
 	 * But we will use the array to save RSS context IDs.
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f691922bd..a9356c6b8 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -4607,3 +4607,28 @@ int bnxt_hwrm_tunnel_redirect_info(struct bnxt *bp, uint8_t tun_type,
 
 	return rc;
 }
+
+int bnxt_hwrm_set_mac(struct bnxt *bp)
+{
+	struct hwrm_func_vf_cfg_output *resp = bp->hwrm_cmd_resp_addr;
+	struct hwrm_func_vf_cfg_input req = {0};
+	int rc = 0;
+
+	if (!BNXT_VF(bp))
+		return 0;
+
+	HWRM_PREP(req, FUNC_VF_CFG, BNXT_USE_CHIMP_MB);
+
+	req.enables =
+		rte_cpu_to_le_32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR);
+	memcpy(req.dflt_mac_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN);
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+
+	HWRM_CHECK_RESULT();
+
+	memcpy(bp->dflt_mac_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN);
+	HWRM_UNLOCK();
+
+	return rc;
+}
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index e35462cb4..37aaa1a9e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -196,4 +196,5 @@ int bnxt_hwrm_tunnel_redirect_free(struct bnxt *bp, uint8_t type);
 int bnxt_hwrm_tunnel_redirect_query(struct bnxt *bp, uint32_t *type);
 int bnxt_hwrm_tunnel_redirect_info(struct bnxt *bp, uint8_t tun_type,
 				   uint16_t *dst_fid);
+int bnxt_hwrm_set_mac(struct bnxt *bp);
 #endif
diff --git a/drivers/net/bnxt/bnxt_util.c b/drivers/net/bnxt/bnxt_util.c
index 7d3342719..dda40af28 100644
--- a/drivers/net/bnxt/bnxt_util.c
+++ b/drivers/net/bnxt/bnxt_util.c
@@ -4,6 +4,7 @@
  */
 
 #include <inttypes.h>
+#include <rte_ether.h>
 
 #include "bnxt_util.h"
 
@@ -16,3 +17,13 @@ int bnxt_check_zero_bytes(const uint8_t *bytes, int len)
 			return 0;
 	return 1;
 }
+
+void bnxt_eth_hw_addr_random(uint8_t *mac_addr)
+{
+	rte_eth_random_addr(mac_addr);
+
+	/* Set Organizationally Unique Identifier (OUI) prefix */
+	mac_addr[0] = 0x00;
+	mac_addr[1] = 0x0a;
+	mac_addr[2] = 0xf7;
+}
diff --git a/drivers/net/bnxt/bnxt_util.h b/drivers/net/bnxt/bnxt_util.h
index 2378833cc..9f1868a78 100644
--- a/drivers/net/bnxt/bnxt_util.h
+++ b/drivers/net/bnxt/bnxt_util.h
@@ -7,5 +7,6 @@
 #define _BNXT_UTIL_H_
 
 int bnxt_check_zero_bytes(const uint8_t *bytes, int len);
+void bnxt_eth_hw_addr_random(uint8_t *mac_addr);
 
 #endif /* _BNXT_UTIL_H_ */
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 04/15] net/bnxt: fix Tx hang after port stop/start
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (2 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 03/15] net/bnxt: do not fail VF probe when the MAC address is zero Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson, Kalesh Anakkur Purayil

From: Lance Richardson <lance.richardson@broadcom.com>

Initialize the state of the the completion valid indicator
when a completion ring is freed, otherwise completions may
not be processed when a new ring is allocated.

Fixes: 5735eb241947 ("net/bnxt: support Tx batching")
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a9356c6b8..b6f9ec0a0 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2089,6 +2089,7 @@ static void bnxt_free_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr)
 	memset(cpr->cp_desc_ring, 0, cpr->cp_ring_struct->ring_size *
 			sizeof(*cpr->cp_desc_ring));
 	cpr->cp_raw_cons = 0;
+	cpr->valid = 0;
 }
 
 void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 05/15] net/bnxt: reset Rx allocation state on port restart
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (3 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 04/15] net/bnxt: fix Tx hang after port stop/start Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12 12:06   ` Lance Richardson
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 06/15] net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets Ajit Khaparde
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson, Christopher Reder

From: Lance Richardson <lance.richardson@broadcom.com>

Move call site of bnxt_rxq_vec_setup() to ensure that rxq->rxrearm_nb
and rxq->rxrearm_start are reinitialized correctly when a port is
restarted.

Fixes: af3ed597e305 ("net/bnxt: initial vector-mode driver")
Reviewed-by: Christopher Reder <christopher.reder@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 16327dbe9..13478fa02 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -613,6 +613,9 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
 		bnxt_db_write(&rxr->rx_db, rxr->rx_prod);
 		bnxt_db_write(&rxr->ag_db, rxr->ag_prod);
 		rxq->index = i;
+#ifdef RTE_LIBRTE_BNXT_INC_VECTOR
+		bnxt_rxq_vec_setup(rxq);
+#endif
 	}
 
 	for (i = 0; i < bp->tx_cp_nr_rings; i++) {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 06/15] net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (4 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 07/15] net/bnxt: fix for doorbell register offset for Tx ring Ajit Khaparde
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Rahul Gupta

From: Rahul Gupta <rahul.gupta@broadcom.com>

Update ol_flags correctly for checksum errors in case of tunnel and
non-tunnel packet.

Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags)

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c |  43 ++++++++++---
 drivers/net/bnxt/bnxt_rxr.h | 120 ++++++++++++++++++++++++++++++------
 2 files changed, 133 insertions(+), 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 44303f3b0..54a2cf5fd 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -362,6 +362,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 	int rc = 0;
 	uint8_t agg_buf = 0;
 	uint16_t cmp_type;
+	uint32_t flags2_f = 0;
 
 	rxcmp = (struct rx_pkt_cmpl *)
 	    &cpr->cp_desc_ring[cp_cons];
@@ -440,19 +441,41 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 		mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
 	}
 
-	if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
-	else if (likely(RX_CMP_IP_CS_UNKNOWN(rxcmp1)))
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
-	else
+	flags2_f = flags2_0xf(rxcmp1);
+	/* IP Checksum */
+	if (unlikely(((IS_IP_NONTUNNEL_PKT(flags2_f)) &&
+		      (RX_CMP_IP_CS_ERROR(rxcmp1))) ||
+		     (IS_IP_TUNNEL_PKT(flags2_f) &&
+		      (RX_CMP_IP_OUTER_CS_ERROR(rxcmp1))))) {
 		mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
+	} else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) {
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
+	} else {
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
+	}
 
-	if (likely(RX_CMP_L4_CS_OK(rxcmp1)))
-		mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
-	else if (likely(RX_CMP_L4_CS_UNKNOWN(rxcmp1)))
+	/* L4 Checksum */
+	if (likely(IS_L4_NONTUNNEL_PKT(flags2_f))) {
+		if (unlikely(RX_CMP_L4_INNER_CS_ERR2(rxcmp1)))
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
+		else
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+	} else if (IS_L4_TUNNEL_PKT(flags2_f)) {
+		if (unlikely(RX_CMP_L4_INNER_CS_ERR2(rxcmp1)))
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
+		else
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+		if (unlikely(RX_CMP_L4_OUTER_CS_ERR2(rxcmp1))) {
+			mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_BAD;
+		} else if (unlikely(IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS
+				    (flags2_f))) {
+			mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_UNKNOWN;
+		} else {
+			mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_GOOD;
+		}
+	} else if (unlikely(RX_CMP_L4_CS_UNKNOWN(rxcmp1))) {
 		mbuf->ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
-	else
-		mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
+	}
 
 	mbuf->packet_type = bnxt_parse_pkt_type(rxcmp, rxcmp1);
 
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 6523b94c6..6a80c37c8 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -24,36 +24,116 @@
 #define BNXT_TPA_OUTER_L3_OFF(hdr_info)	\
 	((hdr_info) & 0x1ff)
 
-#define RX_CMP_L4_CS_BITS	\
-	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_L4_CS_CALC | \
-			 RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)
-
-#define RX_CMP_L4_CS_ERR_BITS	\
-	rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR | \
-			 RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR)
+#define flags2_0xf(rxcmp1)	\
+	(((rxcmp1)->flags2) & 0xf)
 
-#define RX_CMP_L4_CS_OK(rxcmp1)						\
-	    (((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS) &&		\
-	     !((rxcmp1)->errors_v2 & RX_CMP_L4_CS_ERR_BITS))
+/* IP non tunnel can be with or without L4-
+ * Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP Or
+ * Ether / (vlan) / outer IP|IP6 / ICMP
+ * we use '==' instead of '&' because tunnel pkts have all 4 fields set.
+ */
+#define IS_IP_NONTUNNEL_PKT(flags2_f)	\
+	(	\
+	 ((flags2_f) == \
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC))) ||	\
+	 ((flags2_f) ==	\
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC | \
+			    RX_PKT_CMPL_FLAGS2_L4_CS_CALC))) \
+	)
+
+/* IP Tunnel pkt must have atleast tunnel-IP-calc set.
+ * again tunnel ie outer L4 is optional bcoz of
+ * Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
+ *           UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ *           UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ *           UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
+ * also inner L3 chksum error is not taken into consideration by DPDK.
+ */
+#define IS_IP_TUNNEL_PKT(flags2_f)	\
+	((flags2_f) & rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC))
 
-#define RX_CMP_L4_CS_UNKNOWN(rxcmp1)					\
-	    !((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS)
+/* RX_PKT_CMPL_ERRORS_IP_CS_ERROR only for Non-tunnel pkts.
+ * For tunnel pkts RX_PKT_CMPL_ERRORS_IP_CS_ERROR is not accounted and treated
+ * as good csum pkt.
+ */
+#define RX_CMP_IP_CS_ERROR(rxcmp1)	\
+	((rxcmp1)->errors_v2 &	\
+	 rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR))
 
-#define RX_CMP_IP_CS_ERR_BITS	\
-	rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR | \
-			 RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR)
+#define RX_CMP_IP_OUTER_CS_ERROR(rxcmp1)	\
+	((rxcmp1)->errors_v2 &	\
+	 rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR))
 
 #define RX_CMP_IP_CS_BITS	\
 	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC | \
 			 RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC)
 
-#define RX_CMP_IP_CS_OK(rxcmp1)						\
-		(((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS) &&	\
-		!((rxcmp1)->errors_v2 & RX_CMP_IP_CS_ERR_BITS))
-
-#define RX_CMP_IP_CS_UNKNOWN(rxcmp1)					\
+#define RX_CMP_IP_CS_UNKNOWN(rxcmp1)	\
 		!((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS)
 
+/* L4 non tunnel pkt-
+ * Ether / (vlan) / IP6 / UDP|TCP|SCTP
+ */
+#define IS_L4_NONTUNNEL_PKT(flags2_f)	\
+	( \
+	  ((flags2_f) == \
+	   (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC |	\
+			     RX_PKT_CMPL_FLAGS2_L4_CS_CALC))))
+
+/* L4 tunnel pkt-
+ * Outer L4 is not mandatory. Eg: GRE-
+ * Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
+ *           UDP|TCP|SCTP
+ */
+#define	IS_L4_TUNNEL_PKT_INNER_OUTER_L4_CS(flags2_f)	\
+	 ((flags2_f) == \
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_L4_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)))
+
+#define IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS(flags2_f)	\
+	 ((flags2_f) == \
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_L4_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC)))
+
+#define IS_L4_TUNNEL_PKT(flags2_f)	\
+	(	\
+		IS_L4_TUNNEL_PKT_INNER_OUTER_L4_CS(flags2_f) || \
+		IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS(flags2_f)	\
+	)
+
+#define RX_CMP_L4_CS_BITS	\
+	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_L4_CS_CALC)
+
+#define RX_CMP_L4_CS_UNKNOWN(rxcmp1)					\
+	    !((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS)
+
+#define RX_CMP_T_L4_CS_BITS	\
+	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)
+
+#define RX_CMP_T_L4_CS_UNKNOWN(rxcmp1)					\
+	    !((rxcmp1)->flags2 & RX_CMP_T_L4_CS_BITS)
+
+/* Outer L4 chksum error
+ */
+#define RX_CMP_L4_OUTER_CS_ERR2(rxcmp1)	\
+	 ((rxcmp1)->errors_v2 & \
+	  rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR))
+
+/* Inner L4 chksum error
+ */
+#define RX_CMP_L4_INNER_CS_ERR2(rxcmp1)	\
+	 ((rxcmp1)->errors_v2 & \
+	  rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR))
+
 #define BNXT_RX_POST_THRESH	32
 
 enum pkt_hash_types {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 07/15] net/bnxt: fix for doorbell register offset for Tx ring.
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (5 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 06/15] net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 08/15] net/bnxt: save the number of EM flow count Ajit Khaparde
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Rahul Gupta

For Tx-ring # 104 and higher, the doorbell register was incorrectly
configured due to which FW was not able to receive the notification
of packet to transmit. With this fix, user can run traffic upto 256 rings.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 13478fa02..f4f57862d 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -639,12 +639,12 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
 		ring_type = HWRM_RING_ALLOC_INPUT_RING_TYPE_TX;
 		rc = bnxt_hwrm_ring_alloc(bp, ring,
 					  ring_type,
-					  idx, cpr->hw_stats_ctx_id,
+					  i, cpr->hw_stats_ctx_id,
 					  cp_ring->fw_ring_id);
 		if (rc)
 			goto err_out;
 
-		bnxt_set_db(bp, &txr->tx_db, ring_type, idx, ring->fw_ring_id);
+		bnxt_set_db(bp, &txr->tx_db, ring_type, i, ring->fw_ring_id);
 		txq->index = idx;
 		bnxt_hwrm_set_ring_coal(bp, &coal, cp_ring->fw_ring_id);
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 08/15] net/bnxt: save the number of EM flow count
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (6 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 07/15] net/bnxt: fix for doorbell register offset for Tx ring Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 09/15] net/bnxt: nq doorbell cleanups Ajit Khaparde
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh Anakkur Purayil

Save the number of EM flow count returned by the FW in HWRM_FUNC_QCFG
and use it to calculate the overall pool of L2 contexts supported by FW.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt.h      |  1 +
 drivers/net/bnxt/bnxt_hwrm.c | 11 +++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 45e7359b2..cd809b385 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -429,6 +429,7 @@ struct bnxt {
 	uint16_t		max_rx_rings;
 	uint16_t		max_nq_rings;
 	uint16_t		max_l2_ctx;
+	uint16_t		max_rx_em_flows;
 	uint16_t		max_vnics;
 	uint16_t		max_stat_ctx;
 	uint16_t		first_vf_id;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index b6f9ec0a0..84cda5e6c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -589,8 +589,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 	bp->max_cp_rings = rte_le_to_cpu_16(resp->max_cmpl_rings);
 	bp->max_tx_rings = rte_le_to_cpu_16(resp->max_tx_rings);
 	bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings);
-	bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs);
 	bp->first_vf_id = rte_le_to_cpu_16(resp->first_vf_id);
+	bp->max_rx_em_flows = rte_le_to_cpu_16(resp->max_rx_em_flows);
+	bp->max_l2_ctx =
+		rte_le_to_cpu_16(resp->max_l2_ctxs) + bp->max_rx_em_flows;
 	/* TODO: For now, do not support VMDq/RFS on VFs. */
 	if (BNXT_PF(bp)) {
 		if (bp->pf.max_vfs)
@@ -796,7 +798,12 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp)
 		bp->max_tx_rings = rte_le_to_cpu_16(resp->max_tx_rings);
 		bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings);
 		bp->max_ring_grps = rte_le_to_cpu_32(resp->max_hw_ring_grps);
-		bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs);
+		/* func_resource_qcaps does not return max_rx_em_flows.
+		 * So use the value provided by func_qcaps.
+		 */
+		bp->max_l2_ctx =
+			rte_le_to_cpu_16(resp->max_l2_ctxs) +
+			bp->max_rx_em_flows;
 		bp->max_vnics = rte_le_to_cpu_16(resp->max_vnics);
 		bp->max_stat_ctx = rte_le_to_cpu_16(resp->max_stat_ctx);
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 09/15] net/bnxt: nq doorbell cleanups
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (7 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 08/15] net/bnxt: save the number of EM flow count Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 10/15] net/bnxt: avoid null pointer dereference Ajit Khaparde
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson

From: Lance Richardson <lance.richardson@broadcom.com>

Simplify nq doorbell handling code by removing redundant db
parameter and consolidating NQ doorbell macro into the inline
function that uses it.

Add "enable interrupt" variant of nq write. This will be used
in a subsequent commit.

When initializing nq doorbell, don't assume that only the
"disable interrupt" form will be used.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h      |  1 +
 drivers/net/bnxt/bnxt_ring.c |  2 +-
 drivers/net/bnxt/bnxt_ring.h | 23 ++++++++++++++++++-----
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index cd809b385..3ccf784e5 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -246,6 +246,7 @@ struct bnxt_coal {
 #define DBR_TYPE_SRQ				(0x2ULL << 60)
 #define DBR_TYPE_CQ				(0x4ULL << 60)
 #define DBR_TYPE_NQ				(0xaULL << 60)
+#define DBR_TYPE_NQ_ARM				(0xbULL << 60)
 
 #define BNXT_RSS_TBL_SIZE_THOR		512
 #define BNXT_RSS_ENTRIES_PER_CTX_THOR	64
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index f4f57862d..9e6074ae3 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -341,7 +341,7 @@ static void bnxt_set_db(struct bnxt *bp,
 			db->db_key64 = DBR_PATH_L2 | DBR_TYPE_CQ;
 			break;
 		case HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ:
-			db->db_key64 = DBR_PATH_L2 | DBR_TYPE_NQ;
+			db->db_key64 = DBR_PATH_L2;
 			break;
 		}
 		db->db_key64 |= (uint64_t)fid << DBR_XID_SFT;
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index af2c5762f..e5cef3a1d 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -84,15 +84,28 @@ static inline void bnxt_db_write(struct bnxt_db_info *db, uint32_t idx)
 		rte_write32(db->db_key32 | idx, db->doorbell);
 }
 
+/* Ring an NQ doorbell and disable interrupts for the ring. */
 static inline void bnxt_db_nq(struct bnxt_cp_ring_info *cpr)
 {
-	struct bnxt_db_info *db = &cpr->cp_db;
+	if (unlikely(!cpr->cp_db.db_64))
+		return;
+
+	rte_smp_wmb();
+	rte_write64(cpr->cp_db.db_key64 | DBR_TYPE_NQ |
+		    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
+		    cpr->cp_db.doorbell);
+}
+
+/* Ring an NQ doorbell and enable interrupts for the ring. */
+static inline void bnxt_db_nq_arm(struct bnxt_cp_ring_info *cpr)
+{
+	if (unlikely(!cpr->cp_db.db_64))
+		return;
 
 	rte_smp_wmb();
-	if (likely(db->db_64))
-		rte_write64(db->db_key64 | DBR_TYPE_NQ |
-			    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
-			    db->doorbell);
+	rte_write64(cpr->cp_db.db_key64 | DBR_TYPE_NQ_ARM |
+		    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
+		    cpr->cp_db.doorbell);
 }
 
 static inline void bnxt_db_cq(struct bnxt_cp_ring_info *cpr)
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 10/15] net/bnxt: avoid null pointer dereference
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (8 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 09/15] net/bnxt: nq doorbell cleanups Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 11/15] net/bnxt: fix to enable disable interrupts correctly in start stop Ajit Khaparde
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson

From: Lance Richardson <lance.richardson@broadcom.com>

Avoid null pointer dereference when allocating an insolated
completion ring by basing nq ring allocation on whether an
nq ring was requested instead of whether the device supports
nq rings.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 9e6074ae3..98853ea7a 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -280,7 +280,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
 	}
 	cp_ring_info->hw_stats_ctx_id = HWRM_NA_SIGNATURE;
 
-	if (BNXT_HAS_NQ(bp)) {
+	if (nq_ring_info) {
 		struct bnxt_ring *nq_ring = nq_ring_info->cp_ring_struct;
 
 		nq_ring->bd = (char *)mz->addr + nq_ring_start;
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 11/15] net/bnxt: fix to enable disable interrupts correctly in start stop
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (9 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 10/15] net/bnxt: avoid null pointer dereference Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path Ajit Khaparde
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, Somnath Kotur

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

1. disable interrupts in dev_stop_op()
2. enable interrupts in dev_start_op()
3. Clean queue intr-vector mapping in dev_stop_op() and thus
   fix a possible memory leak.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 17 ++++++++++++++++-
 drivers/net/bnxt/bnxt_irq.c    |  2 --
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 523a8f1c5..ff0edeef4 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -779,6 +779,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 
 	eth_dev->rx_pkt_burst = bnxt_receive_function(eth_dev);
 	eth_dev->tx_pkt_burst = bnxt_transmit_function(eth_dev);
+	bnxt_enable_int(bp);
 	bp->flags |= BNXT_FLAG_INIT_DONE;
 	return 0;
 
@@ -818,6 +819,13 @@ static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
 static void bnxt_dev_stop_op(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);
+	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
+
+	bnxt_disable_int(bp);
+
+	/* disable uio/vfio intr/eventfd mapping */
+	rte_intr_disable(intr_handle);
 
 	bp->flags &= ~BNXT_FLAG_INIT_DONE;
 	if (bp->eth_dev->data->dev_started) {
@@ -825,6 +833,14 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 		eth_dev->data->dev_link.link_status = 0;
 	}
 	bnxt_set_hwrm_link_config(bp, false);
+
+	/* Clean queue intr-vector mapping */
+	rte_intr_efd_disable(intr_handle);
+	if (intr_handle->intr_vec != NULL) {
+		rte_free(intr_handle->intr_vec);
+		intr_handle->intr_vec = NULL;
+	}
+
 	bnxt_hwrm_port_clr_stats(bp);
 	bnxt_free_tx_mbufs(bp);
 	bnxt_free_rx_mbufs(bp);
@@ -3991,7 +4007,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 	if (rc)
 		goto error_free_int;
 
-	bnxt_enable_int(bp);
 	bnxt_init_nic(bp);
 
 	return 0;
diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 61f7498a5..6c4dce401 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -58,7 +58,6 @@ void bnxt_free_int(struct bnxt *bp)
 	irq = bp->irq_tbl;
 	if (irq) {
 		if (irq->requested) {
-			rte_intr_disable(&bp->pdev->intr_handle);
 			rte_intr_callback_unregister(&bp->pdev->intr_handle,
 						     irq->handler,
 						     (void *)bp->eth_dev);
@@ -123,7 +122,6 @@ int bnxt_request_int(struct bnxt *bp)
 
 	rte_intr_callback_register(&bp->pdev->intr_handle, irq->handler,
 				   (void *)bp->eth_dev);
-	rte_intr_enable(&bp->pdev->intr_handle);
 
 	irq->requested = 1;
 	return rc;
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (10 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 11/15] net/bnxt: fix to enable disable interrupts correctly in start stop Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, Somnath Kotur

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

The cleanup/rollback operation post rte_eth_dev_start failure might end
up invoking an HWRM cmd even on an invalid vNIC resulting in error
messages being logged needlessly.
Fix to check for the same before issuing the HWRM cmd.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 84cda5e6c..1a0265f8a 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2325,6 +2325,11 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp)
 	for (i = bp->nr_vnics - 1; i >= 0; i--) {
 		struct bnxt_vnic_info *vnic = &bp->vnic_info[i];
 
+		if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+			PMD_DRV_LOG(DEBUG, "Invalid vNIC ID\n");
+			return;
+		}
+
 		bnxt_clear_hwrm_vnic_flows(bp, vnic);
 
 		bnxt_clear_hwrm_vnic_filters(bp, vnic);
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 13/15] net/bnxt: fix a compilation warning
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (11 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12 13:50   ` Ajit Kumar Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled Ajit Khaparde
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Rahul Gupta

Compiler complains of an uninitialized variable.
Initializing it to avoid the issue.

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 1a0265f8a..a4e0c2e0c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1523,8 +1523,8 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 	int rc = 0;
 	struct hwrm_vnic_cfg_input req = {.req_type = 0 };
 	struct hwrm_vnic_cfg_output *resp = bp->hwrm_cmd_resp_addr;
+	struct bnxt_plcmodes_cfg pmodes = { 0 };
 	uint32_t ctx_enable_flag = 0;
-	struct bnxt_plcmodes_cfg pmodes;
 	uint32_t enables = 0;
 
 	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (12 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware Ajit Khaparde
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Qingmin Liu, Randy Schacher, Somnath Kotur

From: Qingmin Liu <qingmin.liu@broadcom.com>

If ntuple filtering is disabled, FW will return max_vnics=1.
Due to this only single Rxq is created.
Change to max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx) to
fix it.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")
Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Tested-by: Qingmin Liu <qingmin.liu@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index ff0edeef4..2e02d30aa 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -493,7 +493,7 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	/* PF/VF specifics */
 	if (BNXT_PF(bp))
 		dev_info->max_vfs = bp->pdev->max_vfs;
-	max_rx_rings = RTE_MIN(bp->max_vnics, bp->max_stat_ctx);
+	max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx);
 	/* For the sake of symmetry, max_rx_queues = max_tx_queues */
 	dev_info->max_rx_queues = max_rx_rings;
 	dev_info->max_tx_queues = max_rx_rings;
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (13 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled Ajit Khaparde
@ 2019-07-12  6:06 ` Ajit Khaparde
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-12  6:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Jay Ding, Randy Schacher

From: Jay Ding <jay.ding@broadcom.com>

Add checking for vinc id before sending message to chimp in
bnxt_hwrm_vnic_plcmode_cfg().

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Jay Ding <jay.ding@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a4e0c2e0c..313459aaf 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1497,6 +1497,11 @@ static int bnxt_hwrm_vnic_plcmodes_cfg(struct bnxt *bp,
 	struct hwrm_vnic_plcmodes_cfg_input req = {.req_type = 0 };
 	struct hwrm_vnic_plcmodes_cfg_output *resp = bp->hwrm_cmd_resp_addr;
 
+	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+		PMD_DRV_LOG(DEBUG, "VNIC ID %x\n", vnic->fw_vnic_id);
+		return rc;
+	}
+
 	HWRM_PREP(req, VNIC_PLCMODES_CFG, BNXT_USE_CHIMP_MB);
 
 	req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [dpdk-dev] [PATCH 05/15] net/bnxt: reset Rx allocation state on port restart
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
@ 2019-07-12 12:06   ` Lance Richardson
  2019-07-12 12:09     ` Lance Richardson
  0 siblings, 1 reply; 54+ messages in thread
From: Lance Richardson @ 2019-07-12 12:06 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dev, Ferruh Yigit, Christopher Reder

On Fri, Jul 12, 2019 at 2:06 AM Ajit Khaparde
<ajit.khaparde@broadcom.com> wrote:
>
> From: Lance Richardson <lance.richardson@broadcom.com>
>
> Move call site of bnxt_rxq_vec_setup() to ensure that rxq->rxrearm_nb
> and rxq->rxrearm_start are reinitialized correctly when a port is
> restarted.
>
> Fixes: af3ed597e305 ("net/bnxt: initial vector-mode driver")
> Reviewed-by: Christopher Reder <christopher.reder@broadcom.com>
> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_ring.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
> index 16327dbe9..13478fa02 100644
> --- a/drivers/net/bnxt/bnxt_ring.c
> +++ b/drivers/net/bnxt/bnxt_ring.c
> @@ -613,6 +613,9 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
>                 bnxt_db_write(&rxr->rx_db, rxr->rx_prod);
>                 bnxt_db_write(&rxr->ag_db, rxr->ag_prod);
>                 rxq->index = i;
> +#ifdef RTE_LIBRTE_BNXT_INC_VECTOR

This #ifdef should be removed, the macro is never defined in upstream.

> +               bnxt_rxq_vec_setup(rxq);
> +#endif
>         }
>
>         for (i = 0; i < bp->tx_cp_nr_rings; i++) {
> --
> 2.20.1 (Apple Git-117)
>

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [dpdk-dev] [PATCH 05/15] net/bnxt: reset Rx allocation state on port restart
  2019-07-12 12:06   ` Lance Richardson
@ 2019-07-12 12:09     ` Lance Richardson
  0 siblings, 0 replies; 54+ messages in thread
From: Lance Richardson @ 2019-07-12 12:09 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dev, Ferruh Yigit, Christopher Reder

On Fri, Jul 12, 2019 at 8:06 AM Lance Richardson
<lance.richardson@broadcom.com> wrote:
>
> On Fri, Jul 12, 2019 at 2:06 AM Ajit Khaparde
> <ajit.khaparde@broadcom.com> wrote:
> >
> > From: Lance Richardson <lance.richardson@broadcom.com>
> >
> > Move call site of bnxt_rxq_vec_setup() to ensure that rxq->rxrearm_nb
> > and rxq->rxrearm_start are reinitialized correctly when a port is
> > restarted.
> >
> > Fixes: af3ed597e305 ("net/bnxt: initial vector-mode driver")
> > Reviewed-by: Christopher Reder <christopher.reder@broadcom.com>
> > Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> > Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> > ---
> >  drivers/net/bnxt/bnxt_ring.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
> > index 16327dbe9..13478fa02 100644
> > --- a/drivers/net/bnxt/bnxt_ring.c
> > +++ b/drivers/net/bnxt/bnxt_ring.c
> > @@ -613,6 +613,9 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
> >                 bnxt_db_write(&rxr->rx_db, rxr->rx_prod);
> >                 bnxt_db_write(&rxr->ag_db, rxr->ag_prod);
> >                 rxq->index = i;
> > +#ifdef RTE_LIBRTE_BNXT_INC_VECTOR
>
> This #ifdef should be removed, the macro is never defined in upstream.

Correction, it needs to be changed to "#ifdef RTE_ARCH_X86".

   Lance

>
> > +               bnxt_rxq_vec_setup(rxq);
> > +#endif
> >         }
> >
> >         for (i = 0; i < bp->tx_cp_nr_rings; i++) {
> > --
> > 2.20.1 (Apple Git-117)
> >

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [dpdk-dev] [PATCH 13/15] net/bnxt: fix a compilation warning
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
@ 2019-07-12 13:50   ` Ajit Kumar Khaparde
  0 siblings, 0 replies; 54+ messages in thread
From: Ajit Kumar Khaparde @ 2019-07-12 13:50 UTC (permalink / raw)
  To: dev

No worries. I will get to it.

From mobile device

> On Jul 12, 2019, at 11:36, Ajit Khaparde <ajit.khaparde@broadcom.com> wrote:
>
> Compiler complains of an uninitialized variable.
> Initializing it to avoid the issue.
>
> Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
> ---
> drivers/net/bnxt/bnxt_hwrm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
> index 1a0265f8a..a4e0c2e0c 100644
> --- a/drivers/net/bnxt/bnxt_hwrm.c
> +++ b/drivers/net/bnxt/bnxt_hwrm.c
> @@ -1523,8 +1523,8 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)
>    int rc = 0;
>    struct hwrm_vnic_cfg_input req = {.req_type = 0 };
>    struct hwrm_vnic_cfg_output *resp = bp->hwrm_cmd_resp_addr;
> +    struct bnxt_plcmodes_cfg pmodes = { 0 };
>    uint32_t ctx_enable_flag = 0;
> -    struct bnxt_plcmodes_cfg pmodes;
>    uint32_t enables = 0;
>
>    if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
> --
> 2.20.1 (Apple Git-117)
>

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [dpdk-dev] [PATCH 01/15] net/bnxt: fix extended port counter statistics
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
@ 2019-07-12 15:04   ` Stephen Hemminger
  0 siblings, 0 replies; 54+ messages in thread
From: Stephen Hemminger @ 2019-07-12 15:04 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dev, ferruh.yigit, Kalesh AP

On Fri, 12 Jul 2019 11:36:08 +0530
Ajit Khaparde <ajit.khaparde@broadcom.com> wrote:

> +	snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
> +		 "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
> +		 pci_dev->addr.bus, pci_dev->addr.devid,
> +		 pci_dev->addr.function, "rx_port_stats");

You could use the PCI_PRI_FMT definition from rte_pci.h here.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 00/15] bnxt patch series
  2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
                   ` (14 preceding siblings ...)
  2019-07-12  6:06 ` [dpdk-dev] [PATCH 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware Ajit Khaparde
@ 2019-07-16  9:28 ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
                     ` (15 more replies)
  15 siblings, 16 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

Patchset fixing various bugs in bnxt PMD based on recent patch submission.
https://patchwork.dpdk.org/patch/56311/
Please apply.

Note this patchset supersedes the previous patch series:
https://patchwork.dpdk.org/project/dpdk/list/?series=5464

Ajit Khaparde (3):
  net/bnxt: fix for doorbell register offset for Tx ring.
  net/bnxt: save the number of EM flow count
  net/bnxt: fix a compilation warning

Jay Ding (1):
  net/bnxt: fix to avoid sending invalid VNIC id to firmware

Kalesh AP (5):
  net/bnxt: fix extended port counter statistics
  net/bnxt: fix possible segfault in case of probe failure
  net/bnxt: do not fail VF probe when the MAC address is zero
  net/bnxt: fix to enable disable interrupts correctly in start stop
  net/bnxt: fix to check for invalid VNIC in cleanup path

Lance Richardson (4):
  net/bnxt: fix Tx hang after port stop/start
  net/bnxt: reset Rx allocation state on port restart
  net/bnxt: nq doorbell cleanups
  net/bnxt: avoid null pointer dereference

Qingmin Liu (1):
  net/bnxt: fix rxq count if ntuple filtering is disabled

Rahul Gupta (1):
  net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel
    packets

 drivers/net/bnxt/bnxt.h        |   3 +
 drivers/net/bnxt/bnxt_ethdev.c | 307 +++++++++++++++++++--------------
 drivers/net/bnxt/bnxt_hwrm.c   |  56 +++++-
 drivers/net/bnxt/bnxt_hwrm.h   |   1 +
 drivers/net/bnxt/bnxt_irq.c    |   5 +-
 drivers/net/bnxt/bnxt_ring.c   |  11 +-
 drivers/net/bnxt/bnxt_ring.h   |  23 ++-
 drivers/net/bnxt/bnxt_rxq.c    |   4 -
 drivers/net/bnxt/bnxt_rxr.c    |  43 +++--
 drivers/net/bnxt/bnxt_rxr.h    | 120 ++++++++++---
 drivers/net/bnxt/bnxt_util.c   |  11 ++
 drivers/net/bnxt/bnxt_util.h   |   1 +
 drivers/net/bnxt/bnxt_vnic.c   |   3 +
 13 files changed, 409 insertions(+), 179 deletions(-)

-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 01/15] net/bnxt: fix extended port counter statistics
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 02/15] net/bnxt: fix possible segfault in case of probe failure Ajit Khaparde
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, Ajit Kumar Khaparde

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

1. refactor stats allocation code to new routine
2. check for extended statistics support depends on "hwrm_spec_code"
   which is set in bnxt_hwrm_ver_get called later. Hence we were never
   querying extended port stats as flags field was not updated. Fixed
   this by moving the stats allocation after the call to
   bnxt_hwrm_ver_get.
3. we were incorrectly passing the host address used for port
   statistics to PORT_QSTATS_EXT command. Fixed this by passing the
   correct extended stats address.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
--
v1->v2: Use PCI_PRI_FMT to format PCI address.
---
 drivers/net/bnxt/bnxt.h        |   1 +
 drivers/net/bnxt/bnxt_ethdev.c | 226 +++++++++++++++++----------------
 drivers/net/bnxt/bnxt_hwrm.c   |   7 +-
 3 files changed, 125 insertions(+), 109 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 942da7ff0..45e7359b2 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -350,6 +350,7 @@ struct bnxt {
 #define BNXT_FLAG_TRUSTED_VF_EN	(1 << 11)
 #define BNXT_FLAG_DFLT_VNIC_SET	(1 << 12)
 #define BNXT_FLAG_THOR_CHIP	(1 << 13)
+#define BNXT_FLAG_EXT_STATS_SUPPORTED	(1 << 29)
 #define BNXT_FLAG_NEW_RM	(1 << 30)
 #define BNXT_FLAG_INIT_DONE	(1U << 31)
 #define BNXT_PF(bp)		(!((bp)->flags & BNXT_FLAG_VF))
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 14b69a480..cb50572a6 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3639,6 +3639,120 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
 	return 0;
 }
 
+static int bnxt_alloc_stats_mem(struct bnxt *bp)
+{
+	struct rte_pci_device *pci_dev = bp->pdev;
+	char mz_name[RTE_MEMZONE_NAMESIZE];
+	const struct rte_memzone *mz = NULL;
+	uint32_t total_alloc_len;
+	rte_iova_t mz_phys_addr;
+
+	if (pci_dev->id.device_id == BROADCOM_DEV_ID_NS2)
+		return 0;
+
+	snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
+		 "bnxt_"PCI_PRI_FMT"-%s", pci_dev->addr.domain,
+		 pci_dev->addr.bus, pci_dev->addr.devid,
+		 pci_dev->addr.function, "rx_port_stats");
+	mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
+	mz = rte_memzone_lookup(mz_name);
+	total_alloc_len =
+		RTE_CACHE_LINE_ROUNDUP(sizeof(struct rx_port_stats) +
+				       sizeof(struct rx_port_stats_ext) + 512);
+	if (!mz) {
+		mz = rte_memzone_reserve(mz_name, total_alloc_len,
+					 SOCKET_ID_ANY,
+					 RTE_MEMZONE_2MB |
+					 RTE_MEMZONE_SIZE_HINT_ONLY |
+					 RTE_MEMZONE_IOVA_CONTIG);
+		if (mz == NULL)
+			return -ENOMEM;
+	}
+	memset(mz->addr, 0, mz->len);
+	mz_phys_addr = mz->iova;
+	if ((unsigned long)mz->addr == mz_phys_addr) {
+		PMD_DRV_LOG(WARNING,
+			    "Memzone physical address same as virtual.\n");
+		PMD_DRV_LOG(WARNING,
+			    "Using rte_mem_virt2iova()\n");
+		mz_phys_addr = rte_mem_virt2iova(mz->addr);
+		if (mz_phys_addr == 0) {
+			PMD_DRV_LOG(ERR,
+				    "Can't map address to physical memory\n");
+			return -ENOMEM;
+		}
+	}
+
+	bp->rx_mem_zone = (const void *)mz;
+	bp->hw_rx_port_stats = mz->addr;
+	bp->hw_rx_port_stats_map = mz_phys_addr;
+
+	snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
+		 "bnxt_"PCI_PRI_FMT"-%s", pci_dev->addr.domain,
+		 pci_dev->addr.bus, pci_dev->addr.devid,
+		 pci_dev->addr.function, "tx_port_stats");
+	mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
+	mz = rte_memzone_lookup(mz_name);
+	total_alloc_len =
+		RTE_CACHE_LINE_ROUNDUP(sizeof(struct tx_port_stats) +
+				       sizeof(struct tx_port_stats_ext) + 512);
+	if (!mz) {
+		mz = rte_memzone_reserve(mz_name,
+					 total_alloc_len,
+					 SOCKET_ID_ANY,
+					 RTE_MEMZONE_2MB |
+					 RTE_MEMZONE_SIZE_HINT_ONLY |
+					 RTE_MEMZONE_IOVA_CONTIG);
+		if (mz == NULL)
+			return -ENOMEM;
+	}
+	memset(mz->addr, 0, mz->len);
+	mz_phys_addr = mz->iova;
+	if ((unsigned long)mz->addr == mz_phys_addr) {
+		PMD_DRV_LOG(WARNING,
+			    "Memzone physical address same as virtual\n");
+		PMD_DRV_LOG(WARNING,
+			    "Using rte_mem_virt2iova()\n");
+		mz_phys_addr = rte_mem_virt2iova(mz->addr);
+		if (mz_phys_addr == 0) {
+			PMD_DRV_LOG(ERR,
+				    "Can't map address to physical memory\n");
+			return -ENOMEM;
+		}
+	}
+
+	bp->tx_mem_zone = (const void *)mz;
+	bp->hw_tx_port_stats = mz->addr;
+	bp->hw_tx_port_stats_map = mz_phys_addr;
+	bp->flags |= BNXT_FLAG_PORT_STATS;
+
+	/* Display extended statistics if FW supports it */
+	if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_8_4 ||
+	    bp->hwrm_spec_code == HWRM_SPEC_CODE_1_9_0 ||
+	    !(bp->flags & BNXT_FLAG_EXT_STATS_SUPPORTED))
+		return 0;
+
+	bp->hw_rx_port_stats_ext = (void *)
+		((uint8_t *)bp->hw_rx_port_stats +
+		 sizeof(struct rx_port_stats));
+	bp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map +
+		sizeof(struct rx_port_stats);
+	bp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS;
+
+	if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2 ||
+	    bp->flags & BNXT_FLAG_EXT_STATS_SUPPORTED) {
+		bp->hw_tx_port_stats_ext = (void *)
+			((uint8_t *)bp->hw_tx_port_stats +
+			 sizeof(struct tx_port_stats));
+		bp->hw_tx_port_stats_ext_map =
+			bp->hw_tx_port_stats_map +
+			sizeof(struct tx_port_stats);
+		bp->flags |= BNXT_FLAG_EXT_TX_PORT_STATS;
+	}
+
+	return 0;
+}
+
 #define ALLOW_FUNC(x)	\
 	{ \
 		uint32_t arg = (x); \
@@ -3649,11 +3763,7 @@ static int
 bnxt_dev_init(struct rte_eth_dev *eth_dev)
 {
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
-	char mz_name[RTE_MEMZONE_NAMESIZE];
-	const struct rte_memzone *mz = NULL;
 	static int version_printed;
-	uint32_t total_alloc_len;
-	rte_iova_t mz_phys_addr;
 	struct bnxt *bp;
 	uint16_t mtu;
 	int rc;
@@ -3692,109 +3802,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
-	if (pci_dev->id.device_id != BROADCOM_DEV_ID_NS2) {
-		snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
-			 "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
-			 pci_dev->addr.bus, pci_dev->addr.devid,
-			 pci_dev->addr.function, "rx_port_stats");
-		mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
-		mz = rte_memzone_lookup(mz_name);
-		total_alloc_len = RTE_CACHE_LINE_ROUNDUP(
-					sizeof(struct rx_port_stats) +
-					sizeof(struct rx_port_stats_ext) +
-					512);
-		if (!mz) {
-			mz = rte_memzone_reserve(mz_name, total_alloc_len,
-					SOCKET_ID_ANY,
-					RTE_MEMZONE_2MB |
-					RTE_MEMZONE_SIZE_HINT_ONLY |
-					RTE_MEMZONE_IOVA_CONTIG);
-			if (mz == NULL)
-				return -ENOMEM;
-		}
-		memset(mz->addr, 0, mz->len);
-		mz_phys_addr = mz->iova;
-		if ((unsigned long)mz->addr == mz_phys_addr) {
-			PMD_DRV_LOG(INFO,
-				"Memzone physical address same as virtual using rte_mem_virt2iova()\n");
-			mz_phys_addr = rte_mem_virt2iova(mz->addr);
-			if (mz_phys_addr == 0) {
-				PMD_DRV_LOG(ERR,
-				"unable to map address to physical memory\n");
-				return -ENOMEM;
-			}
-		}
-
-		bp->rx_mem_zone = (const void *)mz;
-		bp->hw_rx_port_stats = mz->addr;
-		bp->hw_rx_port_stats_map = mz_phys_addr;
-
-		snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
-			 "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
-			 pci_dev->addr.bus, pci_dev->addr.devid,
-			 pci_dev->addr.function, "tx_port_stats");
-		mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
-		mz = rte_memzone_lookup(mz_name);
-		total_alloc_len = RTE_CACHE_LINE_ROUNDUP(
-					sizeof(struct tx_port_stats) +
-					sizeof(struct tx_port_stats_ext) +
-					512);
-		if (!mz) {
-			mz = rte_memzone_reserve(mz_name,
-					total_alloc_len,
-					SOCKET_ID_ANY,
-					RTE_MEMZONE_2MB |
-					RTE_MEMZONE_SIZE_HINT_ONLY |
-					RTE_MEMZONE_IOVA_CONTIG);
-			if (mz == NULL)
-				return -ENOMEM;
-		}
-		memset(mz->addr, 0, mz->len);
-		mz_phys_addr = mz->iova;
-		if ((unsigned long)mz->addr == mz_phys_addr) {
-			PMD_DRV_LOG(WARNING,
-				"Memzone physical address same as virtual.\n");
-			PMD_DRV_LOG(WARNING,
-				"Using rte_mem_virt2iova()\n");
-			mz_phys_addr = rte_mem_virt2iova(mz->addr);
-			if (mz_phys_addr == 0) {
-				PMD_DRV_LOG(ERR,
-				"unable to map address to physical memory\n");
-				return -ENOMEM;
-			}
-		}
-
-		bp->tx_mem_zone = (const void *)mz;
-		bp->hw_tx_port_stats = mz->addr;
-		bp->hw_tx_port_stats_map = mz_phys_addr;
-
-		bp->flags |= BNXT_FLAG_PORT_STATS;
-
-		/* Display extended statistics if FW supports it */
-		if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_8_4 ||
-		    bp->hwrm_spec_code == HWRM_SPEC_CODE_1_9_0)
-			goto skip_ext_stats;
-
-		bp->hw_rx_port_stats_ext = (void *)
-			((uint8_t *)bp->hw_rx_port_stats +
-			 sizeof(struct rx_port_stats));
-		bp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map +
-			sizeof(struct rx_port_stats);
-		bp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS;
-
-
-		if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2) {
-			bp->hw_tx_port_stats_ext = (void *)
-				((uint8_t *)bp->hw_tx_port_stats +
-				 sizeof(struct tx_port_stats));
-			bp->hw_tx_port_stats_ext_map =
-				bp->hw_tx_port_stats_map +
-				sizeof(struct tx_port_stats);
-			bp->flags |= BNXT_FLAG_EXT_TX_PORT_STATS;
-		}
-	}
-
-skip_ext_stats:
 	rc = bnxt_alloc_hwrm_resources(bp);
 	if (rc) {
 		PMD_DRV_LOG(ERR,
@@ -3823,6 +3830,11 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		PMD_DRV_LOG(ERR, "hwrm query capability failure rc: %x\n", rc);
 		goto error_free;
 	}
+
+	rc = bnxt_alloc_stats_mem(bp);
+	if (rc)
+		goto error_free;
+
 	if (bp->max_tx_rings == 0) {
 		PMD_DRV_LOG(ERR, "No TX rings available!\n");
 		rc = -EBUSY;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 8f0d33dca..f691922bd 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -611,6 +611,9 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 		}
 	}
 
+	if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED)
+		bp->flags |= BNXT_FLAG_EXT_STATS_SUPPORTED;
+
 	HWRM_UNLOCK();
 
 	return rc;
@@ -4495,13 +4498,13 @@ int bnxt_hwrm_ext_port_qstats(struct bnxt *bp)
 	req.port_id = rte_cpu_to_le_16(pf->port_id);
 	if (bp->flags & BNXT_FLAG_EXT_TX_PORT_STATS) {
 		req.tx_stat_host_addr =
-			rte_cpu_to_le_64(bp->hw_tx_port_stats_map);
+			rte_cpu_to_le_64(bp->hw_tx_port_stats_ext_map);
 		req.tx_stat_size =
 			rte_cpu_to_le_16(sizeof(struct tx_port_stats_ext));
 	}
 	if (bp->flags & BNXT_FLAG_EXT_RX_PORT_STATS) {
 		req.rx_stat_host_addr =
-			rte_cpu_to_le_64(bp->hw_rx_port_stats_map);
+			rte_cpu_to_le_64(bp->hw_rx_port_stats_ext_map);
 		req.rx_stat_size =
 			rte_cpu_to_le_16(sizeof(struct rx_port_stats_ext));
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 02/15] net/bnxt: fix possible segfault in case of probe failure
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 03/15] net/bnxt: do not fail VF probe when the MAC address is zero Ajit Khaparde
                     ` (13 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Fixed couple of possible segfaults due to NULL pointer
dereference in case of probe failure.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_irq.c  | 3 +++
 drivers/net/bnxt/bnxt_vnic.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 0bb3eb4fa..61f7498a5 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -52,6 +52,9 @@ void bnxt_free_int(struct bnxt *bp)
 {
 	struct bnxt_irq *irq;
 
+	if (bp->irq_tbl == NULL)
+		return;
+
 	irq = bp->irq_tbl;
 	if (irq) {
 		if (irq->requested) {
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 262cfc18d..20e5bf2d1 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -89,6 +89,9 @@ void bnxt_free_vnic_attributes(struct bnxt *bp)
 	struct bnxt_vnic_info *vnic;
 	unsigned int i;
 
+	if (bp->vnic_info == NULL)
+		return;
+
 	for (i = 0; i < bp->max_vnics; i++) {
 		vnic = &bp->vnic_info[i];
 		if (vnic->rss_table) {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 03/15] net/bnxt: do not fail VF probe when the MAC address is zero
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 02/15] net/bnxt: fix possible segfault in case of probe failure Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 04/15] net/bnxt: fix Tx hang after port stop/start Ajit Khaparde
                     ` (12 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

VF driver should not fail probe if the host PF driver has not assigned
any MAC address for the VF. It should generate a random MAC address and
configure the MAC and then continue probing the device.

Fixes: be160484a48d ("net/bnxt: check if MAC address is all zeros")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 62 +++++++++++++++++++++++-----------
 drivers/net/bnxt/bnxt_hwrm.c   | 25 ++++++++++++++
 drivers/net/bnxt/bnxt_hwrm.h   |  1 +
 drivers/net/bnxt/bnxt_util.c   | 11 ++++++
 drivers/net/bnxt/bnxt_util.h   |  1 +
 5 files changed, 80 insertions(+), 20 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index cb50572a6..40a57bb23 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3753,6 +3753,46 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
 	return 0;
 }
 
+static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev)
+{
+	struct bnxt *bp = eth_dev->data->dev_private;
+	int rc = 0;
+
+	eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
+					       RTE_ETHER_ADDR_LEN *
+					       bp->max_l2_ctx,
+					       0);
+	if (eth_dev->data->mac_addrs == NULL) {
+		PMD_DRV_LOG(ERR, "Failed to alloc MAC addr tbl\n");
+		return -ENOMEM;
+	}
+
+	if (bnxt_check_zero_bytes(bp->dflt_mac_addr, RTE_ETHER_ADDR_LEN)) {
+		if (BNXT_PF(bp))
+			return -EINVAL;
+
+		/* Generate a random MAC address, if none was assigned by PF */
+		PMD_DRV_LOG(INFO, "VF MAC address not assigned by Host PF\n");
+		bnxt_eth_hw_addr_random(bp->mac_addr);
+		PMD_DRV_LOG(INFO,
+			    "Assign random MAC:%02X:%02X:%02X:%02X:%02X:%02X\n",
+			    bp->mac_addr[0], bp->mac_addr[1], bp->mac_addr[2],
+			    bp->mac_addr[3], bp->mac_addr[4], bp->mac_addr[5]);
+
+		rc = bnxt_hwrm_set_mac(bp);
+		if (!rc)
+			memcpy(&bp->eth_dev->data->mac_addrs[0], bp->mac_addr,
+			       RTE_ETHER_ADDR_LEN);
+		return rc;
+	}
+
+	/* Copy the permanent MAC from the FUNC_QCAPS response */
+	memcpy(bp->mac_addr, bp->dflt_mac_addr, RTE_ETHER_ADDR_LEN);
+	memcpy(&eth_dev->data->mac_addrs[0], bp->mac_addr, RTE_ETHER_ADDR_LEN);
+
+	return rc;
+}
+
 #define ALLOW_FUNC(x)	\
 	{ \
 		uint32_t arg = (x); \
@@ -3840,28 +3880,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		rc = -EBUSY;
 		goto error_free;
 	}
-	eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
-					RTE_ETHER_ADDR_LEN * bp->max_l2_ctx, 0);
-	if (eth_dev->data->mac_addrs == NULL) {
-		PMD_DRV_LOG(ERR,
-			"Failed to alloc %u bytes needed to store MAC addr tbl",
-			RTE_ETHER_ADDR_LEN * bp->max_l2_ctx);
-		rc = -ENOMEM;
-		goto error_free;
-	}
 
-	if (bnxt_check_zero_bytes(bp->dflt_mac_addr, RTE_ETHER_ADDR_LEN)) {
-		PMD_DRV_LOG(ERR,
-			    "Invalid MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n",
-			    bp->dflt_mac_addr[0], bp->dflt_mac_addr[1],
-			    bp->dflt_mac_addr[2], bp->dflt_mac_addr[3],
-			    bp->dflt_mac_addr[4], bp->dflt_mac_addr[5]);
-		rc = -EINVAL;
+	rc = bnxt_setup_mac_addr(eth_dev);
+	if (rc)
 		goto error_free;
-	}
-	/* Copy the permanent MAC from the qcap response address now. */
-	memcpy(bp->mac_addr, bp->dflt_mac_addr, sizeof(bp->mac_addr));
-	memcpy(&eth_dev->data->mac_addrs[0], bp->mac_addr, RTE_ETHER_ADDR_LEN);
 
 	/* THOR does not support ring groups.
 	 * But we will use the array to save RSS context IDs.
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f691922bd..a9356c6b8 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -4607,3 +4607,28 @@ int bnxt_hwrm_tunnel_redirect_info(struct bnxt *bp, uint8_t tun_type,
 
 	return rc;
 }
+
+int bnxt_hwrm_set_mac(struct bnxt *bp)
+{
+	struct hwrm_func_vf_cfg_output *resp = bp->hwrm_cmd_resp_addr;
+	struct hwrm_func_vf_cfg_input req = {0};
+	int rc = 0;
+
+	if (!BNXT_VF(bp))
+		return 0;
+
+	HWRM_PREP(req, FUNC_VF_CFG, BNXT_USE_CHIMP_MB);
+
+	req.enables =
+		rte_cpu_to_le_32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR);
+	memcpy(req.dflt_mac_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN);
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+
+	HWRM_CHECK_RESULT();
+
+	memcpy(bp->dflt_mac_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN);
+	HWRM_UNLOCK();
+
+	return rc;
+}
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index e35462cb4..37aaa1a9e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -196,4 +196,5 @@ int bnxt_hwrm_tunnel_redirect_free(struct bnxt *bp, uint8_t type);
 int bnxt_hwrm_tunnel_redirect_query(struct bnxt *bp, uint32_t *type);
 int bnxt_hwrm_tunnel_redirect_info(struct bnxt *bp, uint8_t tun_type,
 				   uint16_t *dst_fid);
+int bnxt_hwrm_set_mac(struct bnxt *bp);
 #endif
diff --git a/drivers/net/bnxt/bnxt_util.c b/drivers/net/bnxt/bnxt_util.c
index 7d3342719..dda40af28 100644
--- a/drivers/net/bnxt/bnxt_util.c
+++ b/drivers/net/bnxt/bnxt_util.c
@@ -4,6 +4,7 @@
  */
 
 #include <inttypes.h>
+#include <rte_ether.h>
 
 #include "bnxt_util.h"
 
@@ -16,3 +17,13 @@ int bnxt_check_zero_bytes(const uint8_t *bytes, int len)
 			return 0;
 	return 1;
 }
+
+void bnxt_eth_hw_addr_random(uint8_t *mac_addr)
+{
+	rte_eth_random_addr(mac_addr);
+
+	/* Set Organizationally Unique Identifier (OUI) prefix */
+	mac_addr[0] = 0x00;
+	mac_addr[1] = 0x0a;
+	mac_addr[2] = 0xf7;
+}
diff --git a/drivers/net/bnxt/bnxt_util.h b/drivers/net/bnxt/bnxt_util.h
index 2378833cc..9f1868a78 100644
--- a/drivers/net/bnxt/bnxt_util.h
+++ b/drivers/net/bnxt/bnxt_util.h
@@ -7,5 +7,6 @@
 #define _BNXT_UTIL_H_
 
 int bnxt_check_zero_bytes(const uint8_t *bytes, int len);
+void bnxt_eth_hw_addr_random(uint8_t *mac_addr);
 
 #endif /* _BNXT_UTIL_H_ */
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 04/15] net/bnxt: fix Tx hang after port stop/start
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (2 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 03/15] net/bnxt: do not fail VF probe when the MAC address is zero Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
                     ` (11 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson, Kalesh Anakkur Purayil

From: Lance Richardson <lance.richardson@broadcom.com>

Initialize the state of the the completion valid indicator
when a completion ring is freed, otherwise completions may
not be processed when a new ring is allocated.

Fixes: 5735eb241947 ("net/bnxt: support Tx batching")
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a9356c6b8..b6f9ec0a0 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2089,6 +2089,7 @@ static void bnxt_free_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr)
 	memset(cpr->cp_desc_ring, 0, cpr->cp_ring_struct->ring_size *
 			sizeof(*cpr->cp_desc_ring));
 	cpr->cp_raw_cons = 0;
+	cpr->valid = 0;
 }
 
 void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 05/15] net/bnxt: reset Rx allocation state on port restart
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (3 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 04/15] net/bnxt: fix Tx hang after port stop/start Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 06/15] net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets Ajit Khaparde
                     ` (10 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson, Christopher Reder

From: Lance Richardson <lance.richardson@broadcom.com>

Move call site of bnxt_rxq_vec_setup() to ensure that rxq->rxrearm_nb
and rxq->rxrearm_start are reinitialized correctly when a port is
restarted.

Fixes: af3ed597e305 ("net/bnxt: initial vector-mode driver")
Reviewed-by: Christopher Reder <christopher.reder@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
--
v1->v2: Move bnxt_rxq_vec_setup under RTE_ARCH_X86.
---
 drivers/net/bnxt/bnxt_ring.c | 3 +++
 drivers/net/bnxt/bnxt_rxq.c  | 4 ----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 16327dbe9..7453d4b56 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -613,6 +613,9 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
 		bnxt_db_write(&rxr->rx_db, rxr->rx_prod);
 		bnxt_db_write(&rxr->ag_db, rxr->ag_prod);
 		rxq->index = i;
+#ifdef RTE_ARCH_X86
+		bnxt_rxq_vec_setup(rxq);
+#endif
 	}
 
 	for (i = 0; i < bp->tx_cp_nr_rings; i++) {
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index 6919acbb4..c94cac5a9 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -356,10 +356,6 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 	eth_dev->data->rx_queue_state[queue_idx] = queue_state;
 	rte_spinlock_init(&rxq->lock);
 
-#ifdef RTE_ARCH_X86
-	bnxt_rxq_vec_setup(rxq);
-#endif
-
 out:
 	return rc;
 }
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 06/15] net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (4 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 07/15] net/bnxt: fix for doorbell register offset for Tx ring Ajit Khaparde
                     ` (9 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Rahul Gupta

From: Rahul Gupta <rahul.gupta@broadcom.com>

Update ol_flags correctly for checksum errors in case of tunnel and
non-tunnel packet.

Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags)

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.c |  43 ++++++++++---
 drivers/net/bnxt/bnxt_rxr.h | 120 ++++++++++++++++++++++++++++++------
 2 files changed, 133 insertions(+), 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 44303f3b0..54a2cf5fd 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -362,6 +362,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 	int rc = 0;
 	uint8_t agg_buf = 0;
 	uint16_t cmp_type;
+	uint32_t flags2_f = 0;
 
 	rxcmp = (struct rx_pkt_cmpl *)
 	    &cpr->cp_desc_ring[cp_cons];
@@ -440,19 +441,41 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 		mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
 	}
 
-	if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
-	else if (likely(RX_CMP_IP_CS_UNKNOWN(rxcmp1)))
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
-	else
+	flags2_f = flags2_0xf(rxcmp1);
+	/* IP Checksum */
+	if (unlikely(((IS_IP_NONTUNNEL_PKT(flags2_f)) &&
+		      (RX_CMP_IP_CS_ERROR(rxcmp1))) ||
+		     (IS_IP_TUNNEL_PKT(flags2_f) &&
+		      (RX_CMP_IP_OUTER_CS_ERROR(rxcmp1))))) {
 		mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
+	} else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) {
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
+	} else {
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
+	}
 
-	if (likely(RX_CMP_L4_CS_OK(rxcmp1)))
-		mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
-	else if (likely(RX_CMP_L4_CS_UNKNOWN(rxcmp1)))
+	/* L4 Checksum */
+	if (likely(IS_L4_NONTUNNEL_PKT(flags2_f))) {
+		if (unlikely(RX_CMP_L4_INNER_CS_ERR2(rxcmp1)))
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
+		else
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+	} else if (IS_L4_TUNNEL_PKT(flags2_f)) {
+		if (unlikely(RX_CMP_L4_INNER_CS_ERR2(rxcmp1)))
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
+		else
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+		if (unlikely(RX_CMP_L4_OUTER_CS_ERR2(rxcmp1))) {
+			mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_BAD;
+		} else if (unlikely(IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS
+				    (flags2_f))) {
+			mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_UNKNOWN;
+		} else {
+			mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_GOOD;
+		}
+	} else if (unlikely(RX_CMP_L4_CS_UNKNOWN(rxcmp1))) {
 		mbuf->ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
-	else
-		mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
+	}
 
 	mbuf->packet_type = bnxt_parse_pkt_type(rxcmp, rxcmp1);
 
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 6523b94c6..6a80c37c8 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -24,36 +24,116 @@
 #define BNXT_TPA_OUTER_L3_OFF(hdr_info)	\
 	((hdr_info) & 0x1ff)
 
-#define RX_CMP_L4_CS_BITS	\
-	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_L4_CS_CALC | \
-			 RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)
-
-#define RX_CMP_L4_CS_ERR_BITS	\
-	rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR | \
-			 RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR)
+#define flags2_0xf(rxcmp1)	\
+	(((rxcmp1)->flags2) & 0xf)
 
-#define RX_CMP_L4_CS_OK(rxcmp1)						\
-	    (((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS) &&		\
-	     !((rxcmp1)->errors_v2 & RX_CMP_L4_CS_ERR_BITS))
+/* IP non tunnel can be with or without L4-
+ * Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP Or
+ * Ether / (vlan) / outer IP|IP6 / ICMP
+ * we use '==' instead of '&' because tunnel pkts have all 4 fields set.
+ */
+#define IS_IP_NONTUNNEL_PKT(flags2_f)	\
+	(	\
+	 ((flags2_f) == \
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC))) ||	\
+	 ((flags2_f) ==	\
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC | \
+			    RX_PKT_CMPL_FLAGS2_L4_CS_CALC))) \
+	)
+
+/* IP Tunnel pkt must have atleast tunnel-IP-calc set.
+ * again tunnel ie outer L4 is optional bcoz of
+ * Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
+ *           UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ *           UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ *           UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
+ * also inner L3 chksum error is not taken into consideration by DPDK.
+ */
+#define IS_IP_TUNNEL_PKT(flags2_f)	\
+	((flags2_f) & rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC))
 
-#define RX_CMP_L4_CS_UNKNOWN(rxcmp1)					\
-	    !((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS)
+/* RX_PKT_CMPL_ERRORS_IP_CS_ERROR only for Non-tunnel pkts.
+ * For tunnel pkts RX_PKT_CMPL_ERRORS_IP_CS_ERROR is not accounted and treated
+ * as good csum pkt.
+ */
+#define RX_CMP_IP_CS_ERROR(rxcmp1)	\
+	((rxcmp1)->errors_v2 &	\
+	 rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR))
 
-#define RX_CMP_IP_CS_ERR_BITS	\
-	rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR | \
-			 RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR)
+#define RX_CMP_IP_OUTER_CS_ERROR(rxcmp1)	\
+	((rxcmp1)->errors_v2 &	\
+	 rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR))
 
 #define RX_CMP_IP_CS_BITS	\
 	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC | \
 			 RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC)
 
-#define RX_CMP_IP_CS_OK(rxcmp1)						\
-		(((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS) &&	\
-		!((rxcmp1)->errors_v2 & RX_CMP_IP_CS_ERR_BITS))
-
-#define RX_CMP_IP_CS_UNKNOWN(rxcmp1)					\
+#define RX_CMP_IP_CS_UNKNOWN(rxcmp1)	\
 		!((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS)
 
+/* L4 non tunnel pkt-
+ * Ether / (vlan) / IP6 / UDP|TCP|SCTP
+ */
+#define IS_L4_NONTUNNEL_PKT(flags2_f)	\
+	( \
+	  ((flags2_f) == \
+	   (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC |	\
+			     RX_PKT_CMPL_FLAGS2_L4_CS_CALC))))
+
+/* L4 tunnel pkt-
+ * Outer L4 is not mandatory. Eg: GRE-
+ * Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
+ *           UDP|TCP|SCTP
+ */
+#define	IS_L4_TUNNEL_PKT_INNER_OUTER_L4_CS(flags2_f)	\
+	 ((flags2_f) == \
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_L4_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)))
+
+#define IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS(flags2_f)	\
+	 ((flags2_f) == \
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_L4_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC)))
+
+#define IS_L4_TUNNEL_PKT(flags2_f)	\
+	(	\
+		IS_L4_TUNNEL_PKT_INNER_OUTER_L4_CS(flags2_f) || \
+		IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS(flags2_f)	\
+	)
+
+#define RX_CMP_L4_CS_BITS	\
+	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_L4_CS_CALC)
+
+#define RX_CMP_L4_CS_UNKNOWN(rxcmp1)					\
+	    !((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS)
+
+#define RX_CMP_T_L4_CS_BITS	\
+	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)
+
+#define RX_CMP_T_L4_CS_UNKNOWN(rxcmp1)					\
+	    !((rxcmp1)->flags2 & RX_CMP_T_L4_CS_BITS)
+
+/* Outer L4 chksum error
+ */
+#define RX_CMP_L4_OUTER_CS_ERR2(rxcmp1)	\
+	 ((rxcmp1)->errors_v2 & \
+	  rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR))
+
+/* Inner L4 chksum error
+ */
+#define RX_CMP_L4_INNER_CS_ERR2(rxcmp1)	\
+	 ((rxcmp1)->errors_v2 & \
+	  rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR))
+
 #define BNXT_RX_POST_THRESH	32
 
 enum pkt_hash_types {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 07/15] net/bnxt: fix for doorbell register offset for Tx ring.
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (5 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 06/15] net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 08/15] net/bnxt: save the number of EM flow count Ajit Khaparde
                     ` (8 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Rahul Gupta

For Tx-ring # 104 and higher, the doorbell register was incorrectly
configured due to which FW was not able to receive the notification
of packet to transmit. With this fix, user can run traffic upto 256 rings.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 7453d4b56..9b19459b6 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -639,12 +639,12 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
 		ring_type = HWRM_RING_ALLOC_INPUT_RING_TYPE_TX;
 		rc = bnxt_hwrm_ring_alloc(bp, ring,
 					  ring_type,
-					  idx, cpr->hw_stats_ctx_id,
+					  i, cpr->hw_stats_ctx_id,
 					  cp_ring->fw_ring_id);
 		if (rc)
 			goto err_out;
 
-		bnxt_set_db(bp, &txr->tx_db, ring_type, idx, ring->fw_ring_id);
+		bnxt_set_db(bp, &txr->tx_db, ring_type, i, ring->fw_ring_id);
 		txq->index = idx;
 		bnxt_hwrm_set_ring_coal(bp, &coal, cp_ring->fw_ring_id);
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 08/15] net/bnxt: save the number of EM flow count
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (6 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 07/15] net/bnxt: fix for doorbell register offset for Tx ring Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 09/15] net/bnxt: nq doorbell cleanups Ajit Khaparde
                     ` (7 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh Anakkur Purayil

Save the number of EM flow count returned by the FW in HWRM_FUNC_QCFG
and use it to calculate the overall pool of L2 contexts supported by FW.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt.h      |  1 +
 drivers/net/bnxt/bnxt_hwrm.c | 11 +++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 45e7359b2..cd809b385 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -429,6 +429,7 @@ struct bnxt {
 	uint16_t		max_rx_rings;
 	uint16_t		max_nq_rings;
 	uint16_t		max_l2_ctx;
+	uint16_t		max_rx_em_flows;
 	uint16_t		max_vnics;
 	uint16_t		max_stat_ctx;
 	uint16_t		first_vf_id;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index b6f9ec0a0..84cda5e6c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -589,8 +589,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 	bp->max_cp_rings = rte_le_to_cpu_16(resp->max_cmpl_rings);
 	bp->max_tx_rings = rte_le_to_cpu_16(resp->max_tx_rings);
 	bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings);
-	bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs);
 	bp->first_vf_id = rte_le_to_cpu_16(resp->first_vf_id);
+	bp->max_rx_em_flows = rte_le_to_cpu_16(resp->max_rx_em_flows);
+	bp->max_l2_ctx =
+		rte_le_to_cpu_16(resp->max_l2_ctxs) + bp->max_rx_em_flows;
 	/* TODO: For now, do not support VMDq/RFS on VFs. */
 	if (BNXT_PF(bp)) {
 		if (bp->pf.max_vfs)
@@ -796,7 +798,12 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp)
 		bp->max_tx_rings = rte_le_to_cpu_16(resp->max_tx_rings);
 		bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings);
 		bp->max_ring_grps = rte_le_to_cpu_32(resp->max_hw_ring_grps);
-		bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs);
+		/* func_resource_qcaps does not return max_rx_em_flows.
+		 * So use the value provided by func_qcaps.
+		 */
+		bp->max_l2_ctx =
+			rte_le_to_cpu_16(resp->max_l2_ctxs) +
+			bp->max_rx_em_flows;
 		bp->max_vnics = rte_le_to_cpu_16(resp->max_vnics);
 		bp->max_stat_ctx = rte_le_to_cpu_16(resp->max_stat_ctx);
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 09/15] net/bnxt: nq doorbell cleanups
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (7 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 08/15] net/bnxt: save the number of EM flow count Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 10/15] net/bnxt: avoid null pointer dereference Ajit Khaparde
                     ` (6 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson

From: Lance Richardson <lance.richardson@broadcom.com>

Simplify nq doorbell handling code by removing redundant db
parameter and consolidating NQ doorbell macro into the inline
function that uses it.

Add "enable interrupt" variant of nq write. This will be used
in a subsequent commit.

When initializing nq doorbell, don't assume that only the
"disable interrupt" form will be used.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h      |  1 +
 drivers/net/bnxt/bnxt_ring.c |  2 +-
 drivers/net/bnxt/bnxt_ring.h | 23 ++++++++++++++++++-----
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index cd809b385..3ccf784e5 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -246,6 +246,7 @@ struct bnxt_coal {
 #define DBR_TYPE_SRQ				(0x2ULL << 60)
 #define DBR_TYPE_CQ				(0x4ULL << 60)
 #define DBR_TYPE_NQ				(0xaULL << 60)
+#define DBR_TYPE_NQ_ARM				(0xbULL << 60)
 
 #define BNXT_RSS_TBL_SIZE_THOR		512
 #define BNXT_RSS_ENTRIES_PER_CTX_THOR	64
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 9b19459b6..faf861cc1 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -341,7 +341,7 @@ static void bnxt_set_db(struct bnxt *bp,
 			db->db_key64 = DBR_PATH_L2 | DBR_TYPE_CQ;
 			break;
 		case HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ:
-			db->db_key64 = DBR_PATH_L2 | DBR_TYPE_NQ;
+			db->db_key64 = DBR_PATH_L2;
 			break;
 		}
 		db->db_key64 |= (uint64_t)fid << DBR_XID_SFT;
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index af2c5762f..e5cef3a1d 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -84,15 +84,28 @@ static inline void bnxt_db_write(struct bnxt_db_info *db, uint32_t idx)
 		rte_write32(db->db_key32 | idx, db->doorbell);
 }
 
+/* Ring an NQ doorbell and disable interrupts for the ring. */
 static inline void bnxt_db_nq(struct bnxt_cp_ring_info *cpr)
 {
-	struct bnxt_db_info *db = &cpr->cp_db;
+	if (unlikely(!cpr->cp_db.db_64))
+		return;
+
+	rte_smp_wmb();
+	rte_write64(cpr->cp_db.db_key64 | DBR_TYPE_NQ |
+		    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
+		    cpr->cp_db.doorbell);
+}
+
+/* Ring an NQ doorbell and enable interrupts for the ring. */
+static inline void bnxt_db_nq_arm(struct bnxt_cp_ring_info *cpr)
+{
+	if (unlikely(!cpr->cp_db.db_64))
+		return;
 
 	rte_smp_wmb();
-	if (likely(db->db_64))
-		rte_write64(db->db_key64 | DBR_TYPE_NQ |
-			    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
-			    db->doorbell);
+	rte_write64(cpr->cp_db.db_key64 | DBR_TYPE_NQ_ARM |
+		    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
+		    cpr->cp_db.doorbell);
 }
 
 static inline void bnxt_db_cq(struct bnxt_cp_ring_info *cpr)
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 10/15] net/bnxt: avoid null pointer dereference
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (8 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 09/15] net/bnxt: nq doorbell cleanups Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 11/15] net/bnxt: fix to enable disable interrupts correctly in start stop Ajit Khaparde
                     ` (5 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson

From: Lance Richardson <lance.richardson@broadcom.com>

Avoid null pointer dereference when allocating an insolated
completion ring by basing nq ring allocation on whether an
nq ring was requested instead of whether the device supports
nq rings.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index faf861cc1..ada748c05 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -280,7 +280,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
 	}
 	cp_ring_info->hw_stats_ctx_id = HWRM_NA_SIGNATURE;
 
-	if (BNXT_HAS_NQ(bp)) {
+	if (nq_ring_info) {
 		struct bnxt_ring *nq_ring = nq_ring_info->cp_ring_struct;
 
 		nq_ring->bd = (char *)mz->addr + nq_ring_start;
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 11/15] net/bnxt: fix to enable disable interrupts correctly in start stop
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (9 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 10/15] net/bnxt: avoid null pointer dereference Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path Ajit Khaparde
                     ` (4 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, Somnath Kotur

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

1. disable interrupts in dev_stop_op()
2. enable interrupts in dev_start_op()
3. Clean queue intr-vector mapping in dev_stop_op() and thus
   fix a possible memory leak.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 17 ++++++++++++++++-
 drivers/net/bnxt/bnxt_irq.c    |  2 --
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 40a57bb23..292b7c3d1 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -779,6 +779,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 
 	eth_dev->rx_pkt_burst = bnxt_receive_function(eth_dev);
 	eth_dev->tx_pkt_burst = bnxt_transmit_function(eth_dev);
+	bnxt_enable_int(bp);
 	bp->flags |= BNXT_FLAG_INIT_DONE;
 	return 0;
 
@@ -818,6 +819,13 @@ static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
 static void bnxt_dev_stop_op(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);
+	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
+
+	bnxt_disable_int(bp);
+
+	/* disable uio/vfio intr/eventfd mapping */
+	rte_intr_disable(intr_handle);
 
 	bp->flags &= ~BNXT_FLAG_INIT_DONE;
 	if (bp->eth_dev->data->dev_started) {
@@ -825,6 +833,14 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 		eth_dev->data->dev_link.link_status = 0;
 	}
 	bnxt_set_hwrm_link_config(bp, false);
+
+	/* Clean queue intr-vector mapping */
+	rte_intr_efd_disable(intr_handle);
+	if (intr_handle->intr_vec != NULL) {
+		rte_free(intr_handle->intr_vec);
+		intr_handle->intr_vec = NULL;
+	}
+
 	bnxt_hwrm_port_clr_stats(bp);
 	bnxt_free_tx_mbufs(bp);
 	bnxt_free_rx_mbufs(bp);
@@ -3991,7 +4007,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 	if (rc)
 		goto error_free_int;
 
-	bnxt_enable_int(bp);
 	bnxt_init_nic(bp);
 
 	return 0;
diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 61f7498a5..6c4dce401 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -58,7 +58,6 @@ void bnxt_free_int(struct bnxt *bp)
 	irq = bp->irq_tbl;
 	if (irq) {
 		if (irq->requested) {
-			rte_intr_disable(&bp->pdev->intr_handle);
 			rte_intr_callback_unregister(&bp->pdev->intr_handle,
 						     irq->handler,
 						     (void *)bp->eth_dev);
@@ -123,7 +122,6 @@ int bnxt_request_int(struct bnxt *bp)
 
 	rte_intr_callback_register(&bp->pdev->intr_handle, irq->handler,
 				   (void *)bp->eth_dev);
-	rte_intr_enable(&bp->pdev->intr_handle);
 
 	irq->requested = 1;
 	return rc;
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (10 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 11/15] net/bnxt: fix to enable disable interrupts correctly in start stop Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
                     ` (3 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, Somnath Kotur

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

The cleanup/rollback operation post rte_eth_dev_start failure might end
up invoking an HWRM cmd even on an invalid vNIC resulting in error
messages being logged needlessly.
Fix to check for the same before issuing the HWRM cmd.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 84cda5e6c..1a0265f8a 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2325,6 +2325,11 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp)
 	for (i = bp->nr_vnics - 1; i >= 0; i--) {
 		struct bnxt_vnic_info *vnic = &bp->vnic_info[i];
 
+		if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+			PMD_DRV_LOG(DEBUG, "Invalid vNIC ID\n");
+			return;
+		}
+
 		bnxt_clear_hwrm_vnic_flows(bp, vnic);
 
 		bnxt_clear_hwrm_vnic_filters(bp, vnic);
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 13/15] net/bnxt: fix a compilation warning
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (11 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled Ajit Khaparde
                     ` (2 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Rahul Gupta

Compiler complains of an uninitialized variable.
Initializing it to avoid the issue.

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 1a0265f8a..a4e0c2e0c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1523,8 +1523,8 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 	int rc = 0;
 	struct hwrm_vnic_cfg_input req = {.req_type = 0 };
 	struct hwrm_vnic_cfg_output *resp = bp->hwrm_cmd_resp_addr;
+	struct bnxt_plcmodes_cfg pmodes = { 0 };
 	uint32_t ctx_enable_flag = 0;
-	struct bnxt_plcmodes_cfg pmodes;
 	uint32_t enables = 0;
 
 	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (12 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware Ajit Khaparde
  2019-07-16 18:42   ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ferruh Yigit
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Qingmin Liu, Randy Schacher, Somnath Kotur

From: Qingmin Liu <qingmin.liu@broadcom.com>

If ntuple filtering is disabled, FW will return max_vnics=1.
Due to this only single Rxq is created.
Change to max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx) to
fix it.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")
Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Tested-by: Qingmin Liu <qingmin.liu@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 292b7c3d1..0b3999d12 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -493,7 +493,7 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	/* PF/VF specifics */
 	if (BNXT_PF(bp))
 		dev_info->max_vfs = bp->pdev->max_vfs;
-	max_rx_rings = RTE_MIN(bp->max_vnics, bp->max_stat_ctx);
+	max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx);
 	/* For the sake of symmetry, max_rx_queues = max_tx_queues */
 	dev_info->max_rx_queues = max_rx_rings;
 	dev_info->max_tx_queues = max_rx_rings;
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v2 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (13 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled Ajit Khaparde
@ 2019-07-16  9:28   ` Ajit Khaparde
  2019-07-16 18:42   ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ferruh Yigit
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-16  9:28 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Jay Ding, Randy Schacher

From: Jay Ding <jay.ding@broadcom.com>

Add checking for vinc id before sending message to chimp in
bnxt_hwrm_vnic_plcmode_cfg().

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a4e0c2e0c..313459aaf 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1497,6 +1497,11 @@ static int bnxt_hwrm_vnic_plcmodes_cfg(struct bnxt *bp,
 	struct hwrm_vnic_plcmodes_cfg_input req = {.req_type = 0 };
 	struct hwrm_vnic_plcmodes_cfg_output *resp = bp->hwrm_cmd_resp_addr;
 
+	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+		PMD_DRV_LOG(DEBUG, "VNIC ID %x\n", vnic->fw_vnic_id);
+		return rc;
+	}
+
 	HWRM_PREP(req, VNIC_PLCMODES_CFG, BNXT_USE_CHIMP_MB);
 
 	req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [dpdk-dev] [PATCH v2 00/15] bnxt patch series
  2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
                     ` (14 preceding siblings ...)
  2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware Ajit Khaparde
@ 2019-07-16 18:42   ` Ferruh Yigit
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
  15 siblings, 1 reply; 54+ messages in thread
From: Ferruh Yigit @ 2019-07-16 18:42 UTC (permalink / raw)
  To: Ajit Khaparde, dev

On 7/16/2019 10:28 AM, Ajit Khaparde wrote:
> Patchset fixing various bugs in bnxt PMD based on recent patch submission.
> https://patchwork.dpdk.org/patch/56311/
> Please apply.
> 
> Note this patchset supersedes the previous patch series:
> https://patchwork.dpdk.org/project/dpdk/list/?series=5464
> 
> Ajit Khaparde (3):
>   net/bnxt: fix for doorbell register offset for Tx ring.
>   net/bnxt: save the number of EM flow count
>   net/bnxt: fix a compilation warning
> 
> Jay Ding (1):
>   net/bnxt: fix to avoid sending invalid VNIC id to firmware
> 
> Kalesh AP (5):
>   net/bnxt: fix extended port counter statistics
>   net/bnxt: fix possible segfault in case of probe failure
>   net/bnxt: do not fail VF probe when the MAC address is zero
>   net/bnxt: fix to enable disable interrupts correctly in start stop
>   net/bnxt: fix to check for invalid VNIC in cleanup path
> 
> Lance Richardson (4):
>   net/bnxt: fix Tx hang after port stop/start
>   net/bnxt: reset Rx allocation state on port restart
>   net/bnxt: nq doorbell cleanups
>   net/bnxt: avoid null pointer dereference
> 
> Qingmin Liu (1):
>   net/bnxt: fix rxq count if ntuple filtering is disabled
> 
> Rahul Gupta (1):
>   net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel
>     packets

Can you please check 'check-git-log.sh' warnings:

./devtools/check-git-log.sh -15
Wrong headline format:
        net/bnxt: fix for doorbell register offset for Tx ring.
Headline too long:
        net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets
        net/bnxt: fix to enable disable interrupts correctly in start stop
Wrong tag:
        Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags)
Wrong 'Fixes' reference:
        Fixes: af3ed597e305 ("net/bnxt: initial vector-mode driver")
        Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags)
Is it candidate for Cc: stable@dpdk.org backport?
        net/bnxt: fix extended port counter statistics
        net/bnxt: fix possible segfault in case of probe failure
        net/bnxt: do not fail VF probe when the MAC address is zero
        net/bnxt: fix Tx hang after port stop/start
        net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets
        net/bnxt: fix for doorbell register offset for Tx ring.
        net/bnxt: save the number of EM flow count
        net/bnxt: fix to enable disable interrupts correctly in start stop
        net/bnxt: fix to check for invalid VNIC in cleanup path
        net/bnxt: fix a compilation warning
        net/bnxt: fix rxq count if ntuple filtering is disabled
        net/bnxt: fix to avoid sending invalid VNIC id to firmware

^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 00/15] bnxt patch series
  2019-07-16 18:42   ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ferruh Yigit
@ 2019-07-17 10:41     ` " Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
                         ` (15 more replies)
  0 siblings, 16 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

Patchset fixing various bugs in bnxt PMD based on recent commit:
1e101412320061a4a1cd47db4227b4f8a163e9f6

Ajit Khaparde (3):
  net/bnxt: fix for doorbell register offset for Tx ring
  net/bnxt: save the number of EM flow count
  net/bnxt: fix a compilation warning

Jay Ding (1):
  net/bnxt: fix to avoid sending invalid VNIC id to firmware

Kalesh AP (5):
  net/bnxt: fix extended port counter statistics
  net/bnxt: fix possible segfault in case of probe failure
  net/bnxt: do not fail VF probe when the MAC address is zero
  net/bnxt: fix to enable disable interrupts correctly
  net/bnxt: fix to check for invalid VNIC in cleanup path

Lance Richardson (4):
  net/bnxt: fix Tx hang after port stop/start
  net/bnxt: reset Rx allocation state on port restart
  net/bnxt: nq doorbell cleanups
  net/bnxt: avoid null pointer dereference

Qingmin Liu (1):
  net/bnxt: fix rxq count if ntuple filtering is disabled

Rahul Gupta (1):
  net/bnxt: fix L4 checksum error indication in Rx path

 drivers/net/bnxt/bnxt.h        |   3 +
 drivers/net/bnxt/bnxt_ethdev.c | 307 +++++++++++++++++++--------------
 drivers/net/bnxt/bnxt_hwrm.c   |  56 +++++-
 drivers/net/bnxt/bnxt_hwrm.h   |   1 +
 drivers/net/bnxt/bnxt_irq.c    |   5 +-
 drivers/net/bnxt/bnxt_ring.c   |  11 +-
 drivers/net/bnxt/bnxt_ring.h   |  23 ++-
 drivers/net/bnxt/bnxt_rxq.c    |   4 -
 drivers/net/bnxt/bnxt_rxr.c    |  43 +++--
 drivers/net/bnxt/bnxt_rxr.h    | 120 ++++++++++---
 drivers/net/bnxt/bnxt_util.c   |  11 ++
 drivers/net/bnxt/bnxt_util.h   |   1 +
 drivers/net/bnxt/bnxt_vnic.c   |   3 +
 13 files changed, 409 insertions(+), 179 deletions(-)

-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 01/15] net/bnxt: fix extended port counter statistics
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 02/15] net/bnxt: fix possible segfault in case of probe failure Ajit Khaparde
                         ` (14 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Ajit Kumar Khaparde

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

1. refactor stats allocation code to new routine
2. check for extended statistics support depends on "hwrm_spec_code"
   which is set in bnxt_hwrm_ver_get called later. Hence we were never
   querying extended port stats as flags field was not updated. Fixed
   this by moving the stats allocation after the call to
   bnxt_hwrm_ver_get.
3. we were incorrectly passing the host address used for port
   statistics to PORT_QSTATS_EXT command. Fixed this by passing the
   correct extended stats address.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
--
v1->v2: Use PCI_PRI_FMT to format PCI address.
---
 drivers/net/bnxt/bnxt.h        |   1 +
 drivers/net/bnxt/bnxt_ethdev.c | 226 +++++++++++++++++----------------
 drivers/net/bnxt/bnxt_hwrm.c   |   7 +-
 3 files changed, 125 insertions(+), 109 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 942da7ff0..45e7359b2 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -350,6 +350,7 @@ struct bnxt {
 #define BNXT_FLAG_TRUSTED_VF_EN	(1 << 11)
 #define BNXT_FLAG_DFLT_VNIC_SET	(1 << 12)
 #define BNXT_FLAG_THOR_CHIP	(1 << 13)
+#define BNXT_FLAG_EXT_STATS_SUPPORTED	(1 << 29)
 #define BNXT_FLAG_NEW_RM	(1 << 30)
 #define BNXT_FLAG_INIT_DONE	(1U << 31)
 #define BNXT_PF(bp)		(!((bp)->flags & BNXT_FLAG_VF))
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 14b69a480..da0486c62 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3639,6 +3639,120 @@ int bnxt_alloc_ctx_mem(struct bnxt *bp)
 	return 0;
 }
 
+static int bnxt_alloc_stats_mem(struct bnxt *bp)
+{
+	struct rte_pci_device *pci_dev = bp->pdev;
+	char mz_name[RTE_MEMZONE_NAMESIZE];
+	const struct rte_memzone *mz = NULL;
+	uint32_t total_alloc_len;
+	rte_iova_t mz_phys_addr;
+
+	if (pci_dev->id.device_id == BROADCOM_DEV_ID_NS2)
+		return 0;
+
+	snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
+		 "bnxt_" PCI_PRI_FMT "-%s", pci_dev->addr.domain,
+		 pci_dev->addr.bus, pci_dev->addr.devid,
+		 pci_dev->addr.function, "rx_port_stats");
+	mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
+	mz = rte_memzone_lookup(mz_name);
+	total_alloc_len =
+		RTE_CACHE_LINE_ROUNDUP(sizeof(struct rx_port_stats) +
+				       sizeof(struct rx_port_stats_ext) + 512);
+	if (!mz) {
+		mz = rte_memzone_reserve(mz_name, total_alloc_len,
+					 SOCKET_ID_ANY,
+					 RTE_MEMZONE_2MB |
+					 RTE_MEMZONE_SIZE_HINT_ONLY |
+					 RTE_MEMZONE_IOVA_CONTIG);
+		if (mz == NULL)
+			return -ENOMEM;
+	}
+	memset(mz->addr, 0, mz->len);
+	mz_phys_addr = mz->iova;
+	if ((unsigned long)mz->addr == mz_phys_addr) {
+		PMD_DRV_LOG(WARNING,
+			    "Memzone physical address same as virtual.\n");
+		PMD_DRV_LOG(WARNING,
+			    "Using rte_mem_virt2iova()\n");
+		mz_phys_addr = rte_mem_virt2iova(mz->addr);
+		if (mz_phys_addr == 0) {
+			PMD_DRV_LOG(ERR,
+				    "Can't map address to physical memory\n");
+			return -ENOMEM;
+		}
+	}
+
+	bp->rx_mem_zone = (const void *)mz;
+	bp->hw_rx_port_stats = mz->addr;
+	bp->hw_rx_port_stats_map = mz_phys_addr;
+
+	snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
+		 "bnxt_" PCI_PRI_FMT "-%s", pci_dev->addr.domain,
+		 pci_dev->addr.bus, pci_dev->addr.devid,
+		 pci_dev->addr.function, "tx_port_stats");
+	mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
+	mz = rte_memzone_lookup(mz_name);
+	total_alloc_len =
+		RTE_CACHE_LINE_ROUNDUP(sizeof(struct tx_port_stats) +
+				       sizeof(struct tx_port_stats_ext) + 512);
+	if (!mz) {
+		mz = rte_memzone_reserve(mz_name,
+					 total_alloc_len,
+					 SOCKET_ID_ANY,
+					 RTE_MEMZONE_2MB |
+					 RTE_MEMZONE_SIZE_HINT_ONLY |
+					 RTE_MEMZONE_IOVA_CONTIG);
+		if (mz == NULL)
+			return -ENOMEM;
+	}
+	memset(mz->addr, 0, mz->len);
+	mz_phys_addr = mz->iova;
+	if ((unsigned long)mz->addr == mz_phys_addr) {
+		PMD_DRV_LOG(WARNING,
+			    "Memzone physical address same as virtual\n");
+		PMD_DRV_LOG(WARNING,
+			    "Using rte_mem_virt2iova()\n");
+		mz_phys_addr = rte_mem_virt2iova(mz->addr);
+		if (mz_phys_addr == 0) {
+			PMD_DRV_LOG(ERR,
+				    "Can't map address to physical memory\n");
+			return -ENOMEM;
+		}
+	}
+
+	bp->tx_mem_zone = (const void *)mz;
+	bp->hw_tx_port_stats = mz->addr;
+	bp->hw_tx_port_stats_map = mz_phys_addr;
+	bp->flags |= BNXT_FLAG_PORT_STATS;
+
+	/* Display extended statistics if FW supports it */
+	if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_8_4 ||
+	    bp->hwrm_spec_code == HWRM_SPEC_CODE_1_9_0 ||
+	    !(bp->flags & BNXT_FLAG_EXT_STATS_SUPPORTED))
+		return 0;
+
+	bp->hw_rx_port_stats_ext = (void *)
+		((uint8_t *)bp->hw_rx_port_stats +
+		 sizeof(struct rx_port_stats));
+	bp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map +
+		sizeof(struct rx_port_stats);
+	bp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS;
+
+	if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2 ||
+	    bp->flags & BNXT_FLAG_EXT_STATS_SUPPORTED) {
+		bp->hw_tx_port_stats_ext = (void *)
+			((uint8_t *)bp->hw_tx_port_stats +
+			 sizeof(struct tx_port_stats));
+		bp->hw_tx_port_stats_ext_map =
+			bp->hw_tx_port_stats_map +
+			sizeof(struct tx_port_stats);
+		bp->flags |= BNXT_FLAG_EXT_TX_PORT_STATS;
+	}
+
+	return 0;
+}
+
 #define ALLOW_FUNC(x)	\
 	{ \
 		uint32_t arg = (x); \
@@ -3649,11 +3763,7 @@ static int
 bnxt_dev_init(struct rte_eth_dev *eth_dev)
 {
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
-	char mz_name[RTE_MEMZONE_NAMESIZE];
-	const struct rte_memzone *mz = NULL;
 	static int version_printed;
-	uint32_t total_alloc_len;
-	rte_iova_t mz_phys_addr;
 	struct bnxt *bp;
 	uint16_t mtu;
 	int rc;
@@ -3692,109 +3802,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
-	if (pci_dev->id.device_id != BROADCOM_DEV_ID_NS2) {
-		snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
-			 "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
-			 pci_dev->addr.bus, pci_dev->addr.devid,
-			 pci_dev->addr.function, "rx_port_stats");
-		mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
-		mz = rte_memzone_lookup(mz_name);
-		total_alloc_len = RTE_CACHE_LINE_ROUNDUP(
-					sizeof(struct rx_port_stats) +
-					sizeof(struct rx_port_stats_ext) +
-					512);
-		if (!mz) {
-			mz = rte_memzone_reserve(mz_name, total_alloc_len,
-					SOCKET_ID_ANY,
-					RTE_MEMZONE_2MB |
-					RTE_MEMZONE_SIZE_HINT_ONLY |
-					RTE_MEMZONE_IOVA_CONTIG);
-			if (mz == NULL)
-				return -ENOMEM;
-		}
-		memset(mz->addr, 0, mz->len);
-		mz_phys_addr = mz->iova;
-		if ((unsigned long)mz->addr == mz_phys_addr) {
-			PMD_DRV_LOG(INFO,
-				"Memzone physical address same as virtual using rte_mem_virt2iova()\n");
-			mz_phys_addr = rte_mem_virt2iova(mz->addr);
-			if (mz_phys_addr == 0) {
-				PMD_DRV_LOG(ERR,
-				"unable to map address to physical memory\n");
-				return -ENOMEM;
-			}
-		}
-
-		bp->rx_mem_zone = (const void *)mz;
-		bp->hw_rx_port_stats = mz->addr;
-		bp->hw_rx_port_stats_map = mz_phys_addr;
-
-		snprintf(mz_name, RTE_MEMZONE_NAMESIZE,
-			 "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain,
-			 pci_dev->addr.bus, pci_dev->addr.devid,
-			 pci_dev->addr.function, "tx_port_stats");
-		mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0;
-		mz = rte_memzone_lookup(mz_name);
-		total_alloc_len = RTE_CACHE_LINE_ROUNDUP(
-					sizeof(struct tx_port_stats) +
-					sizeof(struct tx_port_stats_ext) +
-					512);
-		if (!mz) {
-			mz = rte_memzone_reserve(mz_name,
-					total_alloc_len,
-					SOCKET_ID_ANY,
-					RTE_MEMZONE_2MB |
-					RTE_MEMZONE_SIZE_HINT_ONLY |
-					RTE_MEMZONE_IOVA_CONTIG);
-			if (mz == NULL)
-				return -ENOMEM;
-		}
-		memset(mz->addr, 0, mz->len);
-		mz_phys_addr = mz->iova;
-		if ((unsigned long)mz->addr == mz_phys_addr) {
-			PMD_DRV_LOG(WARNING,
-				"Memzone physical address same as virtual.\n");
-			PMD_DRV_LOG(WARNING,
-				"Using rte_mem_virt2iova()\n");
-			mz_phys_addr = rte_mem_virt2iova(mz->addr);
-			if (mz_phys_addr == 0) {
-				PMD_DRV_LOG(ERR,
-				"unable to map address to physical memory\n");
-				return -ENOMEM;
-			}
-		}
-
-		bp->tx_mem_zone = (const void *)mz;
-		bp->hw_tx_port_stats = mz->addr;
-		bp->hw_tx_port_stats_map = mz_phys_addr;
-
-		bp->flags |= BNXT_FLAG_PORT_STATS;
-
-		/* Display extended statistics if FW supports it */
-		if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_8_4 ||
-		    bp->hwrm_spec_code == HWRM_SPEC_CODE_1_9_0)
-			goto skip_ext_stats;
-
-		bp->hw_rx_port_stats_ext = (void *)
-			((uint8_t *)bp->hw_rx_port_stats +
-			 sizeof(struct rx_port_stats));
-		bp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map +
-			sizeof(struct rx_port_stats);
-		bp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS;
-
-
-		if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2) {
-			bp->hw_tx_port_stats_ext = (void *)
-				((uint8_t *)bp->hw_tx_port_stats +
-				 sizeof(struct tx_port_stats));
-			bp->hw_tx_port_stats_ext_map =
-				bp->hw_tx_port_stats_map +
-				sizeof(struct tx_port_stats);
-			bp->flags |= BNXT_FLAG_EXT_TX_PORT_STATS;
-		}
-	}
-
-skip_ext_stats:
 	rc = bnxt_alloc_hwrm_resources(bp);
 	if (rc) {
 		PMD_DRV_LOG(ERR,
@@ -3823,6 +3830,11 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		PMD_DRV_LOG(ERR, "hwrm query capability failure rc: %x\n", rc);
 		goto error_free;
 	}
+
+	rc = bnxt_alloc_stats_mem(bp);
+	if (rc)
+		goto error_free;
+
 	if (bp->max_tx_rings == 0) {
 		PMD_DRV_LOG(ERR, "No TX rings available!\n");
 		rc = -EBUSY;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 8f0d33dca..f691922bd 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -611,6 +611,9 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 		}
 	}
 
+	if (flags & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_STATS_SUPPORTED)
+		bp->flags |= BNXT_FLAG_EXT_STATS_SUPPORTED;
+
 	HWRM_UNLOCK();
 
 	return rc;
@@ -4495,13 +4498,13 @@ int bnxt_hwrm_ext_port_qstats(struct bnxt *bp)
 	req.port_id = rte_cpu_to_le_16(pf->port_id);
 	if (bp->flags & BNXT_FLAG_EXT_TX_PORT_STATS) {
 		req.tx_stat_host_addr =
-			rte_cpu_to_le_64(bp->hw_tx_port_stats_map);
+			rte_cpu_to_le_64(bp->hw_tx_port_stats_ext_map);
 		req.tx_stat_size =
 			rte_cpu_to_le_16(sizeof(struct tx_port_stats_ext));
 	}
 	if (bp->flags & BNXT_FLAG_EXT_RX_PORT_STATS) {
 		req.rx_stat_host_addr =
-			rte_cpu_to_le_64(bp->hw_rx_port_stats_map);
+			rte_cpu_to_le_64(bp->hw_rx_port_stats_ext_map);
 		req.rx_stat_size =
 			rte_cpu_to_le_16(sizeof(struct rx_port_stats_ext));
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 02/15] net/bnxt: fix possible segfault in case of probe failure
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 03/15] net/bnxt: do not fail VF probe when the MAC address is zero Ajit Khaparde
                         ` (13 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, stable

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Fixed couple of possible segfaults due to NULL pointer
dereference in case of probe failure.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_irq.c  | 3 +++
 drivers/net/bnxt/bnxt_vnic.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 0bb3eb4fa..61f7498a5 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -52,6 +52,9 @@ void bnxt_free_int(struct bnxt *bp)
 {
 	struct bnxt_irq *irq;
 
+	if (bp->irq_tbl == NULL)
+		return;
+
 	irq = bp->irq_tbl;
 	if (irq) {
 		if (irq->requested) {
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 262cfc18d..20e5bf2d1 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -89,6 +89,9 @@ void bnxt_free_vnic_attributes(struct bnxt *bp)
 	struct bnxt_vnic_info *vnic;
 	unsigned int i;
 
+	if (bp->vnic_info == NULL)
+		return;
+
 	for (i = 0; i < bp->max_vnics; i++) {
 		vnic = &bp->vnic_info[i];
 		if (vnic->rss_table) {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 03/15] net/bnxt: do not fail VF probe when the MAC address is zero
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 02/15] net/bnxt: fix possible segfault in case of probe failure Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 04/15] net/bnxt: fix Tx hang after port stop/start Ajit Khaparde
                         ` (12 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, stable

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

VF driver should not fail probe if the host PF driver has not assigned
any MAC address for the VF. It should generate a random MAC address and
configure the MAC and then continue probing the device.

Fixes: be160484a48d ("net/bnxt: check if MAC address is all zeros")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 62 +++++++++++++++++++++++-----------
 drivers/net/bnxt/bnxt_hwrm.c   | 25 ++++++++++++++
 drivers/net/bnxt/bnxt_hwrm.h   |  1 +
 drivers/net/bnxt/bnxt_util.c   | 11 ++++++
 drivers/net/bnxt/bnxt_util.h   |  1 +
 5 files changed, 80 insertions(+), 20 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index da0486c62..e44df1881 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3753,6 +3753,46 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
 	return 0;
 }
 
+static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev)
+{
+	struct bnxt *bp = eth_dev->data->dev_private;
+	int rc = 0;
+
+	eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
+					       RTE_ETHER_ADDR_LEN *
+					       bp->max_l2_ctx,
+					       0);
+	if (eth_dev->data->mac_addrs == NULL) {
+		PMD_DRV_LOG(ERR, "Failed to alloc MAC addr tbl\n");
+		return -ENOMEM;
+	}
+
+	if (bnxt_check_zero_bytes(bp->dflt_mac_addr, RTE_ETHER_ADDR_LEN)) {
+		if (BNXT_PF(bp))
+			return -EINVAL;
+
+		/* Generate a random MAC address, if none was assigned by PF */
+		PMD_DRV_LOG(INFO, "VF MAC address not assigned by Host PF\n");
+		bnxt_eth_hw_addr_random(bp->mac_addr);
+		PMD_DRV_LOG(INFO,
+			    "Assign random MAC:%02X:%02X:%02X:%02X:%02X:%02X\n",
+			    bp->mac_addr[0], bp->mac_addr[1], bp->mac_addr[2],
+			    bp->mac_addr[3], bp->mac_addr[4], bp->mac_addr[5]);
+
+		rc = bnxt_hwrm_set_mac(bp);
+		if (!rc)
+			memcpy(&bp->eth_dev->data->mac_addrs[0], bp->mac_addr,
+			       RTE_ETHER_ADDR_LEN);
+		return rc;
+	}
+
+	/* Copy the permanent MAC from the FUNC_QCAPS response */
+	memcpy(bp->mac_addr, bp->dflt_mac_addr, RTE_ETHER_ADDR_LEN);
+	memcpy(&eth_dev->data->mac_addrs[0], bp->mac_addr, RTE_ETHER_ADDR_LEN);
+
+	return rc;
+}
+
 #define ALLOW_FUNC(x)	\
 	{ \
 		uint32_t arg = (x); \
@@ -3840,28 +3880,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		rc = -EBUSY;
 		goto error_free;
 	}
-	eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl",
-					RTE_ETHER_ADDR_LEN * bp->max_l2_ctx, 0);
-	if (eth_dev->data->mac_addrs == NULL) {
-		PMD_DRV_LOG(ERR,
-			"Failed to alloc %u bytes needed to store MAC addr tbl",
-			RTE_ETHER_ADDR_LEN * bp->max_l2_ctx);
-		rc = -ENOMEM;
-		goto error_free;
-	}
 
-	if (bnxt_check_zero_bytes(bp->dflt_mac_addr, RTE_ETHER_ADDR_LEN)) {
-		PMD_DRV_LOG(ERR,
-			    "Invalid MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n",
-			    bp->dflt_mac_addr[0], bp->dflt_mac_addr[1],
-			    bp->dflt_mac_addr[2], bp->dflt_mac_addr[3],
-			    bp->dflt_mac_addr[4], bp->dflt_mac_addr[5]);
-		rc = -EINVAL;
+	rc = bnxt_setup_mac_addr(eth_dev);
+	if (rc)
 		goto error_free;
-	}
-	/* Copy the permanent MAC from the qcap response address now. */
-	memcpy(bp->mac_addr, bp->dflt_mac_addr, sizeof(bp->mac_addr));
-	memcpy(&eth_dev->data->mac_addrs[0], bp->mac_addr, RTE_ETHER_ADDR_LEN);
 
 	/* THOR does not support ring groups.
 	 * But we will use the array to save RSS context IDs.
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index f691922bd..a9356c6b8 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -4607,3 +4607,28 @@ int bnxt_hwrm_tunnel_redirect_info(struct bnxt *bp, uint8_t tun_type,
 
 	return rc;
 }
+
+int bnxt_hwrm_set_mac(struct bnxt *bp)
+{
+	struct hwrm_func_vf_cfg_output *resp = bp->hwrm_cmd_resp_addr;
+	struct hwrm_func_vf_cfg_input req = {0};
+	int rc = 0;
+
+	if (!BNXT_VF(bp))
+		return 0;
+
+	HWRM_PREP(req, FUNC_VF_CFG, BNXT_USE_CHIMP_MB);
+
+	req.enables =
+		rte_cpu_to_le_32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR);
+	memcpy(req.dflt_mac_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN);
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+
+	HWRM_CHECK_RESULT();
+
+	memcpy(bp->dflt_mac_addr, bp->mac_addr, RTE_ETHER_ADDR_LEN);
+	HWRM_UNLOCK();
+
+	return rc;
+}
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index e35462cb4..37aaa1a9e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -196,4 +196,5 @@ int bnxt_hwrm_tunnel_redirect_free(struct bnxt *bp, uint8_t type);
 int bnxt_hwrm_tunnel_redirect_query(struct bnxt *bp, uint32_t *type);
 int bnxt_hwrm_tunnel_redirect_info(struct bnxt *bp, uint8_t tun_type,
 				   uint16_t *dst_fid);
+int bnxt_hwrm_set_mac(struct bnxt *bp);
 #endif
diff --git a/drivers/net/bnxt/bnxt_util.c b/drivers/net/bnxt/bnxt_util.c
index 7d3342719..dda40af28 100644
--- a/drivers/net/bnxt/bnxt_util.c
+++ b/drivers/net/bnxt/bnxt_util.c
@@ -4,6 +4,7 @@
  */
 
 #include <inttypes.h>
+#include <rte_ether.h>
 
 #include "bnxt_util.h"
 
@@ -16,3 +17,13 @@ int bnxt_check_zero_bytes(const uint8_t *bytes, int len)
 			return 0;
 	return 1;
 }
+
+void bnxt_eth_hw_addr_random(uint8_t *mac_addr)
+{
+	rte_eth_random_addr(mac_addr);
+
+	/* Set Organizationally Unique Identifier (OUI) prefix */
+	mac_addr[0] = 0x00;
+	mac_addr[1] = 0x0a;
+	mac_addr[2] = 0xf7;
+}
diff --git a/drivers/net/bnxt/bnxt_util.h b/drivers/net/bnxt/bnxt_util.h
index 2378833cc..9f1868a78 100644
--- a/drivers/net/bnxt/bnxt_util.h
+++ b/drivers/net/bnxt/bnxt_util.h
@@ -7,5 +7,6 @@
 #define _BNXT_UTIL_H_
 
 int bnxt_check_zero_bytes(const uint8_t *bytes, int len);
+void bnxt_eth_hw_addr_random(uint8_t *mac_addr);
 
 #endif /* _BNXT_UTIL_H_ */
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 04/15] net/bnxt: fix Tx hang after port stop/start
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (2 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 03/15] net/bnxt: do not fail VF probe when the MAC address is zero Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
                         ` (11 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson, Kalesh Anakkur Purayil

From: Lance Richardson <lance.richardson@broadcom.com>

Initialize the state of the the completion valid indicator
when a completion ring is freed, otherwise completions may
not be processed when a new ring is allocated.

Fixes: 5735eb241947 ("net/bnxt: support Tx batching")
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a9356c6b8..b6f9ec0a0 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2089,6 +2089,7 @@ static void bnxt_free_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr)
 	memset(cpr->cp_desc_ring, 0, cpr->cp_ring_struct->ring_size *
 			sizeof(*cpr->cp_desc_ring));
 	cpr->cp_raw_cons = 0;
+	cpr->valid = 0;
 }
 
 void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index)
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 05/15] net/bnxt: reset Rx allocation state on port restart
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (3 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 04/15] net/bnxt: fix Tx hang after port stop/start Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 06/15] net/bnxt: fix L4 checksum error indication in Rx path Ajit Khaparde
                         ` (10 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson, Christopher Reder

From: Lance Richardson <lance.richardson@broadcom.com>

Move call site of bnxt_rxq_vec_setup() to ensure that rxq->rxrearm_nb
and rxq->rxrearm_start are reinitialized correctly when a port is
restarted.

Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode")
Reviewed-by: Christopher Reder <christopher.reder@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
--
v1->v2: Move bnxt_rxq_vec_setup under RTE_ARCH_X86.
---
 drivers/net/bnxt/bnxt_ring.c | 3 +++
 drivers/net/bnxt/bnxt_rxq.c  | 4 ----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 16327dbe9..7453d4b56 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -613,6 +613,9 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
 		bnxt_db_write(&rxr->rx_db, rxr->rx_prod);
 		bnxt_db_write(&rxr->ag_db, rxr->ag_prod);
 		rxq->index = i;
+#ifdef RTE_ARCH_X86
+		bnxt_rxq_vec_setup(rxq);
+#endif
 	}
 
 	for (i = 0; i < bp->tx_cp_nr_rings; i++) {
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index 6919acbb4..c94cac5a9 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -356,10 +356,6 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 	eth_dev->data->rx_queue_state[queue_idx] = queue_state;
 	rte_spinlock_init(&rxq->lock);
 
-#ifdef RTE_ARCH_X86
-	bnxt_rxq_vec_setup(rxq);
-#endif
-
 out:
 	return rc;
 }
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 06/15] net/bnxt: fix L4 checksum error indication in Rx path
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (4 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 07/15] net/bnxt: fix for doorbell register offset for Tx ring Ajit Khaparde
                         ` (9 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Rahul Gupta, stable

From: Rahul Gupta <rahul.gupta@broadcom.com>

Update ol_flags correctly for checksum errors in case of tunnel and
non-tunnel packet.

Fixes: 65ee636872eb ("net/bnxt: fix Rx checksum flags")
Cc: stable@dpdk.org

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
--
v1->v3: Fix check-git-log output.
---
 drivers/net/bnxt/bnxt_rxr.c |  43 ++++++++++---
 drivers/net/bnxt/bnxt_rxr.h | 120 ++++++++++++++++++++++++++++++------
 2 files changed, 133 insertions(+), 30 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 44303f3b0..54a2cf5fd 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -362,6 +362,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 	int rc = 0;
 	uint8_t agg_buf = 0;
 	uint16_t cmp_type;
+	uint32_t flags2_f = 0;
 
 	rxcmp = (struct rx_pkt_cmpl *)
 	    &cpr->cp_desc_ring[cp_cons];
@@ -440,19 +441,41 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 		mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
 	}
 
-	if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
-	else if (likely(RX_CMP_IP_CS_UNKNOWN(rxcmp1)))
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
-	else
+	flags2_f = flags2_0xf(rxcmp1);
+	/* IP Checksum */
+	if (unlikely(((IS_IP_NONTUNNEL_PKT(flags2_f)) &&
+		      (RX_CMP_IP_CS_ERROR(rxcmp1))) ||
+		     (IS_IP_TUNNEL_PKT(flags2_f) &&
+		      (RX_CMP_IP_OUTER_CS_ERROR(rxcmp1))))) {
 		mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
+	} else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) {
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
+	} else {
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
+	}
 
-	if (likely(RX_CMP_L4_CS_OK(rxcmp1)))
-		mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
-	else if (likely(RX_CMP_L4_CS_UNKNOWN(rxcmp1)))
+	/* L4 Checksum */
+	if (likely(IS_L4_NONTUNNEL_PKT(flags2_f))) {
+		if (unlikely(RX_CMP_L4_INNER_CS_ERR2(rxcmp1)))
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
+		else
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+	} else if (IS_L4_TUNNEL_PKT(flags2_f)) {
+		if (unlikely(RX_CMP_L4_INNER_CS_ERR2(rxcmp1)))
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
+		else
+			mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+		if (unlikely(RX_CMP_L4_OUTER_CS_ERR2(rxcmp1))) {
+			mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_BAD;
+		} else if (unlikely(IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS
+				    (flags2_f))) {
+			mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_UNKNOWN;
+		} else {
+			mbuf->ol_flags |= PKT_RX_OUTER_L4_CKSUM_GOOD;
+		}
+	} else if (unlikely(RX_CMP_L4_CS_UNKNOWN(rxcmp1))) {
 		mbuf->ol_flags |= PKT_RX_L4_CKSUM_UNKNOWN;
-	else
-		mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
+	}
 
 	mbuf->packet_type = bnxt_parse_pkt_type(rxcmp, rxcmp1);
 
diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index 6523b94c6..6a80c37c8 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -24,36 +24,116 @@
 #define BNXT_TPA_OUTER_L3_OFF(hdr_info)	\
 	((hdr_info) & 0x1ff)
 
-#define RX_CMP_L4_CS_BITS	\
-	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_L4_CS_CALC | \
-			 RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)
-
-#define RX_CMP_L4_CS_ERR_BITS	\
-	rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR | \
-			 RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR)
+#define flags2_0xf(rxcmp1)	\
+	(((rxcmp1)->flags2) & 0xf)
 
-#define RX_CMP_L4_CS_OK(rxcmp1)						\
-	    (((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS) &&		\
-	     !((rxcmp1)->errors_v2 & RX_CMP_L4_CS_ERR_BITS))
+/* IP non tunnel can be with or without L4-
+ * Ether / (vlan) / IP|IP6 / UDP|TCP|SCTP Or
+ * Ether / (vlan) / outer IP|IP6 / ICMP
+ * we use '==' instead of '&' because tunnel pkts have all 4 fields set.
+ */
+#define IS_IP_NONTUNNEL_PKT(flags2_f)	\
+	(	\
+	 ((flags2_f) == \
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC))) ||	\
+	 ((flags2_f) ==	\
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC | \
+			    RX_PKT_CMPL_FLAGS2_L4_CS_CALC))) \
+	)
+
+/* IP Tunnel pkt must have atleast tunnel-IP-calc set.
+ * again tunnel ie outer L4 is optional bcoz of
+ * Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
+ *           UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / Ether / IP|IP6 /
+ *           UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /
+ *           UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP
+ * also inner L3 chksum error is not taken into consideration by DPDK.
+ */
+#define IS_IP_TUNNEL_PKT(flags2_f)	\
+	((flags2_f) & rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC))
 
-#define RX_CMP_L4_CS_UNKNOWN(rxcmp1)					\
-	    !((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS)
+/* RX_PKT_CMPL_ERRORS_IP_CS_ERROR only for Non-tunnel pkts.
+ * For tunnel pkts RX_PKT_CMPL_ERRORS_IP_CS_ERROR is not accounted and treated
+ * as good csum pkt.
+ */
+#define RX_CMP_IP_CS_ERROR(rxcmp1)	\
+	((rxcmp1)->errors_v2 &	\
+	 rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR))
 
-#define RX_CMP_IP_CS_ERR_BITS	\
-	rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_IP_CS_ERROR | \
-			 RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR)
+#define RX_CMP_IP_OUTER_CS_ERROR(rxcmp1)	\
+	((rxcmp1)->errors_v2 &	\
+	 rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_T_IP_CS_ERROR))
 
 #define RX_CMP_IP_CS_BITS	\
 	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC | \
 			 RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC)
 
-#define RX_CMP_IP_CS_OK(rxcmp1)						\
-		(((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS) &&	\
-		!((rxcmp1)->errors_v2 & RX_CMP_IP_CS_ERR_BITS))
-
-#define RX_CMP_IP_CS_UNKNOWN(rxcmp1)					\
+#define RX_CMP_IP_CS_UNKNOWN(rxcmp1)	\
 		!((rxcmp1)->flags2 & RX_CMP_IP_CS_BITS)
 
+/* L4 non tunnel pkt-
+ * Ether / (vlan) / IP6 / UDP|TCP|SCTP
+ */
+#define IS_L4_NONTUNNEL_PKT(flags2_f)	\
+	( \
+	  ((flags2_f) == \
+	   (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC |	\
+			     RX_PKT_CMPL_FLAGS2_L4_CS_CALC))))
+
+/* L4 tunnel pkt-
+ * Outer L4 is not mandatory. Eg: GRE-
+ * Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP
+ * Ether / (vlan) / outer IP|IP6 / outer UDP / VxLAN / Ether / IP|IP6 /
+ *           UDP|TCP|SCTP
+ */
+#define	IS_L4_TUNNEL_PKT_INNER_OUTER_L4_CS(flags2_f)	\
+	 ((flags2_f) == \
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_L4_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)))
+
+#define IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS(flags2_f)	\
+	 ((flags2_f) == \
+	  (rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_L4_CS_CALC |	\
+			    RX_PKT_CMPL_FLAGS2_T_IP_CS_CALC)))
+
+#define IS_L4_TUNNEL_PKT(flags2_f)	\
+	(	\
+		IS_L4_TUNNEL_PKT_INNER_OUTER_L4_CS(flags2_f) || \
+		IS_L4_TUNNEL_PKT_ONLY_INNER_L4_CS(flags2_f)	\
+	)
+
+#define RX_CMP_L4_CS_BITS	\
+	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_L4_CS_CALC)
+
+#define RX_CMP_L4_CS_UNKNOWN(rxcmp1)					\
+	    !((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS)
+
+#define RX_CMP_T_L4_CS_BITS	\
+	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_T_L4_CS_CALC)
+
+#define RX_CMP_T_L4_CS_UNKNOWN(rxcmp1)					\
+	    !((rxcmp1)->flags2 & RX_CMP_T_L4_CS_BITS)
+
+/* Outer L4 chksum error
+ */
+#define RX_CMP_L4_OUTER_CS_ERR2(rxcmp1)	\
+	 ((rxcmp1)->errors_v2 & \
+	  rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_T_L4_CS_ERROR))
+
+/* Inner L4 chksum error
+ */
+#define RX_CMP_L4_INNER_CS_ERR2(rxcmp1)	\
+	 ((rxcmp1)->errors_v2 & \
+	  rte_cpu_to_le_32(RX_PKT_CMPL_ERRORS_L4_CS_ERROR))
+
 #define BNXT_RX_POST_THRESH	32
 
 enum pkt_hash_types {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 07/15] net/bnxt: fix for doorbell register offset for Tx ring
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (5 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 06/15] net/bnxt: fix L4 checksum error indication in Rx path Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 08/15] net/bnxt: save the number of EM flow count Ajit Khaparde
                         ` (8 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable, Rahul Gupta

For Tx-ring # 104 and higher, the doorbell register was incorrectly
configured due to which FW was not able to receive the notification
of packet to transmit. With this fix, user can run traffic upto 256 rings.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
--
v1->v3: Fix output of check-git-log.
---
 drivers/net/bnxt/bnxt_ring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 7453d4b56..9b19459b6 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -639,12 +639,12 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp)
 		ring_type = HWRM_RING_ALLOC_INPUT_RING_TYPE_TX;
 		rc = bnxt_hwrm_ring_alloc(bp, ring,
 					  ring_type,
-					  idx, cpr->hw_stats_ctx_id,
+					  i, cpr->hw_stats_ctx_id,
 					  cp_ring->fw_ring_id);
 		if (rc)
 			goto err_out;
 
-		bnxt_set_db(bp, &txr->tx_db, ring_type, idx, ring->fw_ring_id);
+		bnxt_set_db(bp, &txr->tx_db, ring_type, i, ring->fw_ring_id);
 		txq->index = idx;
 		bnxt_hwrm_set_ring_coal(bp, &coal, cp_ring->fw_ring_id);
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 08/15] net/bnxt: save the number of EM flow count
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (6 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 07/15] net/bnxt: fix for doorbell register offset for Tx ring Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 09/15] net/bnxt: nq doorbell cleanups Ajit Khaparde
                         ` (7 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable, Kalesh Anakkur Purayil

Save the number of EM flow count returned by the FW in HWRM_FUNC_QCFG
and use it to calculate the overall pool of L2 contexts supported by FW.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt.h      |  1 +
 drivers/net/bnxt/bnxt_hwrm.c | 11 +++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 45e7359b2..cd809b385 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -429,6 +429,7 @@ struct bnxt {
 	uint16_t		max_rx_rings;
 	uint16_t		max_nq_rings;
 	uint16_t		max_l2_ctx;
+	uint16_t		max_rx_em_flows;
 	uint16_t		max_vnics;
 	uint16_t		max_stat_ctx;
 	uint16_t		first_vf_id;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index b6f9ec0a0..84cda5e6c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -589,8 +589,10 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 	bp->max_cp_rings = rte_le_to_cpu_16(resp->max_cmpl_rings);
 	bp->max_tx_rings = rte_le_to_cpu_16(resp->max_tx_rings);
 	bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings);
-	bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs);
 	bp->first_vf_id = rte_le_to_cpu_16(resp->first_vf_id);
+	bp->max_rx_em_flows = rte_le_to_cpu_16(resp->max_rx_em_flows);
+	bp->max_l2_ctx =
+		rte_le_to_cpu_16(resp->max_l2_ctxs) + bp->max_rx_em_flows;
 	/* TODO: For now, do not support VMDq/RFS on VFs. */
 	if (BNXT_PF(bp)) {
 		if (bp->pf.max_vfs)
@@ -796,7 +798,12 @@ int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp)
 		bp->max_tx_rings = rte_le_to_cpu_16(resp->max_tx_rings);
 		bp->max_rx_rings = rte_le_to_cpu_16(resp->max_rx_rings);
 		bp->max_ring_grps = rte_le_to_cpu_32(resp->max_hw_ring_grps);
-		bp->max_l2_ctx = rte_le_to_cpu_16(resp->max_l2_ctxs);
+		/* func_resource_qcaps does not return max_rx_em_flows.
+		 * So use the value provided by func_qcaps.
+		 */
+		bp->max_l2_ctx =
+			rte_le_to_cpu_16(resp->max_l2_ctxs) +
+			bp->max_rx_em_flows;
 		bp->max_vnics = rte_le_to_cpu_16(resp->max_vnics);
 		bp->max_stat_ctx = rte_le_to_cpu_16(resp->max_stat_ctx);
 	}
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 09/15] net/bnxt: nq doorbell cleanups
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (7 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 08/15] net/bnxt: save the number of EM flow count Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 10/15] net/bnxt: avoid null pointer dereference Ajit Khaparde
                         ` (6 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson

From: Lance Richardson <lance.richardson@broadcom.com>

Simplify nq doorbell handling code by removing redundant db
parameter and consolidating NQ doorbell macro into the inline
function that uses it.

Add "enable interrupt" variant of nq write. This will be used
in a subsequent commit.

When initializing nq doorbell, don't assume that only the
"disable interrupt" form will be used.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h      |  1 +
 drivers/net/bnxt/bnxt_ring.c |  2 +-
 drivers/net/bnxt/bnxt_ring.h | 23 ++++++++++++++++++-----
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index cd809b385..3ccf784e5 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -246,6 +246,7 @@ struct bnxt_coal {
 #define DBR_TYPE_SRQ				(0x2ULL << 60)
 #define DBR_TYPE_CQ				(0x4ULL << 60)
 #define DBR_TYPE_NQ				(0xaULL << 60)
+#define DBR_TYPE_NQ_ARM				(0xbULL << 60)
 
 #define BNXT_RSS_TBL_SIZE_THOR		512
 #define BNXT_RSS_ENTRIES_PER_CTX_THOR	64
diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 9b19459b6..faf861cc1 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -341,7 +341,7 @@ static void bnxt_set_db(struct bnxt *bp,
 			db->db_key64 = DBR_PATH_L2 | DBR_TYPE_CQ;
 			break;
 		case HWRM_RING_ALLOC_INPUT_RING_TYPE_NQ:
-			db->db_key64 = DBR_PATH_L2 | DBR_TYPE_NQ;
+			db->db_key64 = DBR_PATH_L2;
 			break;
 		}
 		db->db_key64 |= (uint64_t)fid << DBR_XID_SFT;
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index af2c5762f..e5cef3a1d 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -84,15 +84,28 @@ static inline void bnxt_db_write(struct bnxt_db_info *db, uint32_t idx)
 		rte_write32(db->db_key32 | idx, db->doorbell);
 }
 
+/* Ring an NQ doorbell and disable interrupts for the ring. */
 static inline void bnxt_db_nq(struct bnxt_cp_ring_info *cpr)
 {
-	struct bnxt_db_info *db = &cpr->cp_db;
+	if (unlikely(!cpr->cp_db.db_64))
+		return;
+
+	rte_smp_wmb();
+	rte_write64(cpr->cp_db.db_key64 | DBR_TYPE_NQ |
+		    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
+		    cpr->cp_db.doorbell);
+}
+
+/* Ring an NQ doorbell and enable interrupts for the ring. */
+static inline void bnxt_db_nq_arm(struct bnxt_cp_ring_info *cpr)
+{
+	if (unlikely(!cpr->cp_db.db_64))
+		return;
 
 	rte_smp_wmb();
-	if (likely(db->db_64))
-		rte_write64(db->db_key64 | DBR_TYPE_NQ |
-			    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
-			    db->doorbell);
+	rte_write64(cpr->cp_db.db_key64 | DBR_TYPE_NQ_ARM |
+		    RING_CMP(cpr->cp_ring_struct, cpr->cp_raw_cons),
+		    cpr->cp_db.doorbell);
 }
 
 static inline void bnxt_db_cq(struct bnxt_cp_ring_info *cpr)
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 10/15] net/bnxt: avoid null pointer dereference
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (8 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 09/15] net/bnxt: nq doorbell cleanups Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 11/15] net/bnxt: fix to enable disable interrupts correctly Ajit Khaparde
                         ` (5 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Lance Richardson

From: Lance Richardson <lance.richardson@broadcom.com>

Avoid null pointer dereference when allocating an insolated
completion ring by basing nq ring allocation on whether an
nq ring was requested instead of whether the device supports
nq rings.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index faf861cc1..ada748c05 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -280,7 +280,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
 	}
 	cp_ring_info->hw_stats_ctx_id = HWRM_NA_SIGNATURE;
 
-	if (BNXT_HAS_NQ(bp)) {
+	if (nq_ring_info) {
 		struct bnxt_ring *nq_ring = nq_ring_info->cp_ring_struct;
 
 		nq_ring->bd = (char *)mz->addr + nq_ring_start;
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 11/15] net/bnxt: fix to enable disable interrupts correctly
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (9 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 10/15] net/bnxt: avoid null pointer dereference Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path Ajit Khaparde
                         ` (4 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Somnath Kotur

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

1. disable interrupts in dev_stop_op()
2. enable interrupts in dev_start_op()
3. Clean queue intr-vector mapping in dev_stop_op() and thus
   fix a possible memory leak.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
--
v1->v3: Fix errors reported by check-git-log script.
---
 drivers/net/bnxt/bnxt_ethdev.c | 17 ++++++++++++++++-
 drivers/net/bnxt/bnxt_irq.c    |  2 --
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e44df1881..538bed1a5 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -779,6 +779,7 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 
 	eth_dev->rx_pkt_burst = bnxt_receive_function(eth_dev);
 	eth_dev->tx_pkt_burst = bnxt_transmit_function(eth_dev);
+	bnxt_enable_int(bp);
 	bp->flags |= BNXT_FLAG_INIT_DONE;
 	return 0;
 
@@ -818,6 +819,13 @@ static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
 static void bnxt_dev_stop_op(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);
+	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
+
+	bnxt_disable_int(bp);
+
+	/* disable uio/vfio intr/eventfd mapping */
+	rte_intr_disable(intr_handle);
 
 	bp->flags &= ~BNXT_FLAG_INIT_DONE;
 	if (bp->eth_dev->data->dev_started) {
@@ -825,6 +833,14 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 		eth_dev->data->dev_link.link_status = 0;
 	}
 	bnxt_set_hwrm_link_config(bp, false);
+
+	/* Clean queue intr-vector mapping */
+	rte_intr_efd_disable(intr_handle);
+	if (intr_handle->intr_vec != NULL) {
+		rte_free(intr_handle->intr_vec);
+		intr_handle->intr_vec = NULL;
+	}
+
 	bnxt_hwrm_port_clr_stats(bp);
 	bnxt_free_tx_mbufs(bp);
 	bnxt_free_rx_mbufs(bp);
@@ -3991,7 +4007,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 	if (rc)
 		goto error_free_int;
 
-	bnxt_enable_int(bp);
 	bnxt_init_nic(bp);
 
 	return 0;
diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 61f7498a5..6c4dce401 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -58,7 +58,6 @@ void bnxt_free_int(struct bnxt *bp)
 	irq = bp->irq_tbl;
 	if (irq) {
 		if (irq->requested) {
-			rte_intr_disable(&bp->pdev->intr_handle);
 			rte_intr_callback_unregister(&bp->pdev->intr_handle,
 						     irq->handler,
 						     (void *)bp->eth_dev);
@@ -123,7 +122,6 @@ int bnxt_request_int(struct bnxt *bp)
 
 	rte_intr_callback_register(&bp->pdev->intr_handle, irq->handler,
 				   (void *)bp->eth_dev);
-	rte_intr_enable(&bp->pdev->intr_handle);
 
 	irq->requested = 1;
 	return rc;
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (10 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 11/15] net/bnxt: fix to enable disable interrupts correctly Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
                         ` (3 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Kalesh AP, stable, Somnath Kotur

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

The cleanup/rollback operation post rte_eth_dev_start failure might end
up invoking an HWRM cmd even on an invalid vNIC resulting in error
messages being logged needlessly.
Fix to check for the same before issuing the HWRM cmd.

Fixes: c09f57b49c13 ("net/bnxt: add start/stop/link update operations")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 84cda5e6c..1a0265f8a 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2325,6 +2325,11 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp)
 	for (i = bp->nr_vnics - 1; i >= 0; i--) {
 		struct bnxt_vnic_info *vnic = &bp->vnic_info[i];
 
+		if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+			PMD_DRV_LOG(DEBUG, "Invalid vNIC ID\n");
+			return;
+		}
+
 		bnxt_clear_hwrm_vnic_flows(bp, vnic);
 
 		bnxt_clear_hwrm_vnic_filters(bp, vnic);
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 13/15] net/bnxt: fix a compilation warning
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (11 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled Ajit Khaparde
                         ` (2 subsequent siblings)
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable, Rahul Gupta

Compiler complains of an uninitialized variable.
Initializing it to avoid the issue.

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 1a0265f8a..a4e0c2e0c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1523,8 +1523,8 @@ int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 	int rc = 0;
 	struct hwrm_vnic_cfg_input req = {.req_type = 0 };
 	struct hwrm_vnic_cfg_output *resp = bp->hwrm_cmd_resp_addr;
+	struct bnxt_plcmodes_cfg pmodes = { 0 };
 	uint32_t ctx_enable_flag = 0;
-	struct bnxt_plcmodes_cfg pmodes;
 	uint32_t enables = 0;
 
 	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (12 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware Ajit Khaparde
  2019-07-17 17:15       ` [dpdk-dev] [PATCH v3 00/15] bnxt patch series Ferruh Yigit
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Qingmin Liu, stable, Randy Schacher, Somnath Kotur

From: Qingmin Liu <qingmin.liu@broadcom.com>

If ntuple filtering is disabled, FW will return max_vnics=1.
Due to this only single Rxq is created.
Change to max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx) to
fix it.

Fixes: 6d8109bcb398 ("net/bnxt: check VF resources if resource manager is enabled")
Cc: stable@dpdk.org

Signed-off-by: Qingmin Liu <qingmin.liu@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Tested-by: Qingmin Liu <qingmin.liu@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 538bed1a5..cd87d0dbc 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -493,7 +493,7 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	/* PF/VF specifics */
 	if (BNXT_PF(bp))
 		dev_info->max_vfs = bp->pdev->max_vfs;
-	max_rx_rings = RTE_MIN(bp->max_vnics, bp->max_stat_ctx);
+	max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx);
 	/* For the sake of symmetry, max_rx_queues = max_tx_queues */
 	dev_info->max_rx_queues = max_rx_rings;
 	dev_info->max_tx_queues = max_rx_rings;
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* [dpdk-dev] [PATCH v3 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (13 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled Ajit Khaparde
@ 2019-07-17 10:41       ` Ajit Khaparde
  2019-07-17 17:15       ` [dpdk-dev] [PATCH v3 00/15] bnxt patch series Ferruh Yigit
  15 siblings, 0 replies; 54+ messages in thread
From: Ajit Khaparde @ 2019-07-17 10:41 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, Jay Ding, stable, Randy Schacher

From: Jay Ding <jay.ding@broadcom.com>

Add checking for vinc id before sending message to chimp in
bnxt_hwrm_vnic_plcmode_cfg().

Fixes: db678d5c2b54 ("net/bnxt: add HWRM VNIC configure")
Cc: stable@dpdk.org

Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index a4e0c2e0c..313459aaf 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1497,6 +1497,11 @@ static int bnxt_hwrm_vnic_plcmodes_cfg(struct bnxt *bp,
 	struct hwrm_vnic_plcmodes_cfg_input req = {.req_type = 0 };
 	struct hwrm_vnic_plcmodes_cfg_output *resp = bp->hwrm_cmd_resp_addr;
 
+	if (vnic->fw_vnic_id == INVALID_HW_RING_ID) {
+		PMD_DRV_LOG(DEBUG, "VNIC ID %x\n", vnic->fw_vnic_id);
+		return rc;
+	}
+
 	HWRM_PREP(req, VNIC_PLCMODES_CFG, BNXT_USE_CHIMP_MB);
 
 	req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
-- 
2.20.1 (Apple Git-117)


^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [dpdk-dev] [PATCH v3 00/15] bnxt patch series
  2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
                         ` (14 preceding siblings ...)
  2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware Ajit Khaparde
@ 2019-07-17 17:15       ` Ferruh Yigit
  15 siblings, 0 replies; 54+ messages in thread
From: Ferruh Yigit @ 2019-07-17 17:15 UTC (permalink / raw)
  To: Ajit Khaparde, dev

On 7/17/2019 11:41 AM, Ajit Khaparde wrote:
> Patchset fixing various bugs in bnxt PMD based on recent commit:
> 1e101412320061a4a1cd47db4227b4f8a163e9f6
> 
> Ajit Khaparde (3):
>   net/bnxt: fix for doorbell register offset for Tx ring
>   net/bnxt: save the number of EM flow count
>   net/bnxt: fix a compilation warning
> 
> Jay Ding (1):
>   net/bnxt: fix to avoid sending invalid VNIC id to firmware
> 
> Kalesh AP (5):
>   net/bnxt: fix extended port counter statistics
>   net/bnxt: fix possible segfault in case of probe failure
>   net/bnxt: do not fail VF probe when the MAC address is zero
>   net/bnxt: fix to enable disable interrupts correctly
>   net/bnxt: fix to check for invalid VNIC in cleanup path
> 
> Lance Richardson (4):
>   net/bnxt: fix Tx hang after port stop/start
>   net/bnxt: reset Rx allocation state on port restart
>   net/bnxt: nq doorbell cleanups
>   net/bnxt: avoid null pointer dereference
> 
> Qingmin Liu (1):
>   net/bnxt: fix rxq count if ntuple filtering is disabled
> 
> Rahul Gupta (1):
>   net/bnxt: fix L4 checksum error indication in Rx path

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, back to index

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12  6:06 [dpdk-dev] [PATCH 00/15] bnxt patch series Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
2019-07-12 15:04   ` Stephen Hemminger
2019-07-12  6:06 ` [dpdk-dev] [PATCH 02/15] net/bnxt: fix possible segfault in case of probe failure Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 03/15] net/bnxt: do not fail VF probe when the MAC address is zero Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 04/15] net/bnxt: fix Tx hang after port stop/start Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
2019-07-12 12:06   ` Lance Richardson
2019-07-12 12:09     ` Lance Richardson
2019-07-12  6:06 ` [dpdk-dev] [PATCH 06/15] net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 07/15] net/bnxt: fix for doorbell register offset for Tx ring Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 08/15] net/bnxt: save the number of EM flow count Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 09/15] net/bnxt: nq doorbell cleanups Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 10/15] net/bnxt: avoid null pointer dereference Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 11/15] net/bnxt: fix to enable disable interrupts correctly in start stop Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
2019-07-12 13:50   ` Ajit Kumar Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled Ajit Khaparde
2019-07-12  6:06 ` [dpdk-dev] [PATCH 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware Ajit Khaparde
2019-07-16  9:28 ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 02/15] net/bnxt: fix possible segfault in case of probe failure Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 03/15] net/bnxt: do not fail VF probe when the MAC address is zero Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 04/15] net/bnxt: fix Tx hang after port stop/start Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 06/15] net/bnxt: correctly set L4 checksum error for tunnel and non-tunnel packets Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 07/15] net/bnxt: fix for doorbell register offset for Tx ring Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 08/15] net/bnxt: save the number of EM flow count Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 09/15] net/bnxt: nq doorbell cleanups Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 10/15] net/bnxt: avoid null pointer dereference Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 11/15] net/bnxt: fix to enable disable interrupts correctly in start stop Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled Ajit Khaparde
2019-07-16  9:28   ` [dpdk-dev] [PATCH v2 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware Ajit Khaparde
2019-07-16 18:42   ` [dpdk-dev] [PATCH v2 00/15] bnxt patch series Ferruh Yigit
2019-07-17 10:41     ` [dpdk-dev] [PATCH v3 " Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 01/15] net/bnxt: fix extended port counter statistics Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 02/15] net/bnxt: fix possible segfault in case of probe failure Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 03/15] net/bnxt: do not fail VF probe when the MAC address is zero Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 04/15] net/bnxt: fix Tx hang after port stop/start Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 05/15] net/bnxt: reset Rx allocation state on port restart Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 06/15] net/bnxt: fix L4 checksum error indication in Rx path Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 07/15] net/bnxt: fix for doorbell register offset for Tx ring Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 08/15] net/bnxt: save the number of EM flow count Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 09/15] net/bnxt: nq doorbell cleanups Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 10/15] net/bnxt: avoid null pointer dereference Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 11/15] net/bnxt: fix to enable disable interrupts correctly Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 12/15] net/bnxt: fix to check for invalid VNIC in cleanup path Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 13/15] net/bnxt: fix a compilation warning Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 14/15] net/bnxt: fix rxq count if ntuple filtering is disabled Ajit Khaparde
2019-07-17 10:41       ` [dpdk-dev] [PATCH v3 15/15] net/bnxt: fix to avoid sending invalid VNIC id to firmware Ajit Khaparde
2019-07-17 17:15       ` [dpdk-dev] [PATCH v3 00/15] bnxt patch series Ferruh Yigit

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org dpdk-dev@archiver.kernel.org
	public-inbox-index dpdk-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox