All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] bnxt patchset
@ 2018-04-17  1:11 Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 01/14] net/bnxt: set default log level to informational Ajit Khaparde
                   ` (14 more replies)
  0 siblings, 15 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev

patchset against dpdk-next-net.
Please apply.

Thanks

Ajit Khaparde (13):
  net/bnxt: set default log level to informational
  net/bnxt: set padding flags in Rx descriptor
  net/bnxt: fix bnxt_hwrm_vnic_alloc
  net/bnxt: fix incorrect ntuple flag setting
  net/bnxt: fix Rx checksum flags for tunnel frames
  net/bnxt: fix L2 filter cleanup
  net/bnxt: fix bnxt_flow_destroy
  net/bnxt: add code to determine the Tx COS queue
  net/bnxt: maintain rx_mbuf_alloc_fail per RxQ
  net/bnxt: reset l2_filter_id once filter is freed
  net/bnxt: free memory allocated for VF filters
  net/bnxt: use UINT64_MAX to initialize filter ids
  net/bnxt: avoid freeing mem_zone multiple times

Somnath Kotur (1):
  bnxt: add device ID for Stratus VF

 drivers/net/bnxt/bnxt.h                |   3 +-
 drivers/net/bnxt/bnxt_ethdev.c         |  13 +-
 drivers/net/bnxt/bnxt_filter.c         |  28 +-
 drivers/net/bnxt/bnxt_hwrm.c           |  36 ++-
 drivers/net/bnxt/bnxt_hwrm.h           |   3 +
 drivers/net/bnxt/bnxt_ring.c           |  10 +-
 drivers/net/bnxt/bnxt_ring.h           |   4 +-
 drivers/net/bnxt/bnxt_rxq.c            |   5 +-
 drivers/net/bnxt/bnxt_rxq.h            |   2 +
 drivers/net/bnxt/bnxt_rxr.c            |  10 +-
 drivers/net/bnxt/bnxt_rxr.h            |  16 +-
 drivers/net/bnxt/bnxt_stats.c          |  10 +-
 drivers/net/bnxt/bnxt_txq.c            |   4 +-
 drivers/net/bnxt/bnxt_txq.h            |   1 +
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 552 ++++++++++++++++++++-------------
 15 files changed, 436 insertions(+), 261 deletions(-)

-- 
2.15.1 (Apple Git-101)

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

* [PATCH 01/14] net/bnxt: set default log level to informational
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 02/14] net/bnxt: set padding flags in Rx descriptor Ajit Khaparde
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev

Set the default log level to RTE_LOG_INFO from RTE_LOG_NOTICE.

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 1d4ff54b7..b7aab65ab 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3472,7 +3472,7 @@ bnxt_init_log(void)
 {
 	bnxt_logtype_driver = rte_log_register("pmd.bnxt.driver");
 	if (bnxt_logtype_driver >= 0)
-		rte_log_set_level(bnxt_logtype_driver, RTE_LOG_NOTICE);
+		rte_log_set_level(bnxt_logtype_driver, RTE_LOG_INFO);
 }
 
 RTE_PMD_REGISTER_PCI(net_bnxt, bnxt_rte_pmd);
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 02/14] net/bnxt: set padding flags in Rx descriptor
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 01/14] net/bnxt: set default log level to informational Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 03/14] net/bnxt: fix bnxt_hwrm_vnic_alloc Ajit Khaparde
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: stable

Set the RX_PROD_PKT_BD_FLAGS_EOP_PAD in Rx buffer descriptors.
Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index ebdac1ca2..d9b4d768d 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -727,7 +727,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
 	if (rxq->rx_buf_use_size <= size)
 		size = rxq->rx_buf_use_size;
 
-	type = RX_PROD_PKT_BD_TYPE_RX_PROD_PKT;
+	type = RX_PROD_PKT_BD_TYPE_RX_PROD_PKT | RX_PROD_PKT_BD_FLAGS_EOP_PAD;
 
 	rxr = rxq->rx_ring;
 	ring = rxr->rx_ring_struct;
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 03/14] net/bnxt: fix bnxt_hwrm_vnic_alloc
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 01/14] net/bnxt: set default log level to informational Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 02/14] net/bnxt: set padding flags in Rx descriptor Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 04/14] net/bnxt: fix incorrect ntuple flag setting Ajit Khaparde
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: stable

In bnxt_hwrm_vnic_alloc, use rte_cpu_to_le_32 while setting the flags.
Fixes: 2691827e82c0 ("net/bnxt: add HWRM VNIC alloc")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 6e6daf4f8..0100f7473 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1165,7 +1165,8 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 	HWRM_PREP(req, VNIC_ALLOC);
 
 	if (vnic->func_default)
-		req.flags = HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT;
+		req.flags =
+			rte_cpu_to_le_32(HWRM_VNIC_ALLOC_INPUT_FLAGS_DEFAULT);
 	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
 
 	HWRM_CHECK_RESULT();
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 04/14] net/bnxt: fix incorrect ntuple flag setting
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (2 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 03/14] net/bnxt: fix bnxt_hwrm_vnic_alloc Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 05/14] net/bnxt: fix Rx checksum flags for tunnel frames Ajit Khaparde
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: stable

We are wrongly setting the Rx path flag while creating the ntuple filter.
It needs to be set for L2 or Exact Match filters only.
Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_filter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 96b382ba8..5f3154060 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -806,7 +806,8 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 	if (rc != 0)
 		goto ret;
 	//Since we support ingress attribute only - right now.
-	filter->flags = HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX;
+	if (filter->filter_type == HWRM_CFA_EM_FILTER)
+		filter->flags = HWRM_CFA_EM_FLOW_ALLOC_INPUT_FLAGS_PATH_RX;
 
 	switch (act->type) {
 	case RTE_FLOW_ACTION_TYPE_QUEUE:
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 05/14] net/bnxt: fix Rx checksum flags for tunnel frames
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (3 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 04/14] net/bnxt: fix incorrect ntuple flag setting Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 06/14] net/bnxt: fix L2 filter cleanup Ajit Khaparde
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: stable

Fix Rx checksum status for tunnel frames as seen by hardware.
Current code does not handle cases for tunnel frames correctly.

Fixes: 7ec39d8c524b ("net/bnxt: update status of Rx IP/L4 CKSUM")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxr.h | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index dd4ea5d1d..e8c47ca56 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -24,17 +24,25 @@
 #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)
+#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)
+#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 RX_CMP_L4_CS_OK(rxcmp1)						\
 	    (((rxcmp1)->flags2 & RX_CMP_L4_CS_BITS) &&		\
 	     !((rxcmp1)->errors_v2 & RX_CMP_L4_CS_ERR_BITS))
 
-#define RX_CMP_IP_CS_ERR_BITS	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_CS_BITS	rte_cpu_to_le_32(RX_PKT_CMPL_FLAGS2_IP_CS_CALC)
+#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) &&	\
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 06/14] net/bnxt: fix L2 filter cleanup
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (4 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 05/14] net/bnxt: fix Rx checksum flags for tunnel frames Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 07/14] net/bnxt: fix bnxt_flow_destroy Ajit Khaparde
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: stable

We are wrongly freeing up a filter in the driver while it is still
configured in the HW. This can cause incorrect L2 filter id to be
used for filters created subsequently.

This filter will be cleared on cleanup anyway.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_filter.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 5f3154060..d28c04038 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -919,11 +919,6 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 		goto ret;
 	}
 
-	if (filter1) {
-		bnxt_free_filter(bp, filter1);
-		filter1->fw_l2_filter_id = -1;
-	}
-
 	act = nxt_non_void_action(++act);
 	if (act->type != RTE_FLOW_ACTION_TYPE_END) {
 		rte_flow_error_set(error, EINVAL,
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 07/14] net/bnxt: fix bnxt_flow_destroy
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (5 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 06/14] net/bnxt: fix L2 filter cleanup Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 08/14] net/bnxt: add code to determine the Tx COS queue Ajit Khaparde
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: stable

bnxt_hwrm_clear_l2_filter needs to be called only if the filter type
is L2 and not otherwise.
Also check for the return value of bnxt_hwrm_clear_l2_filter().

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index d28c04038..179349539 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -1144,8 +1144,8 @@ bnxt_flow_destroy(struct rte_eth_dev *dev,
 		ret = bnxt_hwrm_clear_em_filter(bp, filter);
 	if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER)
 		ret = bnxt_hwrm_clear_ntuple_filter(bp, filter);
-
-	bnxt_hwrm_clear_l2_filter(bp, filter);
+	else
+		ret = bnxt_hwrm_clear_l2_filter(bp, filter);
 	if (!ret) {
 		STAILQ_REMOVE(&vnic->flow_list, flow, rte_flow, next);
 		rte_free(flow);
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 08/14] net/bnxt: add code to determine the Tx COS queue
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (6 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 07/14] net/bnxt: fix bnxt_flow_destroy Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 09/14] net/bnxt: maintain rx_mbuf_alloc_fail per RxQ Ajit Khaparde
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev

The hwrm_queue_qportcfg command has been extended to determine
the COS queue that a Tx ring needs to use. This patch adds code
to determine the information from the FW and use it while
creating the Tx rings.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h                |   2 +
 drivers/net/bnxt/bnxt_hwrm.c           |  24 +-
 drivers/net/bnxt/bnxt_hwrm.h           |   3 +
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 552 ++++++++++++++++++++-------------
 4 files changed, 361 insertions(+), 220 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 2e99878ef..d3eab8d36 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -272,6 +272,7 @@ struct bnxt {
 
 	struct bnxt_link_info	link_info;
 	struct bnxt_cos_queue_info	cos_queue[BNXT_COS_QUEUE_COUNT];
+	uint8_t			tx_cosq_id;
 
 	uint16_t		fw_fid;
 	uint8_t			dflt_mac_addr[ETHER_ADDR_LEN];
@@ -293,6 +294,7 @@ struct bnxt {
 	uint16_t		vxlan_fw_dst_port_id;
 	uint16_t		geneve_fw_dst_port_id;
 	uint32_t		fw_ver;
+	uint32_t		hwrm_spec_code;
 	rte_atomic64_t		rx_mbuf_alloc_fail;
 
 	struct bnxt_led_info	leds[BNXT_MAX_LED];
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 0100f7473..3a326d4f5 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -27,6 +27,7 @@
 #include <rte_io.h>
 
 #define HWRM_CMD_TIMEOUT		10000
+#define HWRM_VERSION_1_9_1		0x10901
 
 struct bnxt_plcmodes_cfg {
 	uint32_t	flags;
@@ -665,6 +666,7 @@ int bnxt_hwrm_ver_get(struct bnxt *bp)
 	fw_version = resp->hwrm_intf_maj << 16;
 	fw_version |= resp->hwrm_intf_min << 8;
 	fw_version |= resp->hwrm_intf_upd;
+	bp->hwrm_spec_code = fw_version;
 
 	if (resp->hwrm_intf_maj != HWRM_VERSION_MAJOR) {
 		PMD_DRV_LOG(ERR, "Unsupported firmware API version\n");
@@ -891,9 +893,15 @@ int bnxt_hwrm_queue_qportcfg(struct bnxt *bp)
 	int rc = 0;
 	struct hwrm_queue_qportcfg_input req = {.req_type = 0 };
 	struct hwrm_queue_qportcfg_output *resp = bp->hwrm_cmd_resp_addr;
+	int i;
 
 	HWRM_PREP(req, QUEUE_QPORTCFG);
 
+	req.flags = HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX;
+	/* HWRM Version >= 1.9.1 */
+	if (bp->hwrm_spec_code >= HWRM_VERSION_1_9_1)
+		req.drv_qmap_cap =
+			HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED;
 	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
 
 	HWRM_CHECK_RESULT();
@@ -913,6 +921,20 @@ int bnxt_hwrm_queue_qportcfg(struct bnxt *bp)
 
 	HWRM_UNLOCK();
 
+	if (bp->hwrm_spec_code < HWRM_VERSION_1_9_1) {
+		bp->tx_cosq_id = bp->cos_queue[0].id;
+	} else {
+		/* iterate and find the COSq profile to use for Tx */
+		for (i = 0; i < BNXT_COS_QUEUE_COUNT; i++) {
+			if (bp->cos_queue[i].profile ==
+				HWRM_QUEUE_SERVICE_PROFILE_LOSSY) {
+				bp->tx_cosq_id = bp->cos_queue[i].id;
+				break;
+			}
+		}
+	}
+	PMD_DRV_LOG(DEBUG, "Tx Cos Queue to use: %d\n", bp->tx_cosq_id);
+
 	return rc;
 }
 
@@ -936,7 +958,7 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp,
 
 	switch (ring_type) {
 	case HWRM_RING_ALLOC_INPUT_RING_TYPE_TX:
-		req.queue_id = bp->cos_queue[0].id;
+		req.queue_id = rte_cpu_to_le_16(bp->tx_cosq_id);
 		/* FALLTHROUGH */
 	case HWRM_RING_ALLOC_INPUT_RING_TYPE_RX:
 		req.ring_type = ring_type;
diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h
index 629243477..7c161eea0 100644
--- a/drivers/net/bnxt/bnxt_hwrm.h
+++ b/drivers/net/bnxt/bnxt_hwrm.h
@@ -26,6 +26,9 @@ struct bnxt_cp_ring_info;
 #define ASYNC_CMPL_EVENT_ID_VF_CFG_CHANGE	\
 	(1 << (HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE - 32))
 
+#define HWRM_QUEUE_SERVICE_PROFILE_LOSSY \
+	HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY
+
 int bnxt_hwrm_cfa_l2_clear_rx_mask(struct bnxt *bp,
 				   struct bnxt_vnic_info *vnic);
 int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, struct bnxt_vnic_info *vnic,
diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h
index bcdacae81..79705a7da 100644
--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h
+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h
@@ -6759,339 +6759,453 @@ struct hwrm_port_led_qcaps_output {
  * configured.
  */
 /* Input	(24 bytes) */
+/* hwrm_queue_qportcfg_input (size:192b/24B) */
 struct hwrm_queue_qportcfg_input {
-	uint16_t req_type;
+	/* The HWRM command request type. */
+	uint16_t	req_type;
 	/*
-	 * This value indicates what type of request this is. The format
-	 * for the rest of the command is determined by this field.
+	 * The completion ring to send the completion event on. This should
+	 * be the NQ ID returned from the `nq_alloc` HWRM command.
 	 */
-	uint16_t cmpl_ring;
+	uint16_t	cmpl_ring;
 	/*
-	 * This value indicates the what completion ring the request
-	 * will be optionally completed on. If the value is -1, then no
-	 * CR completion will be generated. Any other value must be a
-	 * valid CR ring_id value for this function.
+	 * The sequence ID is used by the driver for tracking multiple
+	 * commands. This ID is treated as opaque data by the firmware and
+	 * the value is returned in the `hwrm_resp_hdr` upon completion.
 	 */
-	uint16_t seq_id;
-	/* This value indicates the command sequence number. */
-	uint16_t target_id;
+	uint16_t	seq_id;
 	/*
-	 * Target ID of this command. 0x0 - 0xFFF8 - Used for function
-	 * ids 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF
-	 * - HWRM
+	 * The target ID of the command:
+	 * * 0x0-0xFFF8 - The function ID
+	 * * 0xFFF8-0xFFFE - Reserved for internal processors
+	 * * 0xFFFF - HWRM
 	 */
-	uint64_t resp_addr;
+	uint16_t	target_id;
 	/*
-	 * This is the host address where the response will be written
-	 * when the request is complete. This area must be 16B aligned
-	 * and must be cleared to zero before the request is made.
+	 * A physical address pointer pointing to a host buffer that the
+	 * command's response data will be written. This can be either a host
+	 * physical address (HPA) or a guest physical address (GPA) and must
+	 * point to a physically contiguous block of memory.
 	 */
-	uint32_t flags;
+	uint64_t	resp_addr;
+	uint32_t	flags;
 	/*
-	 * Enumeration denoting the RX, TX type of the resource. This
-	 * enumeration is used for resources that are similar for both
+	 * Enumeration denoting the RX, TX type of the resource.
+	 * This enumeration is used for resources that are similar for both
 	 * TX and RX paths of the chip.
 	 */
-	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH	UINT32_C(0x1)
+	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH     UINT32_C(0x1)
 	/* tx path */
-	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX	UINT32_C(0x0)
+	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX    UINT32_C(0x0)
 	/* rx path */
-	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX	UINT32_C(0x1)
+	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX    UINT32_C(0x1)
 	#define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
-		QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
-	uint16_t port_id;
+		HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
 	/*
 	 * Port ID of port for which the queue configuration is being
-	 * queried. This field is only required when sent by IPC.
+	 * queried.  This field is only required when sent by IPC.
 	 */
-	uint16_t unused_0;
+	uint16_t	port_id;
+	/*
+	 * Drivers will set this capability when it can use
+	 * queue_idx_service_profile to map the queues to application.
+	 */
+	uint8_t	drv_qmap_cap;
+	/* disabled */
+	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_DISABLED UINT32_C(0x0)
+	/* enabled */
+	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED  UINT32_C(0x1)
+	#define HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_LAST \
+		HWRM_QUEUE_QPORTCFG_INPUT_DRV_QMAP_CAP_ENABLED
+	uint8_t	unused_0;
 } __attribute__((packed));
 
 /* Output	(32 bytes) */
+/* hwrm_queue_qportcfg_output (size:256b/32B) */
 struct hwrm_queue_qportcfg_output {
-	uint16_t error_code;
-	/*
-	 * Pass/Fail or error type Note: receiver to verify the in
-	 * parameters, and fail the call with an error when appropriate
-	 */
-	uint16_t req_type;
-	/* This field returns the type of original request. */
-	uint16_t seq_id;
-	/* This field provides original sequence number of the command. */
-	uint16_t resp_len;
-	/*
-	 * This field is the length of the response in bytes. The last
-	 * byte of the response is a valid flag that will read as '1'
-	 * when the command has been completely written to memory.
-	 */
-	uint8_t max_configurable_queues;
+	/* The specific error status for the command. */
+	uint16_t	error_code;
+	/* The HWRM command request type. */
+	uint16_t	req_type;
+	/* The sequence ID from the original command. */
+	uint16_t	seq_id;
+	/* The length of the response data in number of bytes. */
+	uint16_t	resp_len;
 	/*
 	 * The maximum number of queues that can be configured on this
-	 * port. Valid values range from 1 through 8.
+	 * port.
+	 * Valid values range from 1 through 8.
 	 */
-	uint8_t max_configurable_lossless_queues;
+	uint8_t	max_configurable_queues;
 	/*
 	 * The maximum number of lossless queues that can be configured
-	 * on this port. Valid values range from 0 through 8.
+	 * on this port.
+	 * Valid values range from 0 through 8.
 	 */
-	uint8_t queue_cfg_allowed;
+	uint8_t	max_configurable_lossless_queues;
 	/*
 	 * Bitmask indicating which queues can be configured by the
-	 * hwrm_queue_cfg command. Each bit represents a specific queue
-	 * where bit 0 represents queue 0 and bit 7 represents queue 7.
+	 * hwrm_queue_cfg command.
+	 *
+	 * Each bit represents a specific queue where bit 0 represents
+	 * queue 0 and bit 7 represents queue 7.
 	 * # A value of 0 indicates that the queue is not configurable
-	 * by the hwrm_queue_cfg command. # A value of 1 indicates that
-	 * the queue is configurable. # A hwrm_queue_cfg command shall
-	 * return error when trying to configure a queue not
-	 * configurable.
+	 * by the hwrm_queue_cfg command.
+	 * # A value of 1 indicates that the queue is configurable.
+	 * # A hwrm_queue_cfg command shall return error when trying to
+	 * configure a queue not configurable.
 	 */
-	uint8_t queue_cfg_info;
+	uint8_t	queue_cfg_allowed;
 	/* Information about queue configuration. */
-	/*
-	 * If this flag is set to '1', then the queues are configured
-	 * asymmetrically on TX and RX sides. If this flag is set to
-	 * '0', then the queues are configured symmetrically on TX and
-	 * RX sides. For symmetric configuration, the queue
-	 * configuration including queue ids and service profiles on the
-	 * TX side is the same as the corresponding queue configuration
-	 * on the RX side.
-	 */
-	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG UINT32_C(0x1)
-	uint8_t queue_pfcenable_cfg_allowed;
+	uint8_t	queue_cfg_info;
+	/*
+	 * If this flag is set to '1', then the queues are
+	 * configured asymmetrically on TX and RX sides.
+	 * If this flag is set to '0', then the queues are
+	 * configured symmetrically on TX and RX sides. For
+	 * symmetric configuration, the queue configuration
+	 * including queue ids and service profiles on the
+	 * TX side is the same as the corresponding queue
+	 * configuration on the RX side.
+	 */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_CFG_INFO_ASYM_CFG \
+		UINT32_C(0x1)
 	/*
 	 * Bitmask indicating which queues can be configured by the
-	 * hwrm_queue_pfcenable_cfg command. Each bit represents a
-	 * specific priority where bit 0 represents priority 0 and bit 7
-	 * represents priority 7. # A value of 0 indicates that the
-	 * priority is not configurable by the hwrm_queue_pfcenable_cfg
-	 * command. # A value of 1 indicates that the priority is
-	 * configurable. # A hwrm_queue_pfcenable_cfg command shall
-	 * return error when trying to configure a priority that is not
-	 * configurable.
-	 */
-	uint8_t queue_pri2cos_cfg_allowed;
+	 * hwrm_queue_pfcenable_cfg command.
+	 *
+	 * Each bit represents a specific priority where bit 0 represents
+	 * priority 0 and bit 7 represents priority 7.
+	 * # A value of 0 indicates that the priority is not configurable by
+	 * the hwrm_queue_pfcenable_cfg command.
+	 * # A value of 1 indicates that the priority is configurable.
+	 * # A hwrm_queue_pfcenable_cfg command shall return error when
+	 * trying to configure a priority that is not configurable.
+	 */
+	uint8_t	queue_pfcenable_cfg_allowed;
 	/*
 	 * Bitmask indicating which queues can be configured by the
-	 * hwrm_queue_pri2cos_cfg command. Each bit represents a
-	 * specific queue where bit 0 represents queue 0 and bit 7
-	 * represents queue 7. # A value of 0 indicates that the queue
-	 * is not configurable by the hwrm_queue_pri2cos_cfg command. #
-	 * A value of 1 indicates that the queue is configurable. # A
-	 * hwrm_queue_pri2cos_cfg command shall return error when trying
-	 * to configure a queue that is not configurable.
+	 * hwrm_queue_pri2cos_cfg command.
+	 *
+	 * Each bit represents a specific queue where bit 0 represents
+	 * queue 0 and bit 7 represents queue 7.
+	 * # A value of 0 indicates that the queue is not configurable
+	 * by the hwrm_queue_pri2cos_cfg command.
+	 * # A value of 1 indicates that the queue is configurable.
+	 * # A hwrm_queue_pri2cos_cfg command shall return error when
+	 * trying to configure a queue that is not configurable.
 	 */
-	uint8_t queue_cos2bw_cfg_allowed;
+	uint8_t	queue_pri2cos_cfg_allowed;
 	/*
 	 * Bitmask indicating which queues can be configured by the
-	 * hwrm_queue_pri2cos_cfg command. Each bit represents a
-	 * specific queue where bit 0 represents queue 0 and bit 7
-	 * represents queue 7. # A value of 0 indicates that the queue
-	 * is not configurable by the hwrm_queue_pri2cos_cfg command. #
-	 * A value of 1 indicates that the queue is configurable. # A
-	 * hwrm_queue_pri2cos_cfg command shall return error when trying
-	 * to configure a queue not configurable.
-	 */
-	uint8_t queue_id0;
-	/*
-	 * ID of CoS Queue 0. FF - Invalid id # This ID can be used on
-	 * any subsequent call to an hwrm command that takes a queue id.
+	 * hwrm_queue_pri2cos_cfg command.
+	 *
+	 * Each bit represents a specific queue where bit 0 represents
+	 * queue 0 and bit 7 represents queue 7.
+	 * # A value of 0 indicates that the queue is not configurable
+	 * by the hwrm_queue_pri2cos_cfg command.
+	 * # A value of 1 indicates that the queue is configurable.
+	 * # A hwrm_queue_pri2cos_cfg command shall return error when
+	 * trying to configure a queue not configurable.
+	 */
+	uint8_t	queue_cos2bw_cfg_allowed;
+	/*
+	 * ID of CoS Queue 0.
+	 * FF - Invalid id
+	 *
+	 * # This ID can be used on any subsequent call to an hwrm command
+	 * that takes a queue id.
 	 * # IDs must always be queried by this command before any use
-	 * by the driver or software. # Any driver or software should
-	 * not make any assumptions about queue IDs. # A value of 0xff
-	 * indicates that the queue is not available. # Available queues
-	 * may not be in sequential order.
+	 * by the driver or software.
+	 * # Any driver or software should not make any assumptions about
+	 * queue IDs.
+	 * # A value of 0xff indicates that the queue is not available.
+	 * # Available queues may not be in sequential order.
 	 */
-	uint8_t queue_id0_service_profile;
+	uint8_t	queue_id0;
 	/* This value is applicable to CoS queues only. */
-	/* Lossy	(best-effort) */
+	uint8_t	queue_id0_service_profile;
+	/* Lossy (best-effort) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
 		UINT32_C(0x0)
-	/* Lossless */
+	/* Lossless (legacy) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
 		UINT32_C(0x1)
-	/*
-	 * Set to 0xFF...	(All Fs) if there is no
-	 * service profile specified
-	 */
+	/* Lossless RoCE */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_ROCE \
+		UINT32_C(0x1)
+	/* Lossy RoCE CNP */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY_ROCE_CNP \
+		UINT32_C(0x2)
+	/* Lossless NIC */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS_NIC \
+		UINT32_C(0x3)
+	/* Set to 0xFF... (All Fs) if there is no service profile specified */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
 		UINT32_C(0xff)
-	uint8_t queue_id1;
-	/*
-	 * ID of CoS Queue 1. FF - Invalid id # This ID can be used on
-	 * any subsequent call to an hwrm command that takes a queue id.
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LAST \
+		HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN
+	/*
+	 * ID of CoS Queue 1.
+	 * FF - Invalid id
+	 *
+	 * # This ID can be used on any subsequent call to an hwrm command
+	 * that takes a queue id.
 	 * # IDs must always be queried by this command before any use
-	 * by the driver or software. # Any driver or software should
-	 * not make any assumptions about queue IDs. # A value of 0xff
-	 * indicates that the queue is not available. # Available queues
-	 * may not be in sequential order.
+	 * by the driver or software.
+	 * # Any driver or software should not make any assumptions about
+	 * queue IDs.
+	 * # A value of 0xff indicates that the queue is not available.
+	 * # Available queues may not be in sequential order.
 	 */
-	uint8_t queue_id1_service_profile;
+	uint8_t	queue_id1;
 	/* This value is applicable to CoS queues only. */
-	/* Lossy	(best-effort) */
+	uint8_t	queue_id1_service_profile;
+	/* Lossy (best-effort) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
 		UINT32_C(0x0)
-	/* Lossless */
+	/* Lossless (legacy) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
 		UINT32_C(0x1)
-	/*
-	 * Set to 0xFF...	(All Fs) if there is no
-	 * service profile specified
-	 */
+	/* Lossless RoCE */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_ROCE \
+		UINT32_C(0x1)
+	/* Lossy RoCE CNP */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY_ROCE_CNP \
+		UINT32_C(0x2)
+	/* Lossless NIC */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS_NIC \
+		UINT32_C(0x3)
+	/* Set to 0xFF... (All Fs) if there is no service profile specified */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
 		UINT32_C(0xff)
-	uint8_t queue_id2;
-	/*
-	 * ID of CoS Queue 2. FF - Invalid id # This ID can be used on
-	 * any subsequent call to an hwrm command that takes a queue id.
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LAST \
+		HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN
+	/*
+	 * ID of CoS Queue 2.
+	 * FF - Invalid id
+	 *
+	 * # This ID can be used on any subsequent call to an hwrm command
+	 * that takes a queue id.
 	 * # IDs must always be queried by this command before any use
-	 * by the driver or software. # Any driver or software should
-	 * not make any assumptions about queue IDs. # A value of 0xff
-	 * indicates that the queue is not available. # Available queues
-	 * may not be in sequential order.
+	 * by the driver or software.
+	 * # Any driver or software should not make any assumptions about
+	 * queue IDs.
+	 * # A value of 0xff indicates that the queue is not available.
+	 * # Available queues may not be in sequential order.
 	 */
-	uint8_t queue_id2_service_profile;
+	uint8_t	queue_id2;
 	/* This value is applicable to CoS queues only. */
-	/* Lossy	(best-effort) */
+	uint8_t	queue_id2_service_profile;
+	/* Lossy (best-effort) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
 		UINT32_C(0x0)
-	/* Lossless */
+	/* Lossless (legacy) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
 		UINT32_C(0x1)
-	/*
-	 * Set to 0xFF...	(All Fs) if there is no
-	 * service profile specified
-	 */
+	/* Lossless RoCE */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_ROCE \
+		UINT32_C(0x1)
+	/* Lossy RoCE CNP */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY_ROCE_CNP \
+		UINT32_C(0x2)
+	/* Lossless NIC */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS_NIC \
+		UINT32_C(0x3)
+	/* Set to 0xFF... (All Fs) if there is no service profile specified */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
 		UINT32_C(0xff)
-	uint8_t queue_id3;
-	/*
-	 * ID of CoS Queue 3. FF - Invalid id # This ID can be used on
-	 * any subsequent call to an hwrm command that takes a queue id.
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LAST \
+		HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN
+	/*
+	 * ID of CoS Queue 3.
+	 * FF - Invalid id
+	 *
+	 * # This ID can be used on any subsequent call to an hwrm command
+	 * that takes a queue id.
 	 * # IDs must always be queried by this command before any use
-	 * by the driver or software. # Any driver or software should
-	 * not make any assumptions about queue IDs. # A value of 0xff
-	 * indicates that the queue is not available. # Available queues
-	 * may not be in sequential order.
+	 * by the driver or software.
+	 * # Any driver or software should not make any assumptions about
+	 * queue IDs.
+	 * # A value of 0xff indicates that the queue is not available.
+	 * # Available queues may not be in sequential order.
 	 */
-	uint8_t queue_id3_service_profile;
+	uint8_t	queue_id3;
 	/* This value is applicable to CoS queues only. */
-	/* Lossy	(best-effort) */
+	uint8_t	queue_id3_service_profile;
+	/* Lossy (best-effort) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
 		UINT32_C(0x0)
-	/* Lossless */
+	/* Lossless (legacy) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
 		UINT32_C(0x1)
-	/*
-	 * Set to 0xFF...	(All Fs) if there is no
-	 * service profile specified
-	 */
+	/* Lossless RoCE */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_ROCE \
+		UINT32_C(0x1)
+	/* Lossy RoCE CNP */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY_ROCE_CNP \
+		UINT32_C(0x2)
+	/* Lossless NIC */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS_NIC \
+		UINT32_C(0x3)
+	/* Set to 0xFF... (All Fs) if there is no service profile specified */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
 		UINT32_C(0xff)
-	uint8_t queue_id4;
-	/*
-	 * ID of CoS Queue 4. FF - Invalid id # This ID can be used on
-	 * any subsequent call to an hwrm command that takes a queue id.
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LAST \
+		HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN
+	/*
+	 * ID of CoS Queue 4.
+	 * FF - Invalid id
+	 *
+	 * # This ID can be used on any subsequent call to an hwrm command
+	 * that takes a queue id.
 	 * # IDs must always be queried by this command before any use
-	 * by the driver or software. # Any driver or software should
-	 * not make any assumptions about queue IDs. # A value of 0xff
-	 * indicates that the queue is not available. # Available queues
-	 * may not be in sequential order.
+	 * by the driver or software.
+	 * # Any driver or software should not make any assumptions about
+	 * queue IDs.
+	 * # A value of 0xff indicates that the queue is not available.
+	 * # Available queues may not be in sequential order.
 	 */
-	uint8_t queue_id4_service_profile;
+	uint8_t	queue_id4;
 	/* This value is applicable to CoS queues only. */
-	/* Lossy	(best-effort) */
+	uint8_t	queue_id4_service_profile;
+	/* Lossy (best-effort) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
 		UINT32_C(0x0)
-	/* Lossless */
+	/* Lossless (legacy) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
 		UINT32_C(0x1)
-	/*
-	 * Set to 0xFF...	(All Fs) if there is no
-	 * service profile specified
-	 */
+	/* Lossless RoCE */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_ROCE \
+		UINT32_C(0x1)
+	/* Lossy RoCE CNP */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY_ROCE_CNP \
+		UINT32_C(0x2)
+	/* Lossless NIC */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS_NIC \
+		UINT32_C(0x3)
+	/* Set to 0xFF... (All Fs) if there is no service profile specified */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
 		UINT32_C(0xff)
-	uint8_t queue_id5;
-	/*
-	 * ID of CoS Queue 5. FF - Invalid id # This ID can be used on
-	 * any subsequent call to an hwrm command that takes a queue id.
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LAST \
+		HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN
+	/*
+	 * ID of CoS Queue 5.
+	 * FF - Invalid id
+	 *
+	 * # This ID can be used on any subsequent call to an hwrm command
+	 * that takes a queue id.
 	 * # IDs must always be queried by this command before any use
-	 * by the driver or software. # Any driver or software should
-	 * not make any assumptions about queue IDs. # A value of 0xff
-	 * indicates that the queue is not available. # Available queues
-	 * may not be in sequential order.
+	 * by the driver or software.
+	 * # Any driver or software should not make any assumptions about
+	 * queue IDs.
+	 * # A value of 0xff indicates that the queue is not available.
+	 * # Available queues may not be in sequential order.
 	 */
-	uint8_t queue_id5_service_profile;
+	uint8_t	queue_id5;
 	/* This value is applicable to CoS queues only. */
-	/* Lossy	(best-effort) */
+	uint8_t	queue_id5_service_profile;
+	/* Lossy (best-effort) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
 		UINT32_C(0x0)
-	/* Lossless */
+	/* Lossless (legacy) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
 		UINT32_C(0x1)
-	/*
-	 * Set to 0xFF...	(All Fs) if there is no
-	 * service profile specified
-	 */
+	/* Lossless RoCE */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_ROCE \
+		UINT32_C(0x1)
+	/* Lossy RoCE CNP */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY_ROCE_CNP \
+		UINT32_C(0x2)
+	/* Lossless NIC */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS_NIC \
+		UINT32_C(0x3)
+	/* Set to 0xFF... (All Fs) if there is no service profile specified */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
 		UINT32_C(0xff)
-	uint8_t queue_id6;
-	/*
-	 * ID of CoS Queue 6. FF - Invalid id # This ID can be used on
-	 * any subsequent call to an hwrm command that takes a queue id.
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LAST \
+		HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN
+	/*
+	 * ID of CoS Queue 6.
+	 * FF - Invalid id
+	 *
+	 * # This ID can be used on any subsequent call to an hwrm command
+	 * that takes a queue id.
 	 * # IDs must always be queried by this command before any use
-	 * by the driver or software. # Any driver or software should
-	 * not make any assumptions about queue IDs. # A value of 0xff
-	 * indicates that the queue is not available. # Available queues
-	 * may not be in sequential order.
+	 * by the driver or software.
+	 * # Any driver or software should not make any assumptions about
+	 * queue IDs.
+	 * # A value of 0xff indicates that the queue is not available.
+	 * # Available queues may not be in sequential order.
 	 */
-	uint8_t queue_id6_service_profile;
+	uint8_t	queue_id6;
 	/* This value is applicable to CoS queues only. */
-	/* Lossy	(best-effort) */
+	uint8_t	queue_id6_service_profile;
+	/* Lossy (best-effort) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
 		UINT32_C(0x0)
-	/* Lossless */
+	/* Lossless (legacy) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
 		UINT32_C(0x1)
-	/*
-	 * Set to 0xFF...	(All Fs) if there is no
-	 * service profile specified
-	 */
+	/* Lossless RoCE */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_ROCE \
+		UINT32_C(0x1)
+	/* Lossy RoCE CNP */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY_ROCE_CNP \
+		UINT32_C(0x2)
+	/* Lossless NIC */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS_NIC \
+		UINT32_C(0x3)
+	/* Set to 0xFF... (All Fs) if there is no service profile specified */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
 		UINT32_C(0xff)
-	uint8_t queue_id7;
-	/*
-	 * ID of CoS Queue 7. FF - Invalid id # This ID can be used on
-	 * any subsequent call to an hwrm command that takes a queue id.
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LAST \
+		HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN
+	/*
+	 * ID of CoS Queue 7.
+	 * FF - Invalid id
+	 *
+	 * # This ID can be used on any subsequent call to an hwrm command
+	 * that takes a queue id.
 	 * # IDs must always be queried by this command before any use
-	 * by the driver or software. # Any driver or software should
-	 * not make any assumptions about queue IDs. # A value of 0xff
-	 * indicates that the queue is not available. # Available queues
-	 * may not be in sequential order.
+	 * by the driver or software.
+	 * # Any driver or software should not make any assumptions about
+	 * queue IDs.
+	 * # A value of 0xff indicates that the queue is not available.
+	 * # Available queues may not be in sequential order.
 	 */
-	uint8_t queue_id7_service_profile;
+	uint8_t	queue_id7;
 	/* This value is applicable to CoS queues only. */
-	/* Lossy	(best-effort) */
+	uint8_t	queue_id7_service_profile;
+	/* Lossy (best-effort) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
 		UINT32_C(0x0)
-	/* Lossless */
+	/* Lossless (legacy) */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
 		UINT32_C(0x1)
-	/*
-	 * Set to 0xFF...	(All Fs) if there is no
-	 * service profile specified
-	 */
+	/* Lossless RoCE */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_ROCE \
+		UINT32_C(0x1)
+	/* Lossy RoCE CNP */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY_ROCE_CNP \
+		UINT32_C(0x2)
+	/* Lossless NIC */
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS_NIC \
+		UINT32_C(0x3)
+	/* Set to 0xFF... (All Fs) if there is no service profile specified */
 	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
 		UINT32_C(0xff)
-	uint8_t valid;
+	#define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LAST \
+		HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN
 	/*
-	 * This field is used in Output records to indicate that the
-	 * output is completely written to RAM. This field should be
-	 * read as '1' to indicate that the output has been completely
-	 * written. When writing a command completion or response to an
-	 * internal processor, the order of writes has to be such that
-	 * this field is written last.
+	 * This field is used in Output records to indicate that the output
+	 * is completely written to RAM.  This field should be read as '1'
+	 * to indicate that the output has been completely written.
+	 * When writing a command completion or response to an internal
+	 * processor,
+	 * the order of writes has to be such that this field is written last.
 	 */
+	uint8_t	valid;
 } __attribute__((packed));
 
 /*********************
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 09/14] net/bnxt: maintain rx_mbuf_alloc_fail per RxQ
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (7 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 08/14] net/bnxt: add code to determine the Tx COS queue Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 10/14] net/bnxt: reset l2_filter_id once filter is freed Ajit Khaparde
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev

Currently we have a single counter for mbuf alloc failure.
Make it per RxQ instead.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  1 -
 drivers/net/bnxt/bnxt_ethdev.c |  1 -
 drivers/net/bnxt/bnxt_rxq.c    |  1 +
 drivers/net/bnxt/bnxt_rxq.h    |  1 +
 drivers/net/bnxt/bnxt_rxr.c    |  8 ++++----
 drivers/net/bnxt/bnxt_stats.c  | 10 ++++++++--
 6 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index d3eab8d36..bdca2622f 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -295,7 +295,6 @@ struct bnxt {
 	uint16_t		geneve_fw_dst_port_id;
 	uint32_t		fw_ver;
 	uint32_t		hwrm_spec_code;
-	rte_atomic64_t		rx_mbuf_alloc_fail;
 
 	struct bnxt_led_info	leds[BNXT_MAX_LED];
 	uint8_t			num_leds;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b7aab65ab..3cf845089 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3129,7 +3129,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 
 	bp = eth_dev->data->dev_private;
 
-	rte_atomic64_init(&bp->rx_mbuf_alloc_fail);
 	bp->dev_stopped = 1;
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index ce3f0a1d9..d797a47e9 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -336,6 +336,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 		rc = -ENOMEM;
 		goto out;
 	}
+	rte_atomic64_init(&rxq->rx_mbuf_alloc_fail);
 
 out:
 	return rc;
diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index 616163e63..3350d7719 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -32,6 +32,7 @@ struct bnxt_rx_queue {
 	uint32_t			rx_buf_use_size;  /* useable size */
 	struct bnxt_rx_ring_info	*rx_ring;
 	struct bnxt_cp_ring_info	*cp_ring;
+	rte_atomic64_t		rx_mbuf_alloc_fail;
 };
 
 void bnxt_free_rxq_stats(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index d9b4d768d..4bc320430 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -41,7 +41,7 @@ static inline int bnxt_alloc_rx_data(struct bnxt_rx_queue *rxq,
 
 	mbuf = __bnxt_alloc_rx_data(rxq->mb_pool);
 	if (!mbuf) {
-		rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail);
+		rte_atomic64_inc(&rxq->rx_mbuf_alloc_fail);
 		return -ENOMEM;
 	}
 
@@ -62,7 +62,7 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq,
 
 	mbuf = __bnxt_alloc_rx_data(rxq->mb_pool);
 	if (!mbuf) {
-		rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail);
+		rte_atomic64_inc(&rxq->rx_mbuf_alloc_fail);
 		return -ENOMEM;
 	}
 
@@ -299,7 +299,7 @@ static inline struct rte_mbuf *bnxt_tpa_end(
 	struct rte_mbuf *new_data = __bnxt_alloc_rx_data(rxq->mb_pool);
 	RTE_ASSERT(new_data != NULL);
 	if (!new_data) {
-		rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail);
+		rte_atomic64_inc(&rxq->rx_mbuf_alloc_fail);
 		return NULL;
 	}
 	tpa_info->mbuf = new_data;
@@ -767,7 +767,7 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
 			rxr->tpa_info[i].mbuf =
 				__bnxt_alloc_rx_data(rxq->mb_pool);
 			if (!rxr->tpa_info[i].mbuf) {
-				rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail);
+				rte_atomic64_inc(&rxq->rx_mbuf_alloc_fail);
 				return -ENOMEM;
 			}
 		}
diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 5a1c07388..1b586f333 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -221,6 +221,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 				     bnxt_stats, 1);
 		if (unlikely(rc))
 			return rc;
+		bnxt_stats->rx_nombuf +=
+				rte_atomic64_read(&rxq->rx_mbuf_alloc_fail);
 	}
 
 	for (i = 0; i < bp->tx_cp_nr_rings; i++) {
@@ -235,13 +237,13 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 	rc = bnxt_hwrm_func_qstats(bp, 0xffff, bnxt_stats);
 	if (unlikely(rc))
 		return rc;
-	bnxt_stats->rx_nombuf = rte_atomic64_read(&bp->rx_mbuf_alloc_fail);
 	return rc;
 }
 
 void bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
+	unsigned int i;
 
 	if (!(bp->flags & BNXT_FLAG_INIT_DONE)) {
 		PMD_DRV_LOG(ERR, "Device Initialization not complete!\n");
@@ -249,7 +251,11 @@ void bnxt_stats_reset_op(struct rte_eth_dev *eth_dev)
 	}
 
 	bnxt_clear_all_hwrm_stat_ctxs(bp);
-	rte_atomic64_clear(&bp->rx_mbuf_alloc_fail);
+	for (i = 0; i < bp->rx_cp_nr_rings; i++) {
+		struct bnxt_rx_queue *rxq = bp->rx_queues[i];
+
+		rte_atomic64_clear(&rxq->rx_mbuf_alloc_fail);
+	}
 }
 
 int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 10/14] net/bnxt: reset l2_filter_id once filter is freed
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (8 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 09/14] net/bnxt: maintain rx_mbuf_alloc_fail per RxQ Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 11/14] net/bnxt: free memory allocated for VF filters Ajit Khaparde
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: stable

The fw_l2_filter_id for a ntuple filter is needed only for the lifetime
of the ntuple filter. Once the filter is free, reset the field.
The associated l2_filter will be freed as a part of its own cleanup.

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org

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 3a326d4f5..c7a6157d9 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3696,6 +3696,7 @@ int bnxt_hwrm_clear_ntuple_filter(struct bnxt *bp,
 	HWRM_UNLOCK();
 
 	filter->fw_ntuple_filter_id = -1;
+	filter->fw_l2_filter_id = UINT64_MAX;
 
 	return 0;
 }
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 11/14] net/bnxt: free memory allocated for VF filters
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (9 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 10/14] net/bnxt: reset l2_filter_id once filter is freed Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 12/14] net/bnxt: use UINT64_MAX to initialize filter ids Ajit Khaparde
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: stable

Memory allocated to hold VF filter info is not being freed currently.
This can cause potential memory leak.
Fixes: 7a5b0874440e ("net/bnxt: support to add a VF MAC address")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 179349539..c92806b4f 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -131,6 +131,14 @@ void bnxt_free_filter_mem(struct bnxt *bp)
 
 	rte_free(bp->filter_info);
 	bp->filter_info = NULL;
+
+	for (i = 0; i < bp->pf.max_vfs; i++) {
+		STAILQ_FOREACH(filter, &bp->pf.vf_info[i].filter, next) {
+			rte_free(filter);
+			STAILQ_REMOVE(&bp->pf.vf_info[i].filter, filter,
+				      bnxt_filter_info, next);
+		}
+	}
 }
 
 int bnxt_alloc_filter_mem(struct bnxt *bp)
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 12/14] net/bnxt: use UINT64_MAX to initialize filter ids
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (10 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 11/14] net/bnxt: free memory allocated for VF filters Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 13/14] net/bnxt: avoid freeing mem_zone multiple times Ajit Khaparde
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev

Use UINT64_MAX to initialize l2, ntuple, em filter_id fields
instead of hardcoded -1;

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_filter.c | 8 ++++----
 drivers/net/bnxt/bnxt_hwrm.c   | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index c92806b4f..9351460c2 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -68,9 +68,9 @@ void bnxt_init_filters(struct bnxt *bp)
 	STAILQ_INIT(&bp->free_filter_list);
 	for (i = 0; i < max_filters; i++) {
 		filter = &bp->filter_info[i];
-		filter->fw_l2_filter_id = -1;
-		filter->fw_em_filter_id = -1;
-		filter->fw_ntuple_filter_id = -1;
+		filter->fw_l2_filter_id = UINT64_MAX;
+		filter->fw_em_filter_id = UINT64_MAX;
+		filter->fw_ntuple_filter_id = UINT64_MAX;
 		STAILQ_INSERT_TAIL(&bp->free_filter_list, filter, next);
 	}
 }
@@ -963,7 +963,7 @@ bnxt_flow_validate(struct rte_eth_dev *dev,
 	ret = bnxt_validate_and_parse_flow(dev, pattern, actions, attr,
 					   error, filter);
 	/* No need to hold on to this filter if we are just validating flow */
-	filter->fw_l2_filter_id = -1;
+	filter->fw_l2_filter_id = UINT64_MAX;
 	bnxt_free_filter(bp, filter);
 
 	return ret;
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index c7a6157d9..11204bf42 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -317,7 +317,7 @@ int bnxt_hwrm_clear_l2_filter(struct bnxt *bp,
 	HWRM_CHECK_RESULT();
 	HWRM_UNLOCK();
 
-	filter->fw_l2_filter_id = -1;
+	filter->fw_l2_filter_id = UINT64_MAX;
 
 	return 0;
 }
@@ -3583,8 +3583,8 @@ int bnxt_hwrm_clear_em_filter(struct bnxt *bp, struct bnxt_filter_info *filter)
 	HWRM_CHECK_RESULT();
 	HWRM_UNLOCK();
 
-	filter->fw_em_filter_id = -1;
-	filter->fw_l2_filter_id = -1;
+	filter->fw_em_filter_id = UINT64_MAX;
+	filter->fw_l2_filter_id = UINT64_MAX;
 
 	return 0;
 }
@@ -3695,7 +3695,7 @@ int bnxt_hwrm_clear_ntuple_filter(struct bnxt *bp,
 	HWRM_CHECK_RESULT();
 	HWRM_UNLOCK();
 
-	filter->fw_ntuple_filter_id = -1;
+	filter->fw_ntuple_filter_id = UINT64_MAX;
 	filter->fw_l2_filter_id = UINT64_MAX;
 
 	return 0;
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 13/14] net/bnxt: avoid freeing mem_zone multiple times
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (11 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 12/14] net/bnxt: use UINT64_MAX to initialize filter ids Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17  1:11 ` [PATCH 14/14] bnxt: add device ID for Stratus VF Ajit Khaparde
  2018-04-17 18:19 ` [PATCH 00/14] bnxt patchset Ferruh Yigit
  14 siblings, 0 replies; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: stable

Since we are storing the mem_zone address for each ring created,
we are freeing the same address multiple times.
For example the memory zone created for Rx is being freed during
Rx ring cleanup, AGG ring cleanup and CQ cleanup.
Avoid this by storing the memory zone address in RXQ instead and
free it as a part of queue_release dev_op.
In the same way do the same for TX queues as well.

Fixes: 51c87ebafc7d ("net/bnxt: add Tx queue create/destroy")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.c | 10 +++++++---
 drivers/net/bnxt/bnxt_ring.h |  4 ++--
 drivers/net/bnxt/bnxt_rxq.c  |  4 +++-
 drivers/net/bnxt/bnxt_rxq.h  |  1 +
 drivers/net/bnxt/bnxt_txq.c  |  4 +++-
 drivers/net/bnxt/bnxt_txq.h  |  1 +
 6 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c
index 4998c610a..478eab4f3 100644
--- a/drivers/net/bnxt/bnxt_ring.c
+++ b/drivers/net/bnxt/bnxt_ring.c
@@ -28,7 +28,7 @@ void bnxt_free_ring(struct bnxt_ring *ring)
 		memset((char *)*ring->vmem, 0, ring->vmem_size);
 		*ring->vmem = NULL;
 	}
-	rte_memzone_free((const struct rte_memzone *)ring->mem_zone);
+	ring->mem_zone = NULL;
 }
 
 /*
@@ -61,12 +61,14 @@ int bnxt_init_ring_grps(struct bnxt *bp)
  * rx bd ring - Only non-zero length if rx_ring_info is not NULL
  */
 int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
-			    struct bnxt_tx_ring_info *tx_ring_info,
-			    struct bnxt_rx_ring_info *rx_ring_info,
+			    struct bnxt_tx_queue *txq,
+			    struct bnxt_rx_queue *rxq,
 			    struct bnxt_cp_ring_info *cp_ring_info,
 			    const char *suffix)
 {
 	struct bnxt_ring *cp_ring = cp_ring_info->cp_ring_struct;
+	struct bnxt_rx_ring_info *rx_ring_info = rxq ? rxq->rx_ring : NULL;
+	struct bnxt_tx_ring_info *tx_ring_info = txq ? txq->tx_ring : NULL;
 	struct bnxt_ring *tx_ring;
 	struct bnxt_ring *rx_ring;
 	struct rte_pci_device *pdev = bp->pdev;
@@ -165,6 +167,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
 	}
 
 	if (tx_ring_info) {
+		txq->mz = mz;
 		tx_ring = tx_ring_info->tx_ring_struct;
 
 		tx_ring->bd = ((char *)mz->addr + tx_ring_start);
@@ -184,6 +187,7 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
 	}
 
 	if (rx_ring_info) {
+		rxq->mz = mz;
 		rx_ring = rx_ring_info->rx_ring_struct;
 
 		rx_ring->bd = ((char *)mz->addr + rx_ring_start);
diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index d70eb64de..6c86259e8 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -65,8 +65,8 @@ struct bnxt_cp_ring_info;
 void bnxt_free_ring(struct bnxt_ring *ring);
 int bnxt_init_ring_grps(struct bnxt *bp);
 int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx,
-			    struct bnxt_tx_ring_info *tx_ring_info,
-			    struct bnxt_rx_ring_info *rx_ring_info,
+			    struct bnxt_tx_queue *txq,
+			    struct bnxt_rx_queue *rxq,
 			    struct bnxt_cp_ring_info *cp_ring_info,
 			    const char *suffix);
 int bnxt_alloc_hwrm_rings(struct bnxt *bp);
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index d797a47e9..e939c9ac0 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -267,6 +267,8 @@ void bnxt_rx_queue_release_op(void *rx_queue)
 		bnxt_free_ring(rxq->cp_ring->cp_ring_struct);
 
 		bnxt_free_rxq_stats(rxq);
+		rte_memzone_free(rxq->mz);
+		rxq->mz = NULL;
 
 		rte_free(rxq);
 	}
@@ -328,7 +330,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
 	eth_dev->data->rx_queues[queue_idx] = rxq;
 	/* Allocate RX ring hardware descriptors */
-	if (bnxt_alloc_rings(bp, queue_idx, NULL, rxq->rx_ring, rxq->cp_ring,
+	if (bnxt_alloc_rings(bp, queue_idx, NULL, rxq, rxq->cp_ring,
 			"rxr")) {
 		PMD_DRV_LOG(ERR,
 			"ring_dma_zone_reserve for rx_ring failed!\n");
diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h
index 3350d7719..8307f603c 100644
--- a/drivers/net/bnxt/bnxt_rxq.h
+++ b/drivers/net/bnxt/bnxt_rxq.h
@@ -33,6 +33,7 @@ struct bnxt_rx_queue {
 	struct bnxt_rx_ring_info	*rx_ring;
 	struct bnxt_cp_ring_info	*cp_ring;
 	rte_atomic64_t		rx_mbuf_alloc_fail;
+	const struct rte_memzone *mz;
 };
 
 void bnxt_free_rxq_stats(struct bnxt_rx_queue *rxq);
diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c
index 37531ea49..07e25d77b 100644
--- a/drivers/net/bnxt/bnxt_txq.c
+++ b/drivers/net/bnxt/bnxt_txq.c
@@ -65,6 +65,8 @@ void bnxt_tx_queue_release_op(void *tx_queue)
 		bnxt_free_ring(txq->cp_ring->cp_ring_struct);
 
 		bnxt_free_txq_stats(txq);
+		rte_memzone_free(txq->mz);
+		txq->mz = NULL;
 
 		rte_free(txq);
 	}
@@ -119,7 +121,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 	txq->port_id = eth_dev->data->port_id;
 
 	/* Allocate TX ring hardware descriptors */
-	if (bnxt_alloc_rings(bp, queue_idx, txq->tx_ring, NULL, txq->cp_ring,
+	if (bnxt_alloc_rings(bp, queue_idx, txq, NULL, txq->cp_ring,
 			"txr")) {
 		PMD_DRV_LOG(ERR, "ring_dma_zone_reserve for tx_ring failed!");
 		bnxt_tx_queue_release_op(txq);
diff --git a/drivers/net/bnxt/bnxt_txq.h b/drivers/net/bnxt/bnxt_txq.h
index 47bbef1e7..8df87148f 100644
--- a/drivers/net/bnxt/bnxt_txq.h
+++ b/drivers/net/bnxt/bnxt_txq.h
@@ -33,6 +33,7 @@ struct bnxt_tx_queue {
 
 	unsigned int		cp_nr_rings;
 	struct bnxt_cp_ring_info	*cp_ring;
+	const struct rte_memzone *mz;
 };
 
 void bnxt_free_txq_stats(struct bnxt_tx_queue *txq);
-- 
2.15.1 (Apple Git-101)

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

* [PATCH 14/14] bnxt: add device ID for Stratus VF
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (12 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 13/14] net/bnxt: avoid freeing mem_zone multiple times Ajit Khaparde
@ 2018-04-17  1:11 ` Ajit Khaparde
  2018-04-17 18:20   ` Ferruh Yigit
  2018-04-17 18:19 ` [PATCH 00/14] bnxt patchset Ferruh Yigit
  14 siblings, 1 reply; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17  1:11 UTC (permalink / raw)
  To: dev; +Cc: Somnath Kotur, ajit.khaparde

