DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 00/10] patchset for bnxt
@ 2024-02-21 21:20 Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 01/10] net/bnxt: extend long bd check for VXLAN GPE Ajit Khaparde
                   ` (10 more replies)
  0 siblings, 11 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]

Apart from some fixes, this patchset adds support for
RSS based on IPV6 flow label.
This set also updates the 24.03 release notes.

Ajit Khaparde (8):
  net/bnxt: extend long bd check for VXLAN GPE
  net/bnxt: increase queue size for async handling
  net/bnxt: fix AGG ID computation
  net/bnxt: handle UDP GSO Tx
  net/bnxt: add IPv6 flow label based RSS support
  net/bnxt: fix compressed CQE handling
  net/bnxt: fix compressed Rx CQE handling
  doc: update release notes for bnxt

Kalesh AP (2):
  net/bnxt: add dual rate module detection log
  net/bnxt: fix a null pointer dereference

 doc/guides/rel_notes/release_24_03.rst |   4 +
 drivers/net/bnxt/bnxt.h                |   1 +
 drivers/net/bnxt/bnxt_cpr.c            |   4 +
 drivers/net/bnxt/bnxt_ethdev.c         |   2 +
 drivers/net/bnxt/bnxt_hwrm.c           |  10 ++-
 drivers/net/bnxt/bnxt_reps.c           |  19 +++--
 drivers/net/bnxt/bnxt_ring.h           |   2 +-
 drivers/net/bnxt/bnxt_rxr.h            |   2 +-
 drivers/net/bnxt/bnxt_rxtx_vec_avx2.c  |  39 +++++----
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c   | 107 ++++++++++++++++++++++++-
 drivers/net/bnxt/bnxt_txr.c            |   3 +-
 drivers/net/bnxt/bnxt_vnic.c           |   9 ++-
 drivers/net/bnxt/hsi_struct_def_dpdk.h |   8 +-
 13 files changed, 180 insertions(+), 30 deletions(-)

-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 01/10] net/bnxt: extend long bd check for VXLAN GPE
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 02/10] net/bnxt: add dual rate module detection log Ajit Khaparde
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas, Kalesh AP

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

Extend long Tx BD check for VXLAN GPE packets.
This will allow the long BD to be selected for Tx with
VXLAN GPE frames.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt_txr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 7fc44e989d..7cbb2104a0 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -116,7 +116,7 @@ bnxt_xmit_need_long_bd(struct rte_mbuf *tx_pkt, struct bnxt_tx_queue *txq)
 				RTE_MBUF_F_TX_VLAN | RTE_MBUF_F_TX_OUTER_IP_CKSUM |
 				RTE_MBUF_F_TX_TUNNEL_GRE | RTE_MBUF_F_TX_TUNNEL_VXLAN |
 				RTE_MBUF_F_TX_TUNNEL_GENEVE | RTE_MBUF_F_TX_IEEE1588_TMST |
-				RTE_MBUF_F_TX_QINQ) ||
+				RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE) ||
 	     (BNXT_TRUFLOW_EN(txq->bp) &&
 	      (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action)))
 		return true;
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 02/10] net/bnxt: add dual rate module detection log
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 01/10] net/bnxt: extend long bd check for VXLAN GPE Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 03/10] net/bnxt: increase queue size for async handling Ajit Khaparde
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas, Kalesh AP

[-- Attachment #1: Type: text/plain, Size: 2245 bytes --]

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

Firmware sends an async notification to the driver when it detects
a Dual rate module.

Display below warning message:
"Speed change not supported with dual rate transceivers on this board"

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.c            | 4 ++++
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index fb43bc58da..a4509abd60 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -100,6 +100,10 @@ static void bnxt_handle_event_error_report(struct bnxt *bp,
 		PMD_DRV_LOG(WARNING, "Port:%d Pause Storm detected!\n",
 			    bp->eth_dev->data->port_id);
 		break;
+	case HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED:
+		PMD_DRV_LOG(WARNING, "Port:%d Speed change not supported with dual rate transceivers on this board",
+			    bp->eth_dev->data->port_id);
+		break;
 	default:
 		PMD_DRV_LOG(INFO, "FW reported unknown error type data1 %d"
 			    " data2: %d\n", data1, data2);
diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h
index 3ee1844e66..9beacd94aa 100644
--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h
+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h
@@ -12494,8 +12494,14 @@ struct hwrm_async_event_cmpl_error_report_base {
 	 */
 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD \
 		UINT32_C(0x5)
+	/*
+	 * Speed change not supported with dual rate transceivers
+	 * on this board.
+	 */
+	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED \
+		UINT32_C(0x6)
 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST \
-		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD
+		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED
 } __rte_packed;
 
 /* hwrm_async_event_cmpl_error_report_pause_storm (size:128b/16B) */
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 03/10] net/bnxt: increase queue size for async handling
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 01/10] net/bnxt: extend long bd check for VXLAN GPE Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 02/10] net/bnxt: add dual rate module detection log Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 04/10] net/bnxt: fix AGG ID computation Ajit Khaparde
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas, Damodharam Ammepalli

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

Increase the default NQ/CQ depth for async handling.
In some cases the hardware can generate a high number of
async notifications. Increase the notification/completion queue
size to accommodate them.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index baa60b2627..1bae4b33d9 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -24,7 +24,7 @@
 #define DB_KEY_TX_PUSH						(0x4 << 28)
 #define DB_LONG_TX_PUSH						(0x2 << 24)
 
-#define DEFAULT_CP_RING_SIZE	256
+#define DEFAULT_CP_RING_SIZE	4096
 #define DEFAULT_RX_RING_SIZE	256
 #define DEFAULT_TX_RING_SIZE	256
 
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 04/10] net/bnxt: fix AGG ID computation
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
                   ` (2 preceding siblings ...)
  2024-02-21 21:20 ` [PATCH 03/10] net/bnxt: increase queue size for async handling Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 05/10] net/bnxt: fix a null pointer dereference Ajit Khaparde
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

Fix the computation of AGG ID for P5 and P7 device families.
The AGG ID for TPA completions for P7 device family is being
incorrectly obtained. Fix the code to handle it.

Fixes: 3b56c3ffc182 ("net/bnxt: refactor code to support P7 devices")

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

diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index d36cbded1d..5e5496964f 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -17,7 +17,7 @@
 static inline uint16_t bnxt_tpa_start_agg_id(struct bnxt *bp,
 					     struct rx_tpa_start_cmpl *cmp)
 {
-	if (BNXT_CHIP_P5(bp))
+	if (BNXT_CHIP_P5_P7(bp))
 		return BNXT_TPA_START_AGG_ID_TH(cmp);
 	else
 		return BNXT_TPA_START_AGG_ID_PRE_TH(cmp);
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 05/10] net/bnxt: fix a null pointer dereference
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
                   ` (3 preceding siblings ...)
  2024-02-21 21:20 ` [PATCH 04/10] net/bnxt: fix AGG ID computation Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 06/10] net/bnxt: handle UDP GSO Tx Ajit Khaparde
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas, Kalesh AP, stable, Somnath Kotur

[-- Attachment #1: Type: text/plain, Size: 2400 bytes --]

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

In the recent changes to rte_eth_dev_release_port() the library sets
eth_dev->data to NULL at the end of the routine. This causes a NULL
pointer dereference in the bnxt_rep_dev_info_get_op() and
bnxt_representor_uninit() routines when it tries to validate parent dev.

Add code to handle this.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c
index 3a4720bc3c..edcc27f556 100644
--- a/drivers/net/bnxt/bnxt_reps.c
+++ b/drivers/net/bnxt/bnxt_reps.c
@@ -32,6 +32,14 @@ static const struct eth_dev_ops bnxt_rep_dev_ops = {
 	.flow_ops_get = bnxt_flow_ops_get_op
 };
 
+static bool bnxt_rep_check_parent(struct bnxt_representor *rep)
+{
+	if (!rep->parent_dev->data->dev_private)
+		return false;
+
+	return true;
+}
+
 uint16_t
 bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf)
 {
@@ -266,12 +274,12 @@ int bnxt_representor_uninit(struct rte_eth_dev *eth_dev)
 	PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR uninit\n", eth_dev->data->port_id);
 	eth_dev->data->mac_addrs = NULL;
 
-	parent_bp = rep->parent_dev->data->dev_private;
-	if (!parent_bp) {
+	if (!bnxt_rep_check_parent(rep)) {
 		PMD_DRV_LOG(DEBUG, "BNXT Port:%d already freed\n",
 			    eth_dev->data->port_id);
 		return 0;
 	}
+	parent_bp = rep->parent_dev->data->dev_private;
 
 	parent_bp->num_reps--;
 	vf_id = rep->vf_id;
@@ -539,11 +547,12 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	int rc = 0;
 
 	/* MAC Specifics */
-	parent_bp = rep_bp->parent_dev->data->dev_private;
-	if (!parent_bp) {
-		PMD_DRV_LOG(ERR, "Rep parent NULL!\n");
+	if (!bnxt_rep_check_parent(rep_bp)) {
+		/* Need not be an error scenario, if parent is closed first */
+		PMD_DRV_LOG(INFO, "Rep parent port does not exist.\n");
 		return rc;
 	}
+	parent_bp = rep_bp->parent_dev->data->dev_private;
 	PMD_DRV_LOG(DEBUG, "Representor dev_info_get_op\n");
 	dev_info->max_mac_addrs = parent_bp->max_l2_ctx;
 	dev_info->max_hash_mac_addrs = 0;
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 06/10] net/bnxt: handle UDP GSO Tx
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
                   ` (4 preceding siblings ...)
  2024-02-21 21:20 ` [PATCH 05/10] net/bnxt: fix a null pointer dereference Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 07/10] net/bnxt: add IPv6 flow label based RSS support Ajit Khaparde
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]

The UDP GSO capability is not being detected and reported
correctly. This is causing UDP GSO to not happen in some cases.
This patch fixes the issue.

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

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 7923d4cbd2..7f49b4b40e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1141,6 +1141,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 
 	bp->max_ring_grps = rte_le_to_cpu_32(resp->max_hw_ring_grps);
 	flags = rte_le_to_cpu_32(resp->flags);
+	flags_ext2 = rte_le_to_cpu_32(resp->flags_ext2);
+
 	if (BNXT_PF(bp)) {
 		bp->pf->port_id = resp->port_id;
 		bp->pf->first_vf_id = rte_le_to_cpu_16(resp->first_vf_id);
@@ -1225,7 +1227,6 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 		PMD_DRV_LOG(DEBUG, "Tunnel parsing capability is disabled, flags : %#x\n",
 			    bp->tunnel_disable_flag);
 
-	flags_ext2 = rte_le_to_cpu_32(resp->flags_ext2);
 	if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED)
 		bp->fw_cap |= BNXT_FW_CAP_RX_ALL_PKT_TS;
 	if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_UDP_GSO_SUPPORTED)
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 7cbb2104a0..83c003d258 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -116,7 +116,8 @@ bnxt_xmit_need_long_bd(struct rte_mbuf *tx_pkt, struct bnxt_tx_queue *txq)
 				RTE_MBUF_F_TX_VLAN | RTE_MBUF_F_TX_OUTER_IP_CKSUM |
 				RTE_MBUF_F_TX_TUNNEL_GRE | RTE_MBUF_F_TX_TUNNEL_VXLAN |
 				RTE_MBUF_F_TX_TUNNEL_GENEVE | RTE_MBUF_F_TX_IEEE1588_TMST |
-				RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE) ||
+				RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE |
+				RTE_MBUF_F_TX_UDP_SEG) ||
 	     (BNXT_TRUFLOW_EN(txq->bp) &&
 	      (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action)))
 		return true;
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 07/10] net/bnxt: add IPv6 flow label based RSS support
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
                   ` (5 preceding siblings ...)
  2024-02-21 21:20 ` [PATCH 06/10] net/bnxt: handle UDP GSO Tx Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 08/10] net/bnxt: fix compressed CQE handling Ajit Khaparde
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 4987 bytes --]

P7 hardware family can support IPv6 flow label based RSS.
Check if the firmware indicates capability bit to support
IPv6 flow label based RSS and parse the RSS hash types
appropriately.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        | 1 +
 drivers/net/bnxt/bnxt_ethdev.c | 2 ++
 drivers/net/bnxt/bnxt_hwrm.c   | 7 +++++++
 drivers/net/bnxt/bnxt_vnic.c   | 9 +++++++--
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index fcf2b8be97..4203e6a055 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -868,6 +868,7 @@ struct bnxt {
 #define BNXT_VNIC_CAP_OUTER_RSS_TRUSTED_VF	BIT(4)
 #define BNXT_VNIC_CAP_XOR_MODE		BIT(5)
 #define BNXT_VNIC_CAP_CHKSM_MODE	BIT(6)
+#define BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE	BIT(7)
 #define BNXT_VNIC_CAP_L2_CQE_MODE	BIT(8)
 #define BNXT_VNIC_CAP_AH_SPI4_CAP	BIT(9)
 #define BNXT_VNIC_CAP_AH_SPI6_CAP	BIT(10)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index f8d83662f4..d5a4312c5b 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1087,6 +1087,8 @@ uint64_t bnxt_eth_rss_support(struct bnxt *bp)
 	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_CHKSM_MODE)
 		support |= RTE_ETH_RSS_IPV4_CHKSUM |
 			   RTE_ETH_RSS_L4_CHKSUM;
+	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE)
+		support |= RTE_ETH_RSS_IPV6_FLOW_LABEL;
 	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_AH_SPI_CAP)
 		support |= RTE_ETH_RSS_AH;
 	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_ESP_SPI_CAP)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 7f49b4b40e..6ea7089a3f 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1308,6 +1308,9 @@ int bnxt_hwrm_vnic_qcaps(struct bnxt *bp)
 	if (flags & HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_TOEPLITZ_CHKSM_CAP)
 		bp->vnic_cap_flags |= BNXT_VNIC_CAP_CHKSM_MODE;
 
+	if (flags & HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPV6_FLOW_LABEL_CAP)
+		bp->vnic_cap_flags |= BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE;
+
 	if (flags & HWRM_VNIC_QCAPS_OUTPUT_FLAGS_L2_CQE_MODE_CAP)
 		bp->vnic_cap_flags |= BNXT_VNIC_CAP_L2_CQE_MODE;
 
@@ -2773,6 +2776,10 @@ static uint32_t bnxt_sanitize_rss_type(struct bnxt *bp, uint32_t types)
 {
 	uint32_t hwrm_type = types;
 
+	if (types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL &&
+	    !(bp->vnic_cap_flags & BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE))
+		hwrm_type &= ~HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL;
+
 	if (types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4 &&
 	    !(bp->vnic_cap_flags & BNXT_VNIC_CAP_ESP_SPI4_CAP))
 		hwrm_type &= ~HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4;
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 5092a7d774..76905ebdd1 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -280,6 +280,8 @@ uint32_t bnxt_rte_to_hwrm_hash_types(uint64_t rte_type)
 		hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6;
 	if (rte_type & RTE_ETH_RSS_NONFRAG_IPV6_UDP)
 		hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6;
+	if (rte_type & RTE_ETH_RSS_IPV6_FLOW_LABEL)
+		hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL;
 	if (rte_type & RTE_ETH_RSS_ESP)
 		hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4 |
 			     HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV6;
@@ -302,6 +304,7 @@ int bnxt_rte_to_hwrm_hash_level(struct bnxt *bp, uint64_t hash_f, uint32_t lvl)
 	bool l3_and_l4 = l3 && l4;
 	bool cksum = !!(hash_f &
 			(RTE_ETH_RSS_IPV4_CHKSUM | RTE_ETH_RSS_L4_CHKSUM));
+	bool fl = !!(hash_f & RTE_ETH_RSS_IPV6_FLOW_LABEL);
 
 	/* If FW has not advertised capability to configure outer/inner
 	 * RSS hashing , just log a message. HW will work in default RSS mode.
@@ -317,12 +320,12 @@ int bnxt_rte_to_hwrm_hash_level(struct bnxt *bp, uint64_t hash_f, uint32_t lvl)
 	switch (lvl) {
 	case BNXT_RSS_LEVEL_INNERMOST:
 		/* Irrespective of what RTE says, FW always does 4 tuple */
-		if (l3_and_l4 || l4 || l3_only || cksum)
+		if (l3_and_l4 || l4 || l3_only || cksum || fl)
 			mode = BNXT_HASH_MODE_INNERMOST;
 		break;
 	case BNXT_RSS_LEVEL_OUTERMOST:
 		/* Irrespective of what RTE says, FW always does 4 tuple */
-		if (l3_and_l4 || l4 || l3_only || cksum)
+		if (l3_and_l4 || l4 || l3_only || cksum || fl)
 			mode = BNXT_HASH_MODE_OUTERMOST;
 		break;
 	default:
@@ -1415,6 +1418,8 @@ void bnxt_hwrm_rss_to_rte_hash_conf(struct bnxt_vnic_info *vnic,
 		*rss_conf |= RTE_ETH_RSS_NONFRAG_IPV6_TCP;
 	if (hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6)
 		*rss_conf |= RTE_ETH_RSS_NONFRAG_IPV6_UDP;
+	if (hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL)
+		*rss_conf |= RTE_ETH_RSS_IPV6_FLOW_LABEL;
 	if (hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV6 ||
 	    hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV4)
 		*rss_conf |= RTE_ETH_RSS_AH;
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 08/10] net/bnxt: fix compressed CQE handling
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
                   ` (6 preceding siblings ...)
  2024-02-21 21:20 ` [PATCH 07/10] net/bnxt: add IPv6 flow label based RSS support Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 09/10] net/bnxt: fix compressed Rx " Ajit Khaparde
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 5480 bytes --]

We were trying to reuse parts of 32-byte CQE handling for
compressed CQE handling. And that was causing the packet
errors to be misinterpreted.

Fix it by using separate code for the compressed CQE handling.

Fixes: 812fd99f8c4e ("net/bnxt: add SSE Rx for compressed CQE")

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

diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index 6c0e33200c..b5ce12659c 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -143,6 +143,109 @@ descs_to_mbufs(__m128i mm_rxcmp[4], __m128i mm_rxcmp1[4],
 	_mm_store_si128((void *)&mbuf[3]->rx_descriptor_fields1, t0);
 }
 
+static inline void
+crx_descs_to_mbufs(__m128i mm_rxcmp[4], __m128i mm_rxcmp1[4],
+		   __m128i mbuf_init, const __m128i shuf_msk,
+		   struct rte_mbuf **mbuf, struct bnxt_rx_ring_info *rxr)
+{
+	const __m128i flags_type_mask =
+		_mm_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_MASK);
+	const __m128i flags2_mask1 =
+		_mm_set1_epi32(CMPL_FLAGS2_VLAN_TUN_MSK_CRX);
+	const __m128i flags2_mask2 =
+		_mm_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_IP_TYPE);
+	const __m128i rss_mask =
+		_mm_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_RSS_VALID);
+	const __m128i cs_err_mask =
+		_mm_set1_epi32(RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_MASK |
+			       BNXT_RXC_METADATA1_VLAN_VALID);
+	const __m128i crx_flags_mask =
+		_mm_set1_epi32(BNXT_CRX_CQE_CSUM_CALC_MASK);
+	const __m128i crx_tun_cs =
+		_mm_set1_epi32(BNXT_CRX_TUN_CS_CALC);
+	__m128i t0, t1, flags_type, flags, index, errors, rss_flags;
+	__m128i ptype_idx, is_tunnel;
+	uint32_t ol_flags;
+	__m128i cs_err;
+	__m128i t3, t4;
+
+	/* Validate ptype table indexing at build time. */
+	bnxt_check_ptype_constants();
+
+	/* Compute packet type table indexes for four packets */
+	t0 = _mm_unpacklo_epi32(mm_rxcmp[0], mm_rxcmp[1]);
+	t3 = _mm_unpackhi_epi32(mm_rxcmp[0], mm_rxcmp[1]);
+	t1 = _mm_unpacklo_epi32(mm_rxcmp[2], mm_rxcmp[3]);
+	t4 = _mm_unpackhi_epi32(mm_rxcmp[2], mm_rxcmp[3]);
+	flags_type = _mm_unpacklo_epi64(t0, t1);
+	ptype_idx = _mm_srli_epi32(_mm_and_si128(flags_type, flags_type_mask),
+			RX_PKT_CMPL_FLAGS_ITYPE_SFT - BNXT_PTYPE_TBL_TYPE_SFT);
+
+	flags = _mm_unpacklo_epi64(t0, t1);
+
+	ptype_idx = _mm_or_si128(ptype_idx,
+			_mm_srli_epi32(_mm_and_si128(flags, flags2_mask1),
+				       RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT -
+				       BNXT_PTYPE_TBL_VLAN_SFT));
+	ptype_idx = _mm_or_si128(ptype_idx,
+			_mm_srli_epi32(_mm_and_si128(flags, flags2_mask2),
+				       RX_PKT_CMPL_FLAGS2_IP_TYPE_SFT -
+				       BNXT_PTYPE_TBL_IP_VER_SFT));
+
+	/* Extract RSS valid flags for four packets. */
+	rss_flags = _mm_srli_epi32(_mm_and_si128(flags, rss_mask), 9);
+
+	/* Extract cs_err fields for four packets. */
+	cs_err = _mm_unpacklo_epi64(t3, t4);
+	cs_err = _mm_and_si128(cs_err, cs_err_mask);
+	flags = _mm_and_si128(cs_err, crx_flags_mask);
+
+	/* Compute ol_flags and checksum error indexes for four packets. */
+	is_tunnel = _mm_and_si128(flags, crx_tun_cs);
+	is_tunnel = _mm_slli_epi32(is_tunnel, 0x20);
+	flags = _mm_or_si128(flags, is_tunnel);
+
+	flags = _mm_srli_si128(flags, 1);
+
+	errors = _mm_and_si128(cs_err, _mm_set1_epi32(0xF0));
+	errors = _mm_and_si128(_mm_srli_epi32(errors, 4), flags);
+
+	index = _mm_andnot_si128(errors, flags);
+	/* reuse is_tunnel - just shift right one bit to index correctly. */
+	errors = _mm_or_si128(errors, _mm_srli_epi32(is_tunnel, 1));
+	index = _mm_or_si128(index, is_tunnel);
+
+	/* Update mbuf rearm_data for four packets. */
+	GET_OL_FLAGS(rss_flags, index, errors, 0, ol_flags);
+	_mm_store_si128((void *)&mbuf[0]->rearm_data,
+			_mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0)));
+
+	GET_OL_FLAGS(rss_flags, index, errors, 1, ol_flags);
+	_mm_store_si128((void *)&mbuf[1]->rearm_data,
+			_mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0)));
+
+	GET_OL_FLAGS(rss_flags, index, errors, 2, ol_flags);
+	_mm_store_si128((void *)&mbuf[2]->rearm_data,
+			_mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0)));
+
+	GET_OL_FLAGS(rss_flags, index, errors, 3, ol_flags);
+	_mm_store_si128((void *)&mbuf[3]->rearm_data,
+			_mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0)));
+
+	/* Update mbuf rx_descriptor_fields1 for four packes. */
+	GET_DESC_FIELDS(mm_rxcmp[0], mm_rxcmp1[0], shuf_msk, ptype_idx, 0, t0);
+	_mm_store_si128((void *)&mbuf[0]->rx_descriptor_fields1, t0);
+
+	GET_DESC_FIELDS(mm_rxcmp[1], mm_rxcmp1[1], shuf_msk, ptype_idx, 1, t0);
+	_mm_store_si128((void *)&mbuf[1]->rx_descriptor_fields1, t0);
+
+	GET_DESC_FIELDS(mm_rxcmp[2], mm_rxcmp1[2], shuf_msk, ptype_idx, 2, t0);
+	_mm_store_si128((void *)&mbuf[2]->rx_descriptor_fields1, t0);
+
+	GET_DESC_FIELDS(mm_rxcmp[3], mm_rxcmp1[3], shuf_msk, ptype_idx, 3, t0);
+	_mm_store_si128((void *)&mbuf[3]->rx_descriptor_fields1, t0);
+}
+
 static uint16_t
 recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 {
@@ -392,8 +495,8 @@ crx_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		if (num_valid == 0)
 			break;
 
-		descs_to_mbufs(rxcmp, rxcmp1, mbuf_init, shuf_msk, &rx_pkts[nb_rx_pkts],
-			       rxr);
+		crx_descs_to_mbufs(rxcmp, rxcmp1, mbuf_init, shuf_msk,
+				   &rx_pkts[nb_rx_pkts], rxr);
 		nb_rx_pkts += num_valid;
 
 		if (num_valid < BNXT_RX_DESCS_PER_LOOP_VEC128)
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 09/10] net/bnxt: fix compressed Rx CQE handling
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
                   ` (7 preceding siblings ...)
  2024-02-21 21:20 ` [PATCH 08/10] net/bnxt: fix compressed CQE handling Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-21 21:20 ` [PATCH 10/10] doc: update release notes for bnxt Ajit Khaparde
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 5029 bytes --]