From: Somnath Kotur <somnath.kotur@broadcom.com>

Fixes: 1cd45aeb3270 ("net/bnxt: support Stratus VF device")
Cc: ajit.khaparde@broadcom.com
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3cf845089..7632c326b 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -34,7 +34,8 @@ int bnxt_logtype_driver;
 
 #define PCI_VENDOR_ID_BROADCOM 0x14E4
 
-#define BROADCOM_DEV_ID_STRATUS_NIC_VF 0x1609
+#define BROADCOM_DEV_ID_STRATUS_NIC_VF1 0x1606
+#define BROADCOM_DEV_ID_STRATUS_NIC_VF2 0x1609
 #define BROADCOM_DEV_ID_STRATUS_NIC 0x1614
 #define BROADCOM_DEV_ID_57414_VF 0x16c1
 #define BROADCOM_DEV_ID_57301 0x16c8
@@ -75,7 +76,9 @@ int bnxt_logtype_driver;
 
 static const struct rte_pci_id bnxt_pci_id_map[] = {
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
-			 BROADCOM_DEV_ID_STRATUS_NIC_VF) },
+			 BROADCOM_DEV_ID_STRATUS_NIC_VF1) },
+	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
+			 BROADCOM_DEV_ID_STRATUS_NIC_VF2) },
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_STRATUS_NIC) },
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414_VF) },
 	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
@@ -3063,7 +3066,8 @@ static bool bnxt_vf_pciid(uint16_t id)
 	    id == BROADCOM_DEV_ID_5731X_VF ||
 	    id == BROADCOM_DEV_ID_5741X_VF ||
 	    id == BROADCOM_DEV_ID_57414_VF ||
-	    id == BROADCOM_DEV_ID_STRATUS_NIC_VF)
+	    id == BROADCOM_DEV_ID_STRATUS_NIC_VF1 ||
+	    id == BROADCOM_DEV_ID_STRATUS_NIC_VF2)
 		return true;
 	return false;
 }
-- 
2.15.1 (Apple Git-101)

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

* Re: [PATCH 00/14] bnxt patchset
  2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
                   ` (13 preceding siblings ...)
  2018-04-17  1:11 ` [PATCH 14/14] bnxt: add device ID for Stratus VF Ajit Khaparde
@ 2018-04-17 18:19 ` Ferruh Yigit
  14 siblings, 0 replies; 19+ messages in thread
From: Ferruh Yigit @ 2018-04-17 18:19 UTC (permalink / raw)
  To: Ajit Khaparde, dev

On 4/17/2018 2:11 AM, Ajit Khaparde wrote:
> patchset against dpdk-next-net.
> Please apply.
> 
> Thanks
> 
> Ajit Khaparde (13):
>   net/bnxt: set default log level to informational
>   net/bnxt: set padding flags in Rx descriptor
>   net/bnxt: fix bnxt_hwrm_vnic_alloc
>   net/bnxt: fix incorrect ntuple flag setting
>   net/bnxt: fix Rx checksum flags for tunnel frames
>   net/bnxt: fix L2 filter cleanup
>   net/bnxt: fix bnxt_flow_destroy
>   net/bnxt: add code to determine the Tx COS queue
>   net/bnxt: maintain rx_mbuf_alloc_fail per RxQ
>   net/bnxt: reset l2_filter_id once filter is freed
>   net/bnxt: free memory allocated for VF filters
>   net/bnxt: use UINT64_MAX to initialize filter ids
>   net/bnxt: avoid freeing mem_zone multiple times
> 
> Somnath Kotur (1):
>   bnxt: add device ID for Stratus VF

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

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

* Re: [PATCH 14/14] bnxt: add device ID for Stratus VF
  2018-04-17  1:11 ` [PATCH 14/14] bnxt: add device ID for Stratus VF Ajit Khaparde