We were trying to reuse 32-byte CQE macros for
compressed CQE handling. And that was causing the packet
error bits to be misinterpreted.

Fix it by using appropriate macros.

Fixes: d58c6c077cc2 ("net/bnxt: add AVX2 Rx for compressed CQE")

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

diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c
index ce6b597611..976f258044 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c
@@ -392,19 +392,21 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 				0xFF, 0xFF, 3, 2,        /* pkt_len */
 				0xFF, 0xFF, 0xFF, 0xFF); /* pkt_type (zeroes) */
 	const __m256i flags_type_mask =
-		_mm256_set1_epi32(RX_PKT_CMPL_FLAGS_ITYPE_MASK);
+		_mm256_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_MASK);
 	const __m256i flags2_mask1 =
-		_mm256_set1_epi32(CMPL_FLAGS2_VLAN_TUN_MSK);
+		_mm256_set1_epi32(CMPL_FLAGS2_VLAN_TUN_MSK_CRX);
 	const __m256i flags2_mask2 =
-		_mm256_set1_epi32(RX_PKT_CMPL_FLAGS2_IP_TYPE);
+		_mm256_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_IP_TYPE);
 	const __m256i rss_mask =
-		_mm256_set1_epi32(RX_PKT_CMPL_FLAGS_RSS_VALID);
+		_mm256_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_RSS_VALID);
 	__m256i t0, t1, flags_type, flags2, index, errors;
 	__m256i ptype_idx, ptypes, is_tunnel;
 	__m256i mbuf01, mbuf23, mbuf45, mbuf67;
 	__m256i rearm0, rearm1, rearm2, rearm3, rearm4, rearm5, rearm6, rearm7;
 	__m256i ol_flags, ol_flags_hi;
 	__m256i rss_flags;