@ 2018-04-17 18:20   ` Ferruh Yigit
  2018-04-17 18:25     ` Ajit Khaparde
  0 siblings, 1 reply; 19+ messages in thread
From: Ferruh Yigit @ 2018-04-17 18:20 UTC (permalink / raw)
  To: Ajit Khaparde, dev; +Cc: Somnath Kotur

On 4/17/2018 2:11 AM, Ajit Khaparde wrote:
> From: Somnath Kotur <somnath.kotur@broadcom.com>
> 

This is adding new device id to driver.
Does it require any change in documentation?
Do you want to announce new hw support in release notes?

> Fixes: 1cd45aeb3270 ("net/bnxt: support Stratus VF device")
> Cc: ajit.khaparde@broadcom.com
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 3cf845089..7632c326b 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -34,7 +34,8 @@ int bnxt_logtype_driver;
>  
>  #define PCI_VENDOR_ID_BROADCOM 0x14E4
>  
> -#define BROADCOM_DEV_ID_STRATUS_NIC_VF 0x1609
> +#define BROADCOM_DEV_ID_STRATUS_NIC_VF1 0x1606
> +#define BROADCOM_DEV_ID_STRATUS_NIC_VF2 0x1609
>  #define BROADCOM_DEV_ID_STRATUS_NIC 0x1614
>  #define BROADCOM_DEV_ID_57414_VF 0x16c1
>  #define BROADCOM_DEV_ID_57301 0x16c8
> @@ -75,7 +76,9 @@ int bnxt_logtype_driver;
>  
>  static const struct rte_pci_id bnxt_pci_id_map[] = {
>  	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
> -			 BROADCOM_DEV_ID_STRATUS_NIC_VF) },
> +			 BROADCOM_DEV_ID_STRATUS_NIC_VF1) },
> +	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
> +			 BROADCOM_DEV_ID_STRATUS_NIC_VF2) },
>  	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_STRATUS_NIC) },
>  	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414_VF) },
>  	{ RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
> @@ -3063,7 +3066,8 @@ static bool bnxt_vf_pciid(uint16_t id)
>  	    id == BROADCOM_DEV_ID_5731X_VF ||
>  	    id == BROADCOM_DEV_ID_5741X_VF ||
>  	    id == BROADCOM_DEV_ID_57414_VF ||
> -	    id == BROADCOM_DEV_ID_STRATUS_NIC_VF)
> +	    id == BROADCOM_DEV_ID_STRATUS_NIC_VF1 ||
> +	    id == BROADCOM_DEV_ID_STRATUS_NIC_VF2)
>  		return true;
>  	return false;
>  }
> 

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