+	__m256i errors_v2;
+	__m256i cs_err_v2;
 
 	/* Validate ptype table indexing at build time. */
 	bnxt_check_ptype_constants();
@@ -447,7 +449,6 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 				  cons += BNXT_RX_DESCS_PER_LOOP_VEC256,
 				  mbcons += BNXT_RX_DESCS_PER_LOOP_VEC256) {
 		__m256i rxcmp0_1, rxcmp2_3, rxcmp4_5, rxcmp6_7, info3_v;
-		__m256i errors_v2;
 		uint32_t num_valid;
 
 		/* Copy eight mbuf pointers to output array. */
@@ -470,6 +471,7 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		rxcmp2_3 = _mm256_loadu_si256((void *)&cp_desc_ring[cons + 2]);
 		rte_compiler_barrier();
 		rxcmp0_1 = _mm256_loadu_si256((void *)&cp_desc_ring[cons + 0]);
+		rte_compiler_barrier();
 
 		/* Compute packet type table indices for eight packets. */
 		t0 = _mm256_unpacklo_epi32(rxcmp0_1, rxcmp2_3);
@@ -477,19 +479,19 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		flags_type = _mm256_unpacklo_epi64(t0, t1);
 		ptype_idx = _mm256_and_si256(flags_type, flags_type_mask);
 		ptype_idx = _mm256_srli_epi32(ptype_idx,
-					      RX_PKT_CMPL_FLAGS_ITYPE_SFT -
+					      RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_SFT -
 					      BNXT_PTYPE_TBL_TYPE_SFT);
 
-		t0 = _mm256_unpacklo_epi32(rxcmp0_1, rxcmp2_3);
-		t1 = _mm256_unpacklo_epi32(rxcmp4_5, rxcmp6_7);
-		flags2 = _mm256_unpackhi_epi64(t0, t1);
+		t0 = _mm256_unpackhi_epi32(rxcmp0_1, rxcmp2_3);
+		t1 = _mm256_unpackhi_epi32(rxcmp4_5, rxcmp6_7);
+		cs_err_v2 = _mm256_unpacklo_epi64(t0, t1);
 
-		t0 = _mm256_srli_epi32(_mm256_and_si256(flags2, flags2_mask1),
-				       RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT -
+		t0 = _mm256_srli_epi32(_mm256_and_si256(cs_err_v2, flags2_mask1),
+				       RX_PKT_COMPRESS_CMPL_METADATA1_SFT -
 				       BNXT_PTYPE_TBL_VLAN_SFT);
 		ptype_idx = _mm256_or_si256(ptype_idx, t0);
 
-		t0 = _mm256_srli_epi32(_mm256_and_si256(flags2, flags2_mask2),
+		t0 = _mm256_srli_epi32(_mm256_and_si256(cs_err_v2, flags2_mask2),
 				       RX_PKT_CMPL_FLAGS2_IP_TYPE_SFT -
 				       BNXT_PTYPE_TBL_IP_VER_SFT);
 		ptype_idx = _mm256_or_si256(ptype_idx, t0);
@@ -505,17 +507,22 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		 * Compute ol_flags and checksum error table indices for eight
 		 * packets.
 		 */
-		is_tunnel = _mm256_and_si256(flags2, _mm256_set1_epi32(4));
+		is_tunnel = _mm256_and_si256(cs_err_v2,
+					     _mm256_set1_epi32(BNXT_CRX_TUN_CS_CALC));
 		is_tunnel = _mm256_slli_epi32(is_tunnel, 3);
-		flags2 = _mm256_and_si256(flags2, _mm256_set1_epi32(0x1F));
+
+		flags2 = _mm256_and_si256(cs_err_v2,
+					  _mm256_set1_epi32(BNXT_CRX_CQE_CSUM_CALC_MASK));
+		flags2 = _mm256_srli_epi64(flags2, 8);
 
 		/* Extract errors_v2 fields for eight packets. */
 		t0 = _mm256_unpackhi_epi32(rxcmp0_1, rxcmp2_3);
 		t1 = _mm256_unpackhi_epi32(rxcmp4_5, rxcmp6_7);
 		errors_v2 = _mm256_unpacklo_epi64(t0, t1);
 
-		errors = _mm256_srli_epi32(errors_v2, 4);
-		errors = _mm256_and_si256(errors, _mm256_set1_epi32(0xF));
+		/* Compute errors out of cs_err_v2 to index into flags table. */
+		errors = _mm256_and_si256(cs_err_v2, _mm256_set1_epi32(0xF0));
+		errors = _mm256_srli_epi32(errors, 4);
 		errors = _mm256_and_si256(errors, flags2);
 
 		index = _mm256_andnot_si256(errors, flags2);
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH 10/10] doc: update release notes for bnxt
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
                   ` (8 preceding siblings ...)
  2024-02-21 21:20 ` [PATCH 09/10] net/bnxt: fix compressed Rx " Ajit Khaparde
@ 2024-02-21 21:20 ` Ajit Khaparde
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-21 21:20 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

Update release notes indicating support in bnxt PMD for
5760X device family.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 doc/guides/rel_notes/release_24_03.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
index 32d0ad8cf6..236fed61e3 100644
--- a/doc/guides/rel_notes/release_24_03.rst
+++ b/doc/guides/rel_notes/release_24_03.rst
@@ -132,6 +132,10 @@ New Features
     to support TLS v1.2, TLS v1.3 and DTLS v1.2.
   * Added PMD API to allow raw submission of instructions to CPT.
 
+* **Updated Broadcom bnxt driver.**
+
+  * Added support for 5760X device family.
+
 
 Removed Items
 -------------
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 00/10] patchset for bnxt
  2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
                   ` (9 preceding siblings ...)
  2024-02-21 21:20 ` [PATCH 10/10] doc: update release notes for bnxt Ajit Khaparde
@ 2024-02-22 19:47 ` Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 01/10] net/bnxt: extend long bd check for VXLAN GPE Ajit Khaparde
                     ` (10 more replies)
  10 siblings, 11 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]

Apart from some fixes, this patchset adds support for
RSS based on IPV6 flow label.
This set also updates the 24.03 release notes.

v1->v2:
 - Patchset rebased against 24.03-rc1
 - Fixed up a typo in patch [8/10]

Ajit Khaparde (8):
  net/bnxt: extend long bd check for VXLAN GPE
  net/bnxt: increase queue size for async handling
  net/bnxt: fix AGG ID computation
  net/bnxt: handle UDP GSO Tx
  net/bnxt: add IPv6 flow label based RSS support
  net/bnxt: fix compressed CQE handling
  net/bnxt: fix compressed Rx CQE handling
  doc: update release notes for bnxt

Kalesh AP (2):
  net/bnxt: add dual rate module detection log
  net/bnxt: fix a null pointer dereference

 doc/guides/rel_notes/release_24_03.rst |   4 +
 drivers/net/bnxt/bnxt.h                |   1 +
 drivers/net/bnxt/bnxt_cpr.c            |   4 +
 drivers/net/bnxt/bnxt_ethdev.c         |   2 +
 drivers/net/bnxt/bnxt_hwrm.c           |  10 ++-
 drivers/net/bnxt/bnxt_reps.c           |  19 +++--
 drivers/net/bnxt/bnxt_ring.h           |   2 +-
 drivers/net/bnxt/bnxt_rxr.h            |   2 +-
 drivers/net/bnxt/bnxt_rxtx_vec_avx2.c  |  39 +++++----
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c   | 107 ++++++++++++++++++++++++-
 drivers/net/bnxt/bnxt_txr.c            |   3 +-
 drivers/net/bnxt/bnxt_vnic.c           |   9 ++-
 drivers/net/bnxt/hsi_struct_def_dpdk.h |   8 +-
 13 files changed, 180 insertions(+), 30 deletions(-)

-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 01/10] net/bnxt: extend long bd check for VXLAN GPE
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
@ 2024-02-22 19:47   ` Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 02/10] net/bnxt: add dual rate module detection log Ajit Khaparde
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas, Kalesh AP

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