* Re: [PATCH 14/14] bnxt: add device ID for Stratus VF
  2018-04-17 18:20   ` Ferruh Yigit
@ 2018-04-17 18:25     ` Ajit Khaparde
  2018-04-17 18:29       ` Ferruh Yigit
  0 siblings, 1 reply; 19+ messages in thread
From: Ajit Khaparde @ 2018-04-17 18:25 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Somnath Kotur

​No Ferruh. It is not a new product family​.
Just adding a device ID (for a VF) for a skew of already existing product.
So a documentation update is not required.

Thanks
Ajit

On Tue, Apr 17, 2018 at 11:20 AM, Ferruh Yigit <ferruh.yigit@intel.com>
wrote:

> On 4/17/2018 2:11 AM, Ajit Khaparde wrote:
> > From: Somnath Kotur <somnath.kotur@broadcom.com>
> >
>
> This is adding new device id to driver.
> Does it require any change in documentation?
> Do you want to announce new hw support in release notes?
>
> > Fixes: 1cd45aeb3270 ("net/bnxt: support Stratus VF device")
> > Cc: ajit.khaparde@broadcom.com
> > Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> > ---
> >  drivers/net/bnxt/bnxt_ethdev.c | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_
> ethdev.c
> > index 3cf845089..7632c326b 100644
> > --- a/drivers/net/bnxt/bnxt_ethdev.c
> > +++ b/drivers/net/bnxt/bnxt_ethdev.c
> > @@ -34,7 +34,8 @@ int bnxt_logtype_driver;
> >
> >  #define PCI_VENDOR_ID_BROADCOM 0x14E4
> >
> > -#define BROADCOM_DEV_ID_STRATUS_NIC_VF 0x1609
> > +#define BROADCOM_DEV_ID_STRATUS_NIC_VF1 0x1606
> > +#define BROADCOM_DEV_ID_STRATUS_NIC_VF2 0x1609
> >  #define BROADCOM_DEV_ID_STRATUS_NIC 0x1614
> >  #define BROADCOM_DEV_ID_57414_VF 0x16c1
> >  #define BROADCOM_DEV_ID_57301 0x16c8
> > @@ -75,7 +76,9 @@ int bnxt_logtype_driver;
> >
> >  static const struct rte_pci_id bnxt_pci_id_map[] = {
> >       { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
> > -                      BROADCOM_DEV_ID_STRATUS_NIC_VF) },
> > +                      BROADCOM_DEV_ID_STRATUS_NIC_VF1) },
> > +     { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
> > +                      BROADCOM_DEV_ID_STRATUS_NIC_VF2) },
> >       { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
> BROADCOM_DEV_ID_STRATUS_NIC) },
> >       { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
> BROADCOM_DEV_ID_57414_VF) },
> >       { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
> > @@ -3063,7 +3066,8 @@ static bool bnxt_vf_pciid(uint16_t id)
> >           id == BROADCOM_DEV_ID_5731X_VF ||
> >           id == BROADCOM_DEV_ID_5741X_VF ||
> >           id == BROADCOM_DEV_ID_57414_VF ||
> > -         id == BROADCOM_DEV_ID_STRATUS_NIC_VF)
> > +         id == BROADCOM_DEV_ID_STRATUS_NIC_VF1 ||
> > +         id == BROADCOM_DEV_ID_STRATUS_NIC_VF2)
> >               return true;
> >       return false;
> >  }
> >
>
>

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

* Re: [PATCH 14/14] bnxt: add device ID for Stratus VF
  2018-04-17 18:25     ` Ajit Khaparde