Extend long Tx BD check for VXLAN GPE packets.
This will allow the long BD to be selected for Tx with
VXLAN GPE frames.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt_txr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 7fc44e989d..7cbb2104a0 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -116,7 +116,7 @@ bnxt_xmit_need_long_bd(struct rte_mbuf *tx_pkt, struct bnxt_tx_queue *txq)
 				RTE_MBUF_F_TX_VLAN | RTE_MBUF_F_TX_OUTER_IP_CKSUM |
 				RTE_MBUF_F_TX_TUNNEL_GRE | RTE_MBUF_F_TX_TUNNEL_VXLAN |
 				RTE_MBUF_F_TX_TUNNEL_GENEVE | RTE_MBUF_F_TX_IEEE1588_TMST |
-				RTE_MBUF_F_TX_QINQ) ||
+				RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE) ||
 	     (BNXT_TRUFLOW_EN(txq->bp) &&
 	      (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action)))
 		return true;
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 02/10] net/bnxt: add dual rate module detection log
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 01/10] net/bnxt: extend long bd check for VXLAN GPE Ajit Khaparde
@ 2024-02-22 19:47   ` Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 03/10] net/bnxt: increase queue size for async handling Ajit Khaparde
                     ` (8 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas, Kalesh AP

[-- Attachment #1: Type: text/plain, Size: 2245 bytes --]

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

Firmware sends an async notification to the driver when it detects
a Dual rate module.

Display below warning message:
"Speed change not supported with dual rate transceivers on this board"

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_cpr.c            | 4 ++++
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c
index fb43bc58da..a4509abd60 100644
--- a/drivers/net/bnxt/bnxt_cpr.c
+++ b/drivers/net/bnxt/bnxt_cpr.c
@@ -100,6 +100,10 @@ static void bnxt_handle_event_error_report(struct bnxt *bp,
 		PMD_DRV_LOG(WARNING, "Port:%d Pause Storm detected!\n",
 			    bp->eth_dev->data->port_id);
 		break;
+	case HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED:
+		PMD_DRV_LOG(WARNING, "Port:%d Speed change not supported with dual rate transceivers on this board",
+			    bp->eth_dev->data->port_id);
+		break;
 	default:
 		PMD_DRV_LOG(INFO, "FW reported unknown error type data1 %d"
 			    " data2: %d\n", data1, data2);
diff --git a/drivers/net/bnxt/hsi_struct_def_dpdk.h b/drivers/net/bnxt/hsi_struct_def_dpdk.h
index 3ee1844e66..9beacd94aa 100644
--- a/drivers/net/bnxt/hsi_struct_def_dpdk.h
+++ b/drivers/net/bnxt/hsi_struct_def_dpdk.h
@@ -12494,8 +12494,14 @@ struct hwrm_async_event_cmpl_error_report_base {
 	 */
 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD \
 		UINT32_C(0x5)
+	/*
+	 * Speed change not supported with dual rate transceivers
+	 * on this board.
+	 */
+	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED \
+		UINT32_C(0x6)
 	#define HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_LAST \
-		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD
+		HWRM_ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DUAL_DATA_RATE_NOT_SUPPORTED
 } __rte_packed;
 
 /* hwrm_async_event_cmpl_error_report_pause_storm (size:128b/16B) */
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 03/10] net/bnxt: increase queue size for async handling
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 01/10] net/bnxt: extend long bd check for VXLAN GPE Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 02/10] net/bnxt: add dual rate module detection log Ajit Khaparde
@ 2024-02-22 19:47   ` Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 04/10] net/bnxt: fix AGG ID computation Ajit Khaparde
                     ` (7 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas, Damodharam Ammepalli

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

Increase the default NQ/CQ depth for async handling.
In some cases the hardware can generate a high number of
async notifications. Increase the notification/completion queue
size to accommodate them.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
---
 drivers/net/bnxt/bnxt_ring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h
index baa60b2627..1bae4b33d9 100644
--- a/drivers/net/bnxt/bnxt_ring.h
+++ b/drivers/net/bnxt/bnxt_ring.h
@@ -24,7 +24,7 @@
 #define DB_KEY_TX_PUSH						(0x4 << 28)
 #define DB_LONG_TX_PUSH						(0x2 << 24)
 
-#define DEFAULT_CP_RING_SIZE	256
+#define DEFAULT_CP_RING_SIZE	4096
 #define DEFAULT_RX_RING_SIZE	256
 #define DEFAULT_TX_RING_SIZE	256
 
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 04/10] net/bnxt: fix AGG ID computation
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
                     ` (2 preceding siblings ...)
  2024-02-22 19:47   ` [PATCH v2 03/10] net/bnxt: increase queue size for async handling Ajit Khaparde
@ 2024-02-22 19:47   ` Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 05/10] net/bnxt: fix a null pointer dereference Ajit Khaparde
                     ` (6 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

Fix the computation of AGG ID for P5 and P7 device families.
The AGG ID for TPA completions for P7 device family is being
incorrectly obtained. Fix the code to handle it.

Fixes: 3b56c3ffc182 ("net/bnxt: refactor code to support P7 devices")

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

diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h
index d36cbded1d..5e5496964f 100644
--- a/drivers/net/bnxt/bnxt_rxr.h
+++ b/drivers/net/bnxt/bnxt_rxr.h
@@ -17,7 +17,7 @@
 static inline uint16_t bnxt_tpa_start_agg_id(struct bnxt *bp,
 					     struct rx_tpa_start_cmpl *cmp)
 {
-	if (BNXT_CHIP_P5(bp))
+	if (BNXT_CHIP_P5_P7(bp))
 		return BNXT_TPA_START_AGG_ID_TH(cmp);
 	else
 		return BNXT_TPA_START_AGG_ID_PRE_TH(cmp);
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 05/10] net/bnxt: fix a null pointer dereference
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
                     ` (3 preceding siblings ...)
  2024-02-22 19:47   ` [PATCH v2 04/10] net/bnxt: fix AGG ID computation Ajit Khaparde
@ 2024-02-22 19:47   ` Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 06/10] net/bnxt: handle UDP GSO Tx Ajit Khaparde
                     ` (5 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas, Kalesh AP, stable, Somnath Kotur

[-- Attachment #1: Type: text/plain, Size: 2400 bytes --]

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

In the recent changes to rte_eth_dev_release_port() the library sets
eth_dev->data to NULL at the end of the routine. This causes a NULL
pointer dereference in the bnxt_rep_dev_info_get_op() and
bnxt_representor_uninit() routines when it tries to validate parent dev.

Add code to handle this.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org

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

diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c
index 3a4720bc3c..edcc27f556 100644
--- a/drivers/net/bnxt/bnxt_reps.c
+++ b/drivers/net/bnxt/bnxt_reps.c
@@ -32,6 +32,14 @@ static const struct eth_dev_ops bnxt_rep_dev_ops = {
 	.flow_ops_get = bnxt_flow_ops_get_op
 };
 
+static bool bnxt_rep_check_parent(struct bnxt_representor *rep)
+{
+	if (!rep->parent_dev->data->dev_private)
+		return false;
+
+	return true;
+}
+
 uint16_t
 bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf)
 {
@@ -266,12 +274,12 @@ int bnxt_representor_uninit(struct rte_eth_dev *eth_dev)
 	PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR uninit\n", eth_dev->data->port_id);
 	eth_dev->data->mac_addrs = NULL;
 
-	parent_bp = rep->parent_dev->data->dev_private;
-	if (!parent_bp) {
+	if (!bnxt_rep_check_parent(rep)) {
 		PMD_DRV_LOG(DEBUG, "BNXT Port:%d already freed\n",
 			    eth_dev->data->port_id);
 		return 0;
 	}
+	parent_bp = rep->parent_dev->data->dev_private;
 
 	parent_bp->num_reps--;
 	vf_id = rep->vf_id;
@@ -539,11 +547,12 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
 	int rc = 0;
 
 	/* MAC Specifics */
-	parent_bp = rep_bp->parent_dev->data->dev_private;
-	if (!parent_bp) {
-		PMD_DRV_LOG(ERR, "Rep parent NULL!\n");
+	if (!bnxt_rep_check_parent(rep_bp)) {
+		/* Need not be an error scenario, if parent is closed first */
+		PMD_DRV_LOG(INFO, "Rep parent port does not exist.\n");
 		return rc;
 	}
+	parent_bp = rep_bp->parent_dev->data->dev_private;
 	PMD_DRV_LOG(DEBUG, "Representor dev_info_get_op\n");
 	dev_info->max_mac_addrs = parent_bp->max_l2_ctx;
 	dev_info->max_hash_mac_addrs = 0;
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 06/10] net/bnxt: handle UDP GSO Tx
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
                     ` (4 preceding siblings ...)
  2024-02-22 19:47   ` [PATCH v2 05/10] net/bnxt: fix a null pointer dereference Ajit Khaparde
@ 2024-02-22 19:47   ` Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 07/10] net/bnxt: add IPv6 flow label based RSS support Ajit Khaparde
                     ` (4 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]

The UDP GSO capability is not being detected and reported
correctly. This is causing UDP GSO to not happen in some cases.
This patch fixes the issue.

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

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 7923d4cbd2..7f49b4b40e 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1141,6 +1141,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 
 	bp->max_ring_grps = rte_le_to_cpu_32(resp->max_hw_ring_grps);
 	flags = rte_le_to_cpu_32(resp->flags);
+	flags_ext2 = rte_le_to_cpu_32(resp->flags_ext2);
+
 	if (BNXT_PF(bp)) {
 		bp->pf->port_id = resp->port_id;
 		bp->pf->first_vf_id = rte_le_to_cpu_16(resp->first_vf_id);
@@ -1225,7 +1227,6 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 		PMD_DRV_LOG(DEBUG, "Tunnel parsing capability is disabled, flags : %#x\n",
 			    bp->tunnel_disable_flag);
 
-	flags_ext2 = rte_le_to_cpu_32(resp->flags_ext2);
 	if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED)
 		bp->fw_cap |= BNXT_FW_CAP_RX_ALL_PKT_TS;
 	if (flags_ext2 & HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT2_UDP_GSO_SUPPORTED)
diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index 7cbb2104a0..83c003d258 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -116,7 +116,8 @@ bnxt_xmit_need_long_bd(struct rte_mbuf *tx_pkt, struct bnxt_tx_queue *txq)
 				RTE_MBUF_F_TX_VLAN | RTE_MBUF_F_TX_OUTER_IP_CKSUM |
 				RTE_MBUF_F_TX_TUNNEL_GRE | RTE_MBUF_F_TX_TUNNEL_VXLAN |
 				RTE_MBUF_F_TX_TUNNEL_GENEVE | RTE_MBUF_F_TX_IEEE1588_TMST |
-				RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE) ||
+				RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE |
+				RTE_MBUF_F_TX_UDP_SEG) ||
 	     (BNXT_TRUFLOW_EN(txq->bp) &&
 	      (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action)))
 		return true;
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 07/10] net/bnxt: add IPv6 flow label based RSS support
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
                     ` (5 preceding siblings ...)
  2024-02-22 19:47   ` [PATCH v2 06/10] net/bnxt: handle UDP GSO Tx Ajit Khaparde