@ 2018-04-17 18:29       ` Ferruh Yigit
  0 siblings, 0 replies; 19+ messages in thread
From: Ferruh Yigit @ 2018-04-17 18:29 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: dev, Somnath Kotur

On 4/17/2018 7:25 PM, Ajit Khaparde wrote:
> ​No Ferruh. It is not a new product family​.
> Just adding a device ID (for a VF) for a skew of already existing product.
> So a documentation update is not required.

OK, thanks for clarification.

> 
> Thanks
> Ajit
> 
> On Tue, Apr 17, 2018 at 11:20 AM, Ferruh Yigit <ferruh.yigit@intel.com
> <mailto:ferruh.yigit@intel.com>> wrote:
> 
>     On 4/17/2018 2:11 AM, Ajit Khaparde wrote:
>     > From: Somnath Kotur <somnath.kotur@broadcom.com
>     <mailto:somnath.kotur@broadcom.com>>
>     >
> 
>     This is adding new device id to driver.
>     Does it require any change in documentation?
>     Do you want to announce new hw support in release notes?
> 
>     > Fixes: 1cd45aeb3270 ("net/bnxt: support Stratus VF device")
>     > Cc: ajit.khaparde@broadcom.com <mailto:ajit.khaparde@broadcom.com>
>     > Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com
>     <mailto:somnath.kotur@broadcom.com>>
>     > ---
>     >  drivers/net/bnxt/bnxt_ethdev.c | 10 +++++++---
>     >  1 file changed, 7 insertions(+), 3 deletions(-)
>     >
>     > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
>     > index 3cf845089..7632c326b 100644
>     > --- a/drivers/net/bnxt/bnxt_ethdev.c
>     > +++ b/drivers/net/bnxt/bnxt_ethdev.c
>     > @@ -34,7 +34,8 @@ int bnxt_logtype_driver;
>     > 
>     >  #define PCI_VENDOR_ID_BROADCOM 0x14E4
>     > 
>     > -#define BROADCOM_DEV_ID_STRATUS_NIC_VF 0x1609
>     > +#define BROADCOM_DEV_ID_STRATUS_NIC_VF1 0x1606
>     > +#define BROADCOM_DEV_ID_STRATUS_NIC_VF2 0x1609
>     >  #define BROADCOM_DEV_ID_STRATUS_NIC 0x1614
>     >  #define BROADCOM_DEV_ID_57414_VF 0x16c1
>     >  #define BROADCOM_DEV_ID_57301 0x16c8
>     > @@ -75,7 +76,9 @@ int bnxt_logtype_driver;
>     > 
>     >  static const struct rte_pci_id bnxt_pci_id_map[] = {
>     >       { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
>     > -                      BROADCOM_DEV_ID_STRATUS_NIC_VF) },
>     > +                      BROADCOM_DEV_ID_STRATUS_NIC_VF1) },
>     > +     { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM,
>     > +                      BROADCOM_DEV_ID_STRATUS_NIC_VF2) },
>     >       { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_STRATUS_NIC) },
>     >       { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57414_VF) },
>     >       { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_57301) },
>     > @@ -3063,7 +3066,8 @@ static bool bnxt_vf_pciid(uint16_t id)
>     >           id == BROADCOM_DEV_ID_5731X_VF ||
>     >           id == BROADCOM_DEV_ID_5741X_VF ||
>     >           id == BROADCOM_DEV_ID_57414_VF ||
>     > -         id == BROADCOM_DEV_ID_STRATUS_NIC_VF)
>     > +         id == BROADCOM_DEV_ID_STRATUS_NIC_VF1 ||
>     > +         id == BROADCOM_DEV_ID_STRATUS_NIC_VF2)
>     >               return true;
>     >       return false;
>     >  }
>     >
> 
> 

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

end of thread, other threads:[~2018-04-17 18:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17  1:11 [PATCH 00/14] bnxt patchset Ajit Khaparde
2018-04-17  1:11 ` [PATCH 01/14] net/bnxt: set default log level to informational Ajit Khaparde
2018-04-17  1:11 ` [PATCH 02/14] net/bnxt: set padding flags in Rx descriptor Ajit Khaparde
2018-04-17  1:11 ` [PATCH 03/14] net/bnxt: fix bnxt_hwrm_vnic_alloc Ajit Khaparde
2018-04-17  1:11 ` [PATCH 04/14] net/bnxt: fix incorrect ntuple flag setting Ajit Khaparde
2018-04-17  1:11 ` [PATCH 05/14] net/bnxt: fix Rx checksum flags for tunnel frames Ajit Khaparde
2018-04-17  1:11 ` [PATCH 06/14] net/bnxt: fix L2 filter cleanup Ajit Khaparde
2018-04-17  1:11 ` [PATCH 07/14] net/bnxt: fix bnxt_flow_destroy Ajit Khaparde
2018-04-17  1:11 ` [PATCH 08/14] net/bnxt: add code to determine the Tx COS queue Ajit Khaparde
2018-04-17  1:11 ` [PATCH 09/14] net/bnxt: maintain rx_mbuf_alloc_fail per RxQ Ajit Khaparde
2018-04-17  1:11 ` [PATCH 10/14] net/bnxt: reset l2_filter_id once filter is freed Ajit Khaparde
2018-04-17  1:11 ` [PATCH 11/14] net/bnxt: free memory allocated for VF filters Ajit Khaparde
2018-04-17  1:11 ` [PATCH 12/14] net/bnxt: use UINT64_MAX to initialize filter ids Ajit Khaparde
2018-04-17  1:11 ` [PATCH 13/14] net/bnxt: avoid freeing mem_zone multiple times Ajit Khaparde
2018-04-17  1:11 ` [PATCH 14/14] bnxt: add device ID for Stratus VF Ajit Khaparde
2018-04-17 18:20   ` Ferruh Yigit
2018-04-17 18:25     ` Ajit Khaparde
2018-04-17 18:29       ` Ferruh Yigit
2018-04-17 18:19 ` [PATCH 00/14] bnxt patchset Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.