@ 2024-02-22 19:47   ` Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 08/10] net/bnxt: fix compressed CQE handling Ajit Khaparde
                     ` (3 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 4987 bytes --]

P7 hardware family can support IPv6 flow label based RSS.
Check if the firmware indicates capability bit to support
IPv6 flow label based RSS and parse the RSS hash types
appropriately.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        | 1 +
 drivers/net/bnxt/bnxt_ethdev.c | 2 ++
 drivers/net/bnxt/bnxt_hwrm.c   | 7 +++++++
 drivers/net/bnxt/bnxt_vnic.c   | 9 +++++++--
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index fcf2b8be97..4203e6a055 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -868,6 +868,7 @@ struct bnxt {
 #define BNXT_VNIC_CAP_OUTER_RSS_TRUSTED_VF	BIT(4)
 #define BNXT_VNIC_CAP_XOR_MODE		BIT(5)
 #define BNXT_VNIC_CAP_CHKSM_MODE	BIT(6)
+#define BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE	BIT(7)
 #define BNXT_VNIC_CAP_L2_CQE_MODE	BIT(8)
 #define BNXT_VNIC_CAP_AH_SPI4_CAP	BIT(9)
 #define BNXT_VNIC_CAP_AH_SPI6_CAP	BIT(10)
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index f8d83662f4..d5a4312c5b 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1087,6 +1087,8 @@ uint64_t bnxt_eth_rss_support(struct bnxt *bp)
 	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_CHKSM_MODE)
 		support |= RTE_ETH_RSS_IPV4_CHKSUM |
 			   RTE_ETH_RSS_L4_CHKSUM;
+	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE)
+		support |= RTE_ETH_RSS_IPV6_FLOW_LABEL;
 	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_AH_SPI_CAP)
 		support |= RTE_ETH_RSS_AH;
 	if (bp->vnic_cap_flags & BNXT_VNIC_CAP_ESP_SPI_CAP)
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 7f49b4b40e..6ea7089a3f 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1308,6 +1308,9 @@ int bnxt_hwrm_vnic_qcaps(struct bnxt *bp)
 	if (flags & HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RING_SELECT_MODE_TOEPLITZ_CHKSM_CAP)
 		bp->vnic_cap_flags |= BNXT_VNIC_CAP_CHKSM_MODE;
 
+	if (flags & HWRM_VNIC_QCAPS_OUTPUT_FLAGS_RSS_IPV6_FLOW_LABEL_CAP)
+		bp->vnic_cap_flags |= BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE;
+
 	if (flags & HWRM_VNIC_QCAPS_OUTPUT_FLAGS_L2_CQE_MODE_CAP)
 		bp->vnic_cap_flags |= BNXT_VNIC_CAP_L2_CQE_MODE;
 
@@ -2773,6 +2776,10 @@ static uint32_t bnxt_sanitize_rss_type(struct bnxt *bp, uint32_t types)
 {
 	uint32_t hwrm_type = types;
 
+	if (types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL &&
+	    !(bp->vnic_cap_flags & BNXT_VNIC_CAP_IPV6_FLOW_LABEL_MODE))
+		hwrm_type &= ~HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL;
+
 	if (types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4 &&
 	    !(bp->vnic_cap_flags & BNXT_VNIC_CAP_ESP_SPI4_CAP))
 		hwrm_type &= ~HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4;
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 5092a7d774..76905ebdd1 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -280,6 +280,8 @@ uint32_t bnxt_rte_to_hwrm_hash_types(uint64_t rte_type)
 		hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_TCP_IPV6;
 	if (rte_type & RTE_ETH_RSS_NONFRAG_IPV6_UDP)
 		hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6;
+	if (rte_type & RTE_ETH_RSS_IPV6_FLOW_LABEL)
+		hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL;
 	if (rte_type & RTE_ETH_RSS_ESP)
 		hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV4 |
 			     HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_ESP_SPI_IPV6;
@@ -302,6 +304,7 @@ int bnxt_rte_to_hwrm_hash_level(struct bnxt *bp, uint64_t hash_f, uint32_t lvl)
 	bool l3_and_l4 = l3 && l4;
 	bool cksum = !!(hash_f &
 			(RTE_ETH_RSS_IPV4_CHKSUM | RTE_ETH_RSS_L4_CHKSUM));
+	bool fl = !!(hash_f & RTE_ETH_RSS_IPV6_FLOW_LABEL);
 
 	/* If FW has not advertised capability to configure outer/inner
 	 * RSS hashing , just log a message. HW will work in default RSS mode.
@@ -317,12 +320,12 @@ int bnxt_rte_to_hwrm_hash_level(struct bnxt *bp, uint64_t hash_f, uint32_t lvl)
 	switch (lvl) {
 	case BNXT_RSS_LEVEL_INNERMOST:
 		/* Irrespective of what RTE says, FW always does 4 tuple */
-		if (l3_and_l4 || l4 || l3_only || cksum)
+		if (l3_and_l4 || l4 || l3_only || cksum || fl)
 			mode = BNXT_HASH_MODE_INNERMOST;
 		break;
 	case BNXT_RSS_LEVEL_OUTERMOST:
 		/* Irrespective of what RTE says, FW always does 4 tuple */
-		if (l3_and_l4 || l4 || l3_only || cksum)
+		if (l3_and_l4 || l4 || l3_only || cksum || fl)
 			mode = BNXT_HASH_MODE_OUTERMOST;
 		break;
 	default:
@@ -1415,6 +1418,8 @@ void bnxt_hwrm_rss_to_rte_hash_conf(struct bnxt_vnic_info *vnic,
 		*rss_conf |= RTE_ETH_RSS_NONFRAG_IPV6_TCP;
 	if (hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_UDP_IPV6)
 		*rss_conf |= RTE_ETH_RSS_NONFRAG_IPV6_UDP;
+	if (hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL)
+		*rss_conf |= RTE_ETH_RSS_IPV6_FLOW_LABEL;
 	if (hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV6 ||
 	    hash_types & HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_AH_SPI_IPV4)
 		*rss_conf |= RTE_ETH_RSS_AH;
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 08/10] net/bnxt: fix compressed CQE handling
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
                     ` (6 preceding siblings ...)
  2024-02-22 19:47   ` [PATCH v2 07/10] net/bnxt: add IPv6 flow label based RSS support Ajit Khaparde
@ 2024-02-22 19:47   ` Ajit Khaparde
  2024-02-22 19:47   ` [PATCH v2 09/10] net/bnxt: fix compressed Rx " Ajit Khaparde
                     ` (2 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 5570 bytes --]

We were trying to reuse parts of 32-byte CQE handling for
compressed CQE handling. And that was causing the packet
errors to be misinterpreted.

Fix it by using separate code for the compressed CQE handling.

Fixes: 812fd99f8c4e ("net/bnxt: add SSE Rx for compressed CQE")

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

diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index 6c0e33200c..e367fbfbd1 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -112,6 +112,109 @@ descs_to_mbufs(__m128i mm_rxcmp[4], __m128i mm_rxcmp1[4],
 	errors = _mm_or_si128(errors, _mm_srli_epi32(is_tunnel, 1));
 	index = _mm_or_si128(index, is_tunnel);
 
+	/* Update mbuf rearm_data for four packets. */
+	GET_OL_FLAGS(rss_flags, index, errors, 0, ol_flags);
+	_mm_store_si128((void *)&mbuf[0]->rearm_data,
+			_mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0)));
+
+	GET_OL_FLAGS(rss_flags, index, errors, 1, ol_flags);
+	_mm_store_si128((void *)&mbuf[1]->rearm_data,
+			_mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0)));
+
+	GET_OL_FLAGS(rss_flags, index, errors, 2, ol_flags);
+	_mm_store_si128((void *)&mbuf[2]->rearm_data,
+			_mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0)));
+
+	GET_OL_FLAGS(rss_flags, index, errors, 3, ol_flags);
+	_mm_store_si128((void *)&mbuf[3]->rearm_data,
+			_mm_or_si128(mbuf_init, _mm_set_epi64x(ol_flags, 0)));
+
+	/* Update mbuf rx_descriptor_fields1 for four packets. */
+	GET_DESC_FIELDS(mm_rxcmp[0], mm_rxcmp1[0], shuf_msk, ptype_idx, 0, t0);
+	_mm_store_si128((void *)&mbuf[0]->rx_descriptor_fields1, t0);
+
+	GET_DESC_FIELDS(mm_rxcmp[1], mm_rxcmp1[1], shuf_msk, ptype_idx, 1, t0);
+	_mm_store_si128((void *)&mbuf[1]->rx_descriptor_fields1, t0);
+
+	GET_DESC_FIELDS(mm_rxcmp[2], mm_rxcmp1[2], shuf_msk, ptype_idx, 2, t0);
+	_mm_store_si128((void *)&mbuf[2]->rx_descriptor_fields1, t0);
+
+	GET_DESC_FIELDS(mm_rxcmp[3], mm_rxcmp1[3], shuf_msk, ptype_idx, 3, t0);
+	_mm_store_si128((void *)&mbuf[3]->rx_descriptor_fields1, t0);
+}
+
+static inline void
+crx_descs_to_mbufs(__m128i mm_rxcmp[4], __m128i mm_rxcmp1[4],
+		   __m128i mbuf_init, const __m128i shuf_msk,
+		   struct rte_mbuf **mbuf, struct bnxt_rx_ring_info *rxr)
+{
+	const __m128i flags_type_mask =
+		_mm_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_MASK);
+	const __m128i flags2_mask1 =
+		_mm_set1_epi32(CMPL_FLAGS2_VLAN_TUN_MSK_CRX);
+	const __m128i flags2_mask2 =
+		_mm_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_IP_TYPE);
+	const __m128i rss_mask =
+		_mm_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_RSS_VALID);
+	const __m128i cs_err_mask =
+		_mm_set1_epi32(RX_PKT_COMPRESS_CMPL_CS_ERROR_CALC_MASK |
+			       BNXT_RXC_METADATA1_VLAN_VALID);
+	const __m128i crx_flags_mask =
+		_mm_set1_epi32(BNXT_CRX_CQE_CSUM_CALC_MASK);
+	const __m128i crx_tun_cs =
+		_mm_set1_epi32(BNXT_CRX_TUN_CS_CALC);
+	__m128i t0, t1, flags_type, flags, index, errors, rss_flags;
+	__m128i ptype_idx, is_tunnel;
+	uint32_t ol_flags;
+	__m128i cs_err;
+	__m128i t3, t4;
+
+	/* Validate ptype table indexing at build time. */
+	bnxt_check_ptype_constants();
+
+	/* Compute packet type table indexes for four packets */
+	t0 = _mm_unpacklo_epi32(mm_rxcmp[0], mm_rxcmp[1]);
+	t3 = _mm_unpackhi_epi32(mm_rxcmp[0], mm_rxcmp[1]);
+	t1 = _mm_unpacklo_epi32(mm_rxcmp[2], mm_rxcmp[3]);
+	t4 = _mm_unpackhi_epi32(mm_rxcmp[2], mm_rxcmp[3]);
+	flags_type = _mm_unpacklo_epi64(t0, t1);
+	ptype_idx = _mm_srli_epi32(_mm_and_si128(flags_type, flags_type_mask),
+			RX_PKT_CMPL_FLAGS_ITYPE_SFT - BNXT_PTYPE_TBL_TYPE_SFT);
+
+	flags = _mm_unpacklo_epi64(t0, t1);
+
+	ptype_idx = _mm_or_si128(ptype_idx,
+			_mm_srli_epi32(_mm_and_si128(flags, flags2_mask1),
+				       RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT -
+				       BNXT_PTYPE_TBL_VLAN_SFT));
+	ptype_idx = _mm_or_si128(ptype_idx,
+			_mm_srli_epi32(_mm_and_si128(flags, flags2_mask2),
+				       RX_PKT_CMPL_FLAGS2_IP_TYPE_SFT -
+				       BNXT_PTYPE_TBL_IP_VER_SFT));
+
+	/* Extract RSS valid flags for four packets. */
+	rss_flags = _mm_srli_epi32(_mm_and_si128(flags, rss_mask), 9);
+
+	/* Extract cs_err fields for four packets. */
+	cs_err = _mm_unpacklo_epi64(t3, t4);
+	cs_err = _mm_and_si128(cs_err, cs_err_mask);
+	flags = _mm_and_si128(cs_err, crx_flags_mask);
+
+	/* Compute ol_flags and checksum error indexes for four packets. */
+	is_tunnel = _mm_and_si128(flags, crx_tun_cs);
+	is_tunnel = _mm_slli_epi32(is_tunnel, 0x20);
+	flags = _mm_or_si128(flags, is_tunnel);
+
+	flags = _mm_srli_si128(flags, 1);
+
+	errors = _mm_and_si128(cs_err, _mm_set1_epi32(0xF0));
+	errors = _mm_and_si128(_mm_srli_epi32(errors, 4), flags);
+
+	index = _mm_andnot_si128(errors, flags);
+	/* reuse is_tunnel - just shift right one bit to index correctly. */
+	errors = _mm_or_si128(errors, _mm_srli_epi32(is_tunnel, 1));
+	index = _mm_or_si128(index, is_tunnel);
+
 	/* Update mbuf rearm_data for four packets. */
 	GET_OL_FLAGS(rss_flags, index, errors, 0, ol_flags);
 	_mm_store_si128((void *)&mbuf[0]->rearm_data,
@@ -392,8 +495,8 @@ crx_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		if (num_valid == 0)
 			break;
 
-		descs_to_mbufs(rxcmp, rxcmp1, mbuf_init, shuf_msk, &rx_pkts[nb_rx_pkts],
-			       rxr);
+		crx_descs_to_mbufs(rxcmp, rxcmp1, mbuf_init, shuf_msk,
+				   &rx_pkts[nb_rx_pkts], rxr);
 		nb_rx_pkts += num_valid;
 
 		if (num_valid < BNXT_RX_DESCS_PER_LOOP_VEC128)
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 09/10] net/bnxt: fix compressed Rx CQE handling
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
                     ` (7 preceding siblings ...)
  2024-02-22 19:47   ` [PATCH v2 08/10] net/bnxt: fix compressed CQE handling Ajit Khaparde
@ 2024-02-22 19:47   ` Ajit Khaparde
  2024-02-22 19:48   ` [PATCH v2 10/10] doc: update release notes for bnxt Ajit Khaparde
  2024-02-23  2:05   ` [PATCH v2 00/10] patchset " Ajit Khaparde
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:47 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 5029 bytes --]

We were trying to reuse 32-byte CQE macros for
compressed CQE handling. And that was causing the packet
error bits to be misinterpreted.

Fix it by using appropriate macros.

Fixes: d58c6c077cc2 ("net/bnxt: add AVX2 Rx for compressed CQE")

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

diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c
index ce6b597611..976f258044 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_avx2.c
@@ -392,19 +392,21 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 				0xFF, 0xFF, 3, 2,        /* pkt_len */
 				0xFF, 0xFF, 0xFF, 0xFF); /* pkt_type (zeroes) */
 	const __m256i flags_type_mask =
-		_mm256_set1_epi32(RX_PKT_CMPL_FLAGS_ITYPE_MASK);
+		_mm256_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_MASK);
 	const __m256i flags2_mask1 =
-		_mm256_set1_epi32(CMPL_FLAGS2_VLAN_TUN_MSK);
+		_mm256_set1_epi32(CMPL_FLAGS2_VLAN_TUN_MSK_CRX);
 	const __m256i flags2_mask2 =
-		_mm256_set1_epi32(RX_PKT_CMPL_FLAGS2_IP_TYPE);
+		_mm256_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_IP_TYPE);
 	const __m256i rss_mask =
-		_mm256_set1_epi32(RX_PKT_CMPL_FLAGS_RSS_VALID);
+		_mm256_set1_epi32(RX_PKT_COMPRESS_CMPL_FLAGS_RSS_VALID);
 	__m256i t0, t1, flags_type, flags2, index, errors;
 	__m256i ptype_idx, ptypes, is_tunnel;
 	__m256i mbuf01, mbuf23, mbuf45, mbuf67;
 	__m256i rearm0, rearm1, rearm2, rearm3, rearm4, rearm5, rearm6, rearm7;
 	__m256i ol_flags, ol_flags_hi;
 	__m256i rss_flags;
+	__m256i errors_v2;
+	__m256i cs_err_v2;
 
 	/* Validate ptype table indexing at build time. */
 	bnxt_check_ptype_constants();
@@ -447,7 +449,6 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 				  cons += BNXT_RX_DESCS_PER_LOOP_VEC256,
 				  mbcons += BNXT_RX_DESCS_PER_LOOP_VEC256) {
 		__m256i rxcmp0_1, rxcmp2_3, rxcmp4_5, rxcmp6_7, info3_v;
-		__m256i errors_v2;
 		uint32_t num_valid;
 
 		/* Copy eight mbuf pointers to output array. */
@@ -470,6 +471,7 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		rxcmp2_3 = _mm256_loadu_si256((void *)&cp_desc_ring[cons + 2]);
 		rte_compiler_barrier();
 		rxcmp0_1 = _mm256_loadu_si256((void *)&cp_desc_ring[cons + 0]);
+		rte_compiler_barrier();
 
 		/* Compute packet type table indices for eight packets. */
 		t0 = _mm256_unpacklo_epi32(rxcmp0_1, rxcmp2_3);
@@ -477,19 +479,19 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		flags_type = _mm256_unpacklo_epi64(t0, t1);
 		ptype_idx = _mm256_and_si256(flags_type, flags_type_mask);
 		ptype_idx = _mm256_srli_epi32(ptype_idx,
-					      RX_PKT_CMPL_FLAGS_ITYPE_SFT -
+					      RX_PKT_COMPRESS_CMPL_FLAGS_ITYPE_SFT -
 					      BNXT_PTYPE_TBL_TYPE_SFT);
 
-		t0 = _mm256_unpacklo_epi32(rxcmp0_1, rxcmp2_3);
-		t1 = _mm256_unpacklo_epi32(rxcmp4_5, rxcmp6_7);
-		flags2 = _mm256_unpackhi_epi64(t0, t1);
+		t0 = _mm256_unpackhi_epi32(rxcmp0_1, rxcmp2_3);
+		t1 = _mm256_unpackhi_epi32(rxcmp4_5, rxcmp6_7);
+		cs_err_v2 = _mm256_unpacklo_epi64(t0, t1);
 
-		t0 = _mm256_srli_epi32(_mm256_and_si256(flags2, flags2_mask1),
-				       RX_PKT_CMPL_FLAGS2_META_FORMAT_SFT -
+		t0 = _mm256_srli_epi32(_mm256_and_si256(cs_err_v2, flags2_mask1),
+				       RX_PKT_COMPRESS_CMPL_METADATA1_SFT -
 				       BNXT_PTYPE_TBL_VLAN_SFT);
 		ptype_idx = _mm256_or_si256(ptype_idx, t0);
 
-		t0 = _mm256_srli_epi32(_mm256_and_si256(flags2, flags2_mask2),
+		t0 = _mm256_srli_epi32(_mm256_and_si256(cs_err_v2, flags2_mask2),
 				       RX_PKT_CMPL_FLAGS2_IP_TYPE_SFT -
 				       BNXT_PTYPE_TBL_IP_VER_SFT);
 		ptype_idx = _mm256_or_si256(ptype_idx, t0);
@@ -505,17 +507,22 @@ crx_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		 * Compute ol_flags and checksum error table indices for eight
 		 * packets.
 		 */
-		is_tunnel = _mm256_and_si256(flags2, _mm256_set1_epi32(4));
+		is_tunnel = _mm256_and_si256(cs_err_v2,
+					     _mm256_set1_epi32(BNXT_CRX_TUN_CS_CALC));
 		is_tunnel = _mm256_slli_epi32(is_tunnel, 3);
-		flags2 = _mm256_and_si256(flags2, _mm256_set1_epi32(0x1F));
+
+		flags2 = _mm256_and_si256(cs_err_v2,
+					  _mm256_set1_epi32(BNXT_CRX_CQE_CSUM_CALC_MASK));
+		flags2 = _mm256_srli_epi64(flags2, 8);
 
 		/* Extract errors_v2 fields for eight packets. */
 		t0 = _mm256_unpackhi_epi32(rxcmp0_1, rxcmp2_3);
 		t1 = _mm256_unpackhi_epi32(rxcmp4_5, rxcmp6_7);
 		errors_v2 = _mm256_unpacklo_epi64(t0, t1);
 
-		errors = _mm256_srli_epi32(errors_v2, 4);
-		errors = _mm256_and_si256(errors, _mm256_set1_epi32(0xF));
+		/* Compute errors out of cs_err_v2 to index into flags table. */
+		errors = _mm256_and_si256(cs_err_v2, _mm256_set1_epi32(0xF0));
+		errors = _mm256_srli_epi32(errors, 4);
 		errors = _mm256_and_si256(errors, flags2);
 
 		index = _mm256_andnot_si256(errors, flags2);
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* [PATCH v2 10/10] doc: update release notes for bnxt
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
                     ` (8 preceding siblings ...)
  2024-02-22 19:47   ` [PATCH v2 09/10] net/bnxt: fix compressed Rx " Ajit Khaparde
@ 2024-02-22 19:48   ` Ajit Khaparde
  2024-02-23  2:05   ` [PATCH v2 00/10] patchset " Ajit Khaparde
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-22 19:48 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

Update release notes indicating support in bnxt PMD for
5760X device family.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 doc/guides/rel_notes/release_24_03.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
index 879bb4944c..263f880680 100644
--- a/doc/guides/rel_notes/release_24_03.rst
+++ b/doc/guides/rel_notes/release_24_03.rst
@@ -138,6 +138,10 @@ New Features
     to support TLS v1.2, TLS v1.3 and DTLS v1.2.
   * Added PMD API to allow raw submission of instructions to CPT.
 
+* **Updated Broadcom bnxt driver.**
+
+  * Added support for 5760X device family.
+
 
 Removed Items
 -------------
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* Re: [PATCH v2 00/10] patchset for bnxt
  2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
                     ` (9 preceding siblings ...)
  2024-02-22 19:48   ` [PATCH v2 10/10] doc: update release notes for bnxt Ajit Khaparde
@ 2024-02-23  2:05   ` Ajit Khaparde
  10 siblings, 0 replies; 23+ messages in thread
From: Ajit Khaparde @ 2024-02-23  2:05 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, thomas

[-- Attachment #1: Type: text/plain, Size: 1699 bytes --]

On Thu, Feb 22, 2024 at 11:48 AM Ajit Khaparde
<ajit.khaparde@broadcom.com> wrote:
>
> Apart from some fixes, this patchset adds support for
> RSS based on IPV6 flow label.
> This set also updates the 24.03 release notes.
>
> v1->v2:
>  - Patchset rebased against 24.03-rc1
>  - Fixed up a typo in patch [8/10]

Patchset merged to dpdk-next-net-brcm for-next-net branch.
Thanks

>
> Ajit Khaparde (8):
>   net/bnxt: extend long bd check for VXLAN GPE
>   net/bnxt: increase queue size for async handling
>   net/bnxt: fix AGG ID computation
>   net/bnxt: handle UDP GSO Tx
>   net/bnxt: add IPv6 flow label based RSS support
>   net/bnxt: fix compressed CQE handling
>   net/bnxt: fix compressed Rx CQE handling
>   doc: update release notes for bnxt
>
> Kalesh AP (2):
>   net/bnxt: add dual rate module detection log
>   net/bnxt: fix a null pointer dereference
>
>  doc/guides/rel_notes/release_24_03.rst |   4 +
>  drivers/net/bnxt/bnxt.h                |   1 +
>  drivers/net/bnxt/bnxt_cpr.c            |   4 +
>  drivers/net/bnxt/bnxt_ethdev.c         |   2 +
>  drivers/net/bnxt/bnxt_hwrm.c           |  10 ++-
>  drivers/net/bnxt/bnxt_reps.c           |  19 +++--
>  drivers/net/bnxt/bnxt_ring.h           |   2 +-
>  drivers/net/bnxt/bnxt_rxr.h            |   2 +-
>  drivers/net/bnxt/bnxt_rxtx_vec_avx2.c  |  39 +++++----
>  drivers/net/bnxt/bnxt_rxtx_vec_sse.c   | 107 ++++++++++++++++++++++++-
>  drivers/net/bnxt/bnxt_txr.c            |   3 +-
>  drivers/net/bnxt/bnxt_vnic.c           |   9 ++-
>  drivers/net/bnxt/hsi_struct_def_dpdk.h |   8 +-
>  13 files changed, 180 insertions(+), 30 deletions(-)
>
> --
> 2.39.2 (Apple Git-143)
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

end of thread, other threads:[~2024-02-23  2:05 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-21 21:20 [PATCH 00/10] patchset for bnxt Ajit Khaparde
2024-02-21 21:20 ` [PATCH 01/10] net/bnxt: extend long bd check for VXLAN GPE Ajit Khaparde
2024-02-21 21:20 ` [PATCH 02/10] net/bnxt: add dual rate module detection log Ajit Khaparde
2024-02-21 21:20 ` [PATCH 03/10] net/bnxt: increase queue size for async handling Ajit Khaparde
2024-02-21 21:20 ` [PATCH 04/10] net/bnxt: fix AGG ID computation Ajit Khaparde
2024-02-21 21:20 ` [PATCH 05/10] net/bnxt: fix a null pointer dereference Ajit Khaparde
2024-02-21 21:20 ` [PATCH 06/10] net/bnxt: handle UDP GSO Tx Ajit Khaparde
2024-02-21 21:20 ` [PATCH 07/10] net/bnxt: add IPv6 flow label based RSS support Ajit Khaparde
2024-02-21 21:20 ` [PATCH 08/10] net/bnxt: fix compressed CQE handling Ajit Khaparde
2024-02-21 21:20 ` [PATCH 09/10] net/bnxt: fix compressed Rx " Ajit Khaparde
2024-02-21 21:20 ` [PATCH 10/10] doc: update release notes for bnxt Ajit Khaparde
2024-02-22 19:47 ` [PATCH v2 00/10] patchset " Ajit Khaparde
2024-02-22 19:47   ` [PATCH v2 01/10] net/bnxt: extend long bd check for VXLAN GPE Ajit Khaparde
2024-02-22 19:47   ` [PATCH v2 02/10] net/bnxt: add dual rate module detection log Ajit Khaparde
2024-02-22 19:47   ` [PATCH v2 03/10] net/bnxt: increase queue size for async handling Ajit Khaparde
2024-02-22 19:47   ` [PATCH v2 04/10] net/bnxt: fix AGG ID computation Ajit Khaparde
2024-02-22 19:47   ` [PATCH v2 05/10] net/bnxt: fix a null pointer dereference Ajit Khaparde
2024-02-22 19:47   ` [PATCH v2 06/10] net/bnxt: handle UDP GSO Tx Ajit Khaparde
2024-02-22 19:47   ` [PATCH v2 07/10] net/bnxt: add IPv6 flow label based RSS support Ajit Khaparde
2024-02-22 19:47   ` [PATCH v2 08/10] net/bnxt: fix compressed CQE handling Ajit Khaparde
2024-02-22 19:47   ` [PATCH v2 09/10] net/bnxt: fix compressed Rx " Ajit Khaparde
2024-02-22 19:48   ` [PATCH v2 10/10] doc: update release notes for bnxt Ajit Khaparde
2024-02-23  2:05   ` [PATCH v2 00/10] patchset " Ajit Khaparde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).