Skip to contentSkip to conversation

bnxt patchset

PATCH Superseded Manish Kurup 4 participants 275 messages Sep 30, 2025 – Nov 10, 2025 Page 4 of 4

Subsystems (2)
lore
Share & tools
lore
#227 lore raw

PATCH v5 18/57 net/bnxt/tf_ulp: add support for tcam priority update

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

As part of the hot upgrade feature, added supported for TCAM entry's priority to be updated.

---
 drivers/net/bnxt/hsi_struct_def_dpdk.h   | 541 ++++++++++++++++++++---
 drivers/net/bnxt/tf_core/v3/tfc.h        |  27 ++
 drivers/net/bnxt/tf_core/v3/tfc_msg.c    |  32 ++
 drivers/net/bnxt/tf_core/v3/tfc_msg.h    |   6 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h       |   3 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h |   3 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c  |  29 ++
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c    |  24 +
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h    |  12 +
 drivers/net/bnxt/tf_ulp/ulp_mapper.c     |  68 ++-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h     |   8 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper_tf.c  |   1 +
 drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c |  36 ++
 13 files changed, 729 insertions(+), 61 deletions(-)
drivers/net/bnxt/hsi_struct_def_dpdk.h +483 -58
index 3a0c1fbdc2..de72e0e9e9 100644
@@ -828,6 +828,18 @@ struct __rte_packed_begin cmd_nums {
 	#define HWRM_UDCC_COMP_QCFG                       UINT32_C(0x25f)
 	/* This command queries the status and statistics of the computation unit. */
 	#define HWRM_UDCC_COMP_QUERY                      UINT32_C(0x260)
+	/*
+	 * This command is used to query the pfc watchdog max configurable
+	 * timeout value.
+	 */
+	#define HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS            UINT32_C(0x261)
+	/* This command is used to set the PFC watchdog timeout value. */
+	#define HWRM_QUEUE_PFCWD_TIMEOUT_CFG              UINT32_C(0x262)
+	/*
+	 * This command is used to query the current configured pfc watchdog
+	 * timeout value.
+	 */
+	#define HWRM_QUEUE_PFCWD_TIMEOUT_QCFG             UINT32_C(0x263)
 	/* Experimental */
 	#define HWRM_TF                                   UINT32_C(0x2bc)
 	/* Experimental */
@@ -950,18 +962,10 @@ struct __rte_packed_begin cmd_nums {
 	#define HWRM_TFC_TBL_SCOPE_CONFIG_GET             UINT32_C(0x39a)
 	/* TruFlow command to query the resource usage state. */
 	#define HWRM_TFC_RESC_USAGE_QUERY                 UINT32_C(0x39b)
-	/*
-	 * This command is used to query the pfc watchdog max configurable
-	 * timeout value.
-	 */
-	#define HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS            UINT32_C(0x39c)
-	/* This command is used to set the PFC watchdog timeout value. */
-	#define HWRM_QUEUE_PFCWD_TIMEOUT_CFG              UINT32_C(0x39d)
-	/*
-	 * This command is used to query the current configured pfc watchdog
-	 * timeout value.
-	 */
-	#define HWRM_QUEUE_PFCWD_TIMEOUT_QCFG             UINT32_C(0x39e)
+	/* TruFlow command to free resources for a global id. */
+	#define HWRM_TFC_GLOBAL_ID_FREE                   UINT32_C(0x39c)
+	/* TruFlow command to update the priority of one tcam entry. */
+	#define HWRM_TFC_TCAM_PRI_UPDATE                  UINT32_C(0x39d)
 	/* Experimental */
 	#define HWRM_SV                                   UINT32_C(0x400)
 	/* Flush any trace buffer data that has not been sent to the host. */
@@ -1246,8 +1250,8 @@ struct __rte_packed_begin hwrm_err_output {
 #define HWRM_VERSION_MINOR 10
 #define HWRM_VERSION_UPDATE 3
 /* non-zero means beta version */
-#define HWRM_VERSION_RSVD 40
-#define HWRM_VERSION_STR "1.10.3.40"
+#define HWRM_VERSION_RSVD 86
+#define HWRM_VERSION_STR "1.10.3.86"
 
 /****************
  * hwrm_ver_get *
@@ -12667,29 +12671,94 @@ struct __rte_packed_begin hwrm_async_event_cmpl_dbg_buf_producer {
 		UINT32_C(0xffff)
 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SFT \
 		0
-	/* SRT trace. */
+	/* SRT or APE trace. */
 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SRT_TRACE \
 		UINT32_C(0x0)
-	/* SRT2 trace. */
+	/* SRT2 or AFM/Kong trace. */
 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_SRT2_TRACE \
 		UINT32_C(0x1)
-	/* CRT trace. */
+	/* CRT or ChiMP trace. */
 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CRT_TRACE \
 		UINT32_C(0x2)
-	/* CRT2 trace. */
+	/* CRT2 or Bono trace. */
 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CRT2_TRACE \
 		UINT32_C(0x3)
 	/* RIGP0 trace. */
 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_RIGP0_TRACE \
 		UINT32_C(0x4)
-	/* L2 HWRM trace. */
+	/* L2 or ChiMP HWRM trace. */
 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_L2_HWRM_TRACE \
 		UINT32_C(0x5)
-	/* RoCE HWRM trace. */
+	/* RoCE or Bono HWRM trace. */
 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_ROCE_HWRM_TRACE \
 		UINT32_C(0x6)
+	/* Context Accelerator CPU 0 trace. */
+	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA0_TRACE \
+		UINT32_C(0x7)
+	/* Context Accelerator CPU 1 trace. */
+	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA1_TRACE \
+		UINT32_C(0x8)
+	/* Context Accelerator CPU 2 trace. */
+	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_CA2_TRACE \
+		UINT32_C(0x9)
+	/* RIGP1 trace. */
+	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_RIGP1_TRACE \
+		UINT32_C(0xa)
+	/* AFM/Kong HWRM trace. */
+	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_AFM_KONG_HWRM_TRACE \
+		UINT32_C(0xb)
 	#define HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_LAST \
-		HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_ROCE_HWRM_TRACE
+		HWRM_ASYNC_EVENT_CMPL_DBG_BUF_PRODUCER_EVENT_DATA1_TYPE_AFM_KONG_HWRM_TRACE
+} __rte_packed_end;
+
+/* hwrm_async_event_cmpl_peer_mmap_change (size:128b/16B) */
+struct __rte_packed_begin hwrm_async_event_cmpl_peer_mmap_change {
+	uint16_t	type;
+	/*
+	 * This field indicates the exact type of the completion.
+	 * By convention, the LSB identifies the length of the
+	 * record in 16B units. Even values indicate 16B
+	 * records. Odd values indicate 32B
+	 * records.
+	 */
+	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_MASK \
+		UINT32_C(0x3f)
+	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_SFT             0
+	/* HWRM Asynchronous Event Information */
+	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_HWRM_ASYNC_EVENT \
+		UINT32_C(0x2e)
+	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_LAST \
+		HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_TYPE_HWRM_ASYNC_EVENT
+	/* Identifiers of events. */
+	uint16_t	event_id;
+	/*
+	 * This async notification message is used to inform the driver
+	 * that the memory mapping for a peer device is set. The driver
+	 * will need to query using get_structured_data.
+	 */
+	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_EVENT_ID_PEER_MMAP_CHANGE \
+		UINT32_C(0x4d)
+	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_EVENT_ID_LAST \
+		HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_EVENT_ID_PEER_MMAP_CHANGE
+	/* Event specific data. */
+	uint32_t	event_data2;
+	uint8_t	opaque_v;
+	/*
+	 * This value is written by the NIC such that it will be different
+	 * for each pass through the completion queue. The even passes
+	 * will write 1. The odd passes will write 0.
+	 */
+	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_V          UINT32_C(0x1)
+	/* opaque is 7 b */
+	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_OPAQUE_MASK \
+		UINT32_C(0xfe)
+	#define HWRM_ASYNC_EVENT_CMPL_PEER_MMAP_CHANGE_OPAQUE_SFT 1
+	/* 8-lsb timestamp (100-msec resolution) */
+	uint8_t	timestamp_lo;
+	/* 16-lsb timestamp (100-msec resolution) */
+	uint16_t	timestamp_hi;
+	/* Event specific data */
+	uint32_t	event_data1;
 } __rte_packed_end;
 
 /* hwrm_async_event_cmpl_fw_trace_msg (size:128b/16B) */
@@ -14990,9 +15059,7 @@ struct __rte_packed_begin hwrm_func_qcaps_output {
 	/*
 	 * The maximum number of VFs that can be
 	 * allocated to the function. This is valid only on the
-	 * PF with SR-IOV enabled. 0xFF... (All Fs) if this
-	 * command is called on a PF with SR-IOV disabled or
-	 * on a VF.
+	 * PF with SR-IOV enabled.
 	 */
 	uint16_t	max_vfs;
 	/*
@@ -23717,27 +23784,45 @@ struct __rte_packed_begin hwrm_func_backing_store_cfg_v2_input {
 	/* XID partition context. */
 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_XID_PARTITION \
 		UINT32_C(0x1d)
-	/* SRT trace. */
+	/* SRT or APE trace. */
 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRT_TRACE \
 		UINT32_C(0x1e)
-	/* SRT2 trace. */
+	/* SRT2 or AFM/Kong trace. */
 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_SRT2_TRACE \
 		UINT32_C(0x1f)
-	/* CRT trace. */
+	/* CRT or ChiMP trace. */
 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CRT_TRACE \
 		UINT32_C(0x20)
-	/* CRT2 trace. */
+	/* CRT2 or Bono trace. */
 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CRT2_TRACE \
 		UINT32_C(0x21)
 	/* RIGP0 trace. */
 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RIGP0_TRACE \
 		UINT32_C(0x22)
-	/* L2 HWRM trace. */
+	/* L2 or ChiMP HWRM trace. */
 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_L2_HWRM_TRACE \
 		UINT32_C(0x23)
-	/* RoCE HWRM trace. */
+	/* RoCE or Bono HWRM trace. */
 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_ROCE_HWRM_TRACE \
 		UINT32_C(0x24)
+	/* TimedTx pacing TQM ring. */
+	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_TTX_PACING_TQM_RING \
+		UINT32_C(0x25)
+	/* Context Accelerator CPU 0 trace. */
+	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CA0_TRACE \
+		UINT32_C(0x26)
+	/* Context Accelerator CPU 1 trace. */
+	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CA1_TRACE \
+		UINT32_C(0x27)
+	/* Context Accelerator CPU 2 trace. */
+	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_CA2_TRACE \
+		UINT32_C(0x28)
+	/* RIGP1 trace. */
+	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_RIGP1_TRACE \
+		UINT32_C(0x29)
+	/* AFM/Kong HWRM trace. */
+	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_AFM_KONG_HWRM_TRACE \
+		UINT32_C(0x2a)
 	/* Invalid type. */
 	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_TYPE_INVALID \
 		UINT32_C(0xffff)
@@ -23877,6 +23962,21 @@ struct __rte_packed_begin hwrm_func_backing_store_cfg_v2_input {
 	uint32_t	split_entry_2;
 	/* Split entry #3. */
 	uint32_t	split_entry_3;
+	uint32_t	enables;
+	/*
+	 * This bit must be '1' for the next_bs_offset field to be
+	 * configured.
+	 */
+	#define HWRM_FUNC_BACKING_STORE_CFG_V2_INPUT_ENABLES_NEXT_BS_OFFSET \
+		UINT32_C(0x1)
+	/*
+	 * This field specifies the next byte offset of the backing store
+	 * for the firmware to use. The driver can use this field to
+	 * direct the firmware to resume the logging-to-host from
+	 * the host buffer where the firmware was lastly written
+	 * before it restarts, e.g. due to an error recovery.
+	 */
+	uint32_t	next_bs_offset;
 } __rte_packed_end;
 
 /* hwrm_func_backing_store_cfg_v2_output (size:128b/16B) */
@@ -23992,27 +24092,45 @@ struct __rte_packed_begin hwrm_func_backing_store_qcfg_v2_input {
 	/* VF XID partition in-use table. */
 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_XID_PARTITION_TABLE \
 		UINT32_C(0x1d)
-	/* SRT trace. */
+	/* SRT or APE trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRT_TRACE \
 		UINT32_C(0x1e)
-	/* SRT2 trace. */
+	/* SRT2 or AFM/Kong trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_SRT2_TRACE \
 		UINT32_C(0x1f)
-	/* CRT trace. */
+	/* CRT or ChiMP trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CRT_TRACE \
 		UINT32_C(0x20)
-	/* CRT2 trace. */
+	/* CRT2 or Bono trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CRT2_TRACE \
 		UINT32_C(0x21)
 	/* RIGP0 trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RIGP0_TRACE \
 		UINT32_C(0x22)
-	/* L2 HWRM trace. */
+	/* L2 or ChiMP HWRM trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_L2_HWRM_TRACE \
 		UINT32_C(0x23)
-	/* RoCE HWRM trace. */
+	/* RoCE or Bono HWRM trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_ROCE_HWRM_TRACE \
 		UINT32_C(0x24)
+	/* TimedTx pacing TQM ring. */
+	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_TTX_PACING_TQM_RING \
+		UINT32_C(0x25)
+	/* Context Accelerator CPU 0 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CA0_TRACE \
+		UINT32_C(0x26)
+	/* Context Accelerator CPU 1 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CA1_TRACE \
+		UINT32_C(0x27)
+	/* Context Accelerator CPU 2 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_CA2_TRACE \
+		UINT32_C(0x28)
+	/* RIGP1 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_RIGP1_TRACE \
+		UINT32_C(0x29)
+	/* AFM/Kong HWRM trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_AFM_KONG_HWRM_TRACE \
+		UINT32_C(0x2a)
 	/* Invalid type. */
 	#define HWRM_FUNC_BACKING_STORE_QCFG_V2_INPUT_TYPE_INVALID \
 		UINT32_C(0xffff)
@@ -24436,27 +24554,45 @@ struct __rte_packed_begin hwrm_func_backing_store_qcaps_v2_input {
 	/* XID partition context. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_XID_PARTITION \
 		UINT32_C(0x1d)
-	/* SRT trace. */
+	/* SRT or APE trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRT_TRACE \
 		UINT32_C(0x1e)
-	/* SRT2 trace. */
+	/* SRT2 or AFM/Kong trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_SRT2_TRACE \
 		UINT32_C(0x1f)
-	/* CRT trace. */
+	/* CRT or ChiMP trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CRT_TRACE \
 		UINT32_C(0x20)
-	/* CRT2 trace. */
+	/* CRT2 or Bono trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CRT2_TRACE \
 		UINT32_C(0x21)
 	/* RIGP0 trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RIGP0_TRACE \
 		UINT32_C(0x22)
-	/* L2 HWRM trace. */
+	/* L2 or ChiMP HWRM trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_L2_HWRM_TRACE \
 		UINT32_C(0x23)
-	/* RoCE HWRM trace. */
+	/* RoCE or Bono HWRM trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_ROCE_HWRM_TRACE \
 		UINT32_C(0x24)
+	/* TimedTx pacing TQM ring. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_TTX_PACING_TQM_RING \
+		UINT32_C(0x25)
+	/* Context Accelerator CPU 0 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CA0_TRACE \
+		UINT32_C(0x26)
+	/* Context Accelerator CPU 1 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CA1_TRACE \
+		UINT32_C(0x27)
+	/* Context Accelerator CPU 2 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_CA2_TRACE \
+		UINT32_C(0x28)
+	/* RIGP1 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_RIGP1_TRACE \
+		UINT32_C(0x29)
+	/* AFM/Kong HWRM trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_AFM_KONG_HWRM_TRACE \
+		UINT32_C(0x2a)
 	/* Invalid type. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_INPUT_TYPE_INVALID \
 		UINT32_C(0xffff)
@@ -24531,27 +24667,45 @@ struct __rte_packed_begin hwrm_func_backing_store_qcaps_v2_output {
 	/* XID partition context. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_XID_PARTITION \
 		UINT32_C(0x1d)
-	/* SRT trace. */
+	/* SRT or APE trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRT_TRACE \
 		UINT32_C(0x1e)
-	/* SRT2 trace. */
+	/* SRT2 or AFM/Kong trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_SRT2_TRACE \
 		UINT32_C(0x1f)
-	/* CRT trace. */
+	/* CRT or ChiMP trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CRT_TRACE \
 		UINT32_C(0x20)
-	/* CRT2 trace. */
+	/* CRT2 or Bono trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CRT2_TRACE \
 		UINT32_C(0x21)
 	/* RIGP0 trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RIGP0_TRACE \
 		UINT32_C(0x22)
-	/* L2 HWRM trace. */
+	/* L2 or ChiMP HWRM trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_L2_HWRM_TRACE \
 		UINT32_C(0x23)
-	/* RoCE HWRM trace. */
+	/* RoCE or Bono HWRM trace. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_ROCE_HWRM_TRACE \
 		UINT32_C(0x24)
+	/* TimedTx pacing TQM ring. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_TTX_PACING_TQM_RING \
+		UINT32_C(0x25)
+	/* Context Accelerator CPU 0 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CA0_TRACE \
+		UINT32_C(0x26)
+	/* Context Accelerator CPU 1 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CA1_TRACE \
+		UINT32_C(0x27)
+	/* Context Accelerator CPU 2 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_CA2_TRACE \
+		UINT32_C(0x28)
+	/* RIGP1 trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_RIGP1_TRACE \
+		UINT32_C(0x29)
+	/* AFM/Kong HWRM trace. */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_AFM_KONG_HWRM_TRACE \
+		UINT32_C(0x2a)
 	/* Invalid type. */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_TYPE_INVALID \
 		UINT32_C(0xffff)
@@ -24595,6 +24749,26 @@ struct __rte_packed_begin hwrm_func_backing_store_qcaps_v2_output {
 	 */
 	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_ROCE_QP_PSEUDO_STATIC_ALLOC \
 		UINT32_C(0x8)
+	/*
+	 * When set, it indicates the region for this type is not a regular
+	 * context memory but a memory for firmware text-based debug traces
+	 * which consist of ASCII characters.
+	 */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_FW_DBG_TRACE \
+		UINT32_C(0x10)
+	/*
+	 * When set, it indicates the region for this type is not a regular
+	 * context memory but a memory for firmware debug traces which
+	 * consist of binary data.
+	 */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_FW_BIN_DBG_TRACE \
+		UINT32_C(0x20)
+	/*
+	 * When set, it indicates the support of configuring
+	 * the next_bs_offset in hwrm_func_backing_store_cfg_v2.
+	 */
+	#define HWRM_FUNC_BACKING_STORE_QCAPS_V2_OUTPUT_FLAGS_NEXT_BS_OFFSET \
+		UINT32_C(0x40)
 	/*
 	 * Bit map of the valid instances associated with the
 	 * backing store type.
@@ -62274,6 +62448,114 @@ struct __rte_packed_begin hwrm_tfc_resc_usage_query_output {
 	uint8_t	valid;
 } __rte_packed_end;
 
+/****************************
+ * hwrm_tfc_tcam_pri_update *
+ ****************************/
+
+
+/* hwrm_tfc_tcam_pri_update_input (size:256b/32B) */
+struct hwrm_tfc_tcam_pri_update_input {
+	/* The HWRM command request type. */
+	uint16_t	req_type;
+	/*
+	 * 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;
+	/*
+	 * 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;
+	/*
+	 * The target ID of the command:
+	 * * 0x0-0xFFF8 - The function ID
+	 * * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors
+	 * * 0xFFFD - Reserved for user-space HWRM interface
+	 * * 0xFFFF - HWRM
+	 */
+	uint16_t	target_id;
+	/*
+	 * 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.
+	 */
+	uint64_t	resp_addr;
+	/*
+	 * Function ID.
+	 * If running on a trusted VF or PF, the fid field can be used to
+	 * specify that the function is a non-trusted VF of the parent PF.
+	 * If this command is used for the target_id itself, this field is
+	 * set to 0xffff. A non-trusted VF cannot specify a valid FID in this
+	 * field.
+	 */
+	uint16_t	fid;
+	/*
+	 * Session id associated with the firmware. Will be used
+	 * for validation if the track type matches.
+	 */
+	uint16_t	sid;
+	/* Logical TCAM ID. */
+	uint16_t	tcam_id;
+	/* Entry new priority. */
+	uint16_t	priority;
+	/* Control flags. */
+	uint8_t	flags;
+	/* Indicates the flow direction. */
+	#define HWRM_TFC_TCAM_PRI_UPDATE_INPUT_FLAGS_DIR     UINT32_C(0x1)
+	/* If this bit set to 0, then it indicates rx flow. */
+	#define HWRM_TFC_TCAM_PRI_UPDATE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
+	/* If this bit is set to 1, then it indicates tx flow. */
+	#define HWRM_TFC_TCAM_PRI_UPDATE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
+	#define HWRM_TFC_TCAM_PRI_UPDATE_INPUT_FLAGS_DIR_LAST \
+		HWRM_TFC_TCAM_PRI_UPDATE_INPUT_FLAGS_DIR_TX
+	/*
+	 * Subtype of TCAM resource. See
+	 * cfa_v3/include/cfa_resources.h.
+	 */
+	uint8_t	subtype;
+	/* Describes the type of tracking id to be used */
+	uint8_t	track_type;
+	/* Invalid track type */
+	#define HWRM_TFC_TCAM_PRI_UPDATE_INPUT_TRACK_TYPE_TRACK_TYPE_INVALID \
+		UINT32_C(0x0)
+	/* Tracked by session id */
+	#define HWRM_TFC_TCAM_PRI_UPDATE_INPUT_TRACK_TYPE_TRACK_TYPE_SID \
+		UINT32_C(0x1)
+	/* Tracked by function id */
+	#define HWRM_TFC_TCAM_PRI_UPDATE_INPUT_TRACK_TYPE_TRACK_TYPE_FID \
+		UINT32_C(0x2)
+	#define HWRM_TFC_TCAM_PRI_UPDATE_INPUT_TRACK_TYPE_LAST \
+		HWRM_TFC_TCAM_PRI_UPDATE_INPUT_TRACK_TYPE_TRACK_TYPE_FID
+	/* unused. */
+	uint8_t	unused0[5];
+} __rte_packed;
+
+/* hwrm_tfc_tcam_pri_update_output (size:128b/16B) */
+struct hwrm_tfc_tcam_pri_update_output {
+	/* 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;
+	/* unused. */
+	uint8_t	unused0[7];
+	/*
+	 * 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;
+} __rte_packed;
+
 /******************************
  * hwrm_tunnel_dst_port_query *
  ******************************/
@@ -63557,9 +63839,14 @@ struct __rte_packed_begin hwrm_pcie_qstats_input {
 	 */
 	uint64_t	resp_addr;
 	/*
-	 * The size of PCIe statistics block in bytes.
-	 * Firmware will DMA the PCIe statistics to
-	 * the host with this field size in the response.
+	 * This field specifies the size of the host buffer for the
+	 * statistics block. The actual size of the statistics block
+	 * returned by FW will depend on the chip. Older chips will
+	 * use the pcie_ctx_hw_stats structure and newer chips will
+	 * use the superset pcie_ctx_hw_stats_v2 structure. The actual
+	 * size of the data will be returned in the HWRM response and
+	 * it will be smaller than or equal to the size specified in
+	 * this field.
 	 */
 	uint16_t	pcie_stat_size;
 	uint8_t	unused_0[6];
@@ -63629,6 +63916,119 @@ struct __rte_packed_begin pcie_ctx_hw_stats {
 	uint64_t	pcie_recovery_histogram;
 } __rte_packed_end;
 
+/*
+ * Extended PCIe Statistics Format. This structure is a superset of
+ * pcie_ctx_hw_stats, i.e. the fields between the two structures are
+ * identical up to and including the pcie_recovery_histogram field.
+ */
+/* pcie_ctx_hw_stats_v2 (size:4096b/512B) */
+struct pcie_ctx_hw_stats_v2 {
+	/* Number of physical layer receiver errors */
+	uint64_t	pcie_pl_signal_integrity;
+	/* Number of DLLP CRC errors detected by Data Link Layer */
+	uint64_t	pcie_dl_signal_integrity;
+	/*
+	 * Number of TLP LCRC and sequence number errors detected
+	 * by Data Link Layer
+	 */
+	uint64_t	pcie_tl_signal_integrity;
+	/* Number of times LTSSM entered Recovery state */
+	uint64_t	pcie_link_integrity;
+	/* Report number of TLP bits that have been transmitted in Mbps */
+	uint64_t	pcie_tx_traffic_rate;
+	/* Report number of TLP bits that have been received in Mbps */
+	uint64_t	pcie_rx_traffic_rate;
+	/* Number of DLLP bytes that have been transmitted */
+	uint64_t	pcie_tx_dllp_statistics;
+	/* Number of DLLP bytes that have been received */
+	uint64_t	pcie_rx_dllp_statistics;
+	/*
+	 * Number of times spent in each phase of gen3
+	 * equalization
+	 */
+	uint64_t	pcie_equalization_time;
+	/* Records the last 16 transitions of the LTSSM */
+	uint32_t	pcie_ltssm_histogram[4];
+	/*
+	 * Record the last 8 reasons on why LTSSM transitioned
+	 * to Recovery
+	 */
+	uint64_t	pcie_recovery_histogram;
+	/* The TL credit histogram counter buckets for non-posted-headers. */
+	uint32_t	pcie_tl_credit_nph_histogram[8];
+	/* The TL credit histogram counter buckets for posted-headers. */
+	uint32_t	pcie_tl_credit_ph_histogram[8];
+	/* The TL credit histogram counter buckets for posted-data. */
+	uint32_t	pcie_tl_credit_pd_histogram[8];
+	/*
+	 * The most recently completed read request times (in microseconds)
+	 * for the 4 tags.
+	 */
+	uint32_t	pcie_cmpl_latest_times[4];
+	/* The longest read completion time (in microseconds). */
+	uint32_t	pcie_cmpl_longest_time;
+	/* The shortest read completion time (in microseconds). */
+	uint32_t	pcie_cmpl_shortest_time;
+	uint32_t	unused_0[2];
+	/*
+	 * This field represents an array of 4 most recent (in time) read
+	 * completion headers for tags 0 to 3. Each header consists of 4
+	 * words, in the following arrangement:
+	 * | Word | Contains                            |
+	 * | ---- | ------------------------------------|
+	 * |   0  | The header bits 0 to 31.            |
+	 * |   1  | The header bits 32 to 63.           |
+	 * |   2  | The header bits 64 to 95.           |
+	 * |   3  | Reserved.                           |
+	 */
+	uint32_t	pcie_cmpl_latest_headers[4][4];
+	/*
+	 * This field represents an array of 4 longest (in time) read
+	 * completion headers for tags 0 to 3. Each header consists of 4
+	 * words, in the following arrangement:
+	 * | Word | Contains                            |
+	 * | ---- | ------------------------------------|
+	 * |   0  | The header bits 0 to 31.            |
+	 * |   1  | The header bits 32 to 63.           |
+	 * |   2  | The header bits 64 to 95.           |
+	 * |   3  | Reserved.                           |
+	 */
+	uint32_t	pcie_cmpl_longest_headers[4][4];
+	/*
+	 * This field represents an array of 4 shortest (in time) read
+	 * completion headers for tags 0 to 3. Each header consists of 4
+	 * words, in the following arrangement:
+	 * | Word | Contains                            |
+	 * | ---- | ------------------------------------|
+	 * |   0  | The header bits 0 to 31.            |
+	 * |   1  | The header bits 32 to 63.           |
+	 * |   2  | The header bits 64 to 95.           |
+	 * |   3  | Reserved.                           |
+	 */
+	uint32_t	pcie_cmpl_shortest_headers[4][4];
+	/* The PCIe write latency histogram data counter values. */
+	uint32_t	pcie_wr_latency_histogram[12];
+	/*
+	 * The total count for all of the requests, less the ones in the
+	 * buckets.
+	 */
+	uint32_t	pcie_wr_latency_all_normal_count;
+	uint32_t	unused_1;
+	/* The count of posted packets sent to the PCI-e. */
+	uint64_t	pcie_posted_packet_count;
+	/* The count of non-posted packets sent to the PCI-e. */
+	uint64_t	pcie_non_posted_packet_count;
+	/*
+	 * The count of other packets (i.e. not posted or non-posted) sent to
+	 * the PCI-e.
+	 */
+	uint64_t	pcie_other_packet_count;
+	/* The count of blocked packets sent to the PCI-e. */
+	uint64_t	pcie_blocked_packet_count;
+	/* The count of completion packets sent to the PCI-e. */
+	uint64_t	pcie_cmpl_packet_count;
+} __rte_packed;
+
 /****************************
  * hwrm_stat_generic_qstats *
  ****************************/
@@ -64641,6 +65041,16 @@ struct __rte_packed_begin hwrm_nvm_write_input {
 	 */
 	#define HWRM_NVM_WRITE_INPUT_FLAGS_BATCH_LAST \
 		UINT32_C(0x4)
+	/*
+	 * This flag can only be used when NIC is running a fastboot image.
+	 * It has no effect when supplied to a non-fastboot image. Normally,
+	 * all signed binaries must have the same CRID as the CRID programmed
+	 * in the NIC SOTP. When the skip_crid_check flag is set, the CRID of
+	 * the signed binary being written to the NVM does not have to match
+	 * the CRID programmed in the SOTP of the NIC.
+	 */
+	#define HWRM_NVM_WRITE_INPUT_FLAGS_SKIP_CRID_CHECK \
+		UINT32_C(0x8)
 	/*
 	 * The requested length of the allocated NVM for the item, in bytes.
 	 * This value may be greater than or equal to the specified data
@@ -68388,29 +68798,44 @@ struct __rte_packed_begin hwrm_dbg_log_buffer_flush_input {
 	uint64_t	resp_addr;
 	/* Type of trace buffer to flush. */
 	uint16_t	type;
-	/* SRT trace. */
+	/* SRT or APE trace. */
 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_SRT_TRACE \
 		UINT32_C(0x0)
-	/* SRT2 trace. */
+	/* SRT2 or AFM/Kong trace. */
 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_SRT2_TRACE \
 		UINT32_C(0x1)
-	/* CRT trace. */
+	/* CRT or ChiMP trace. */
 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CRT_TRACE \
 		UINT32_C(0x2)
-	/* CRT2 trace. */
+	/* CRT2 or Bono trace. */
 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CRT2_TRACE \
 		UINT32_C(0x3)
 	/* RIGP0 trace. */
 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_RIGP0_TRACE \
 		UINT32_C(0x4)
-	/* L2 HWRM trace. */
+	/* L2 or ChiMP HWRM trace. */
 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_L2_HWRM_TRACE \
 		UINT32_C(0x5)
-	/* RoCE HWRM trace. */
+	/* RoCE or Bono HWRM trace. */
 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_ROCE_HWRM_TRACE \
 		UINT32_C(0x6)
+	/* Context Accelerator CPU 0 trace. */
+	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CA0_TRACE \
+		UINT32_C(0x7)
+	/* Context Accelerator CPU 1 trace. */
+	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CA1_TRACE \
+		UINT32_C(0x8)
+	/* Context Accelerator CPU 2 trace. */
+	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_CA2_TRACE \
+		UINT32_C(0x9)
+	/* RIGP1 trace. */
+	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_RIGP1_TRACE \
+		UINT32_C(0xa)
+	/* AFM/Kong HWRM trace. */
+	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_AFM_KONG_HWRM_TRACE \
+		UINT32_C(0xb)
 	#define HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_LAST \
-		HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_ROCE_HWRM_TRACE
+		HWRM_DBG_LOG_BUFFER_FLUSH_INPUT_TYPE_AFM_KONG_HWRM_TRACE
 	uint8_t	unused_1[2];
 	/* Control flags. */
 	uint32_t	flags;
drivers/net/bnxt/tf_core/v3/tfc.h +27 -0
index 0ede8f04a8..02f24106e7 100644
@@ -681,6 +681,33 @@ int tfc_tcam_get(struct tfc *tfcp, uint16_t fid,
 int tfc_tcam_free(struct tfc *tfcp, uint16_t fid,
 		  const struct tfc_tcam_info *tcam_info);
 
+/**
+ * Update the TFC TCAM entry priority
+ *
+ * @param[in] tfcp
+ *   Pointer to TFC handle
+ *
+ * @param[in] fid
+ *   FID - Function ID to be used
+ *
+ * @param[in] tt
+ *   Track type - either track by session or by function
+ *
+ * @param[in] tcam_info
+ *   All the information related to the requested index table entry (subtype/dir)
+ *   including the id.
+ *
+ * @param[in] priority
+ *  The priority of the tcam entry to be updated with.
+ *
+ * @returns
+ *   0 for SUCCESS, negative error value for FAILURE (errno.h)
+ */
+int tfc_tcam_priority_update(struct tfc *tfcp, uint16_t fid,
+			     enum cfa_track_type tt,
+			     const struct tfc_tcam_info *tcam_info,
+			     uint16_t priority);
+
 /**
  * @page TBM Table Scope
  *
drivers/net/bnxt/tf_core/v3/tfc_msg.c +32 -0
index fb007a66f6..0a636a1677 100644
@@ -1183,6 +1183,38 @@ tfc_msg_tcam_free(struct tfc *tfcp, uint16_t fid, uint16_t sid,
 	return rc;
 }
 
+int
+tfc_msg_tcam_prioriry_update(struct tfc *tfcp, uint16_t fid, uint16_t sid,
+			     enum cfa_dir dir, enum cfa_track_type tt,
+			     enum cfa_resource_subtype_tcam subtype,
+			     uint16_t tcam_id, uint16_t priority)
+{
+	int rc = 0;
+	struct bnxt *bp = tfcp->bp;
+	struct hwrm_tfc_tcam_pri_update_input req = { 0 };
+	struct hwrm_tfc_tcam_pri_update_output resp = { 0 };
+
+	req.flags = (dir == CFA_DIR_TX ?
+		     HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_TX :
+		     HWRM_TFC_TCAM_SET_INPUT_FLAGS_DIR_RX);
+
+	rc = tfc_msg_set_fid(bp, fid, &req.fid);
+	if (rc)
+		return rc;
+	req.sid = rte_le_to_cpu_16(sid);
+	req.tcam_id = rte_le_to_cpu_16(tcam_id);
+	req.subtype = (uint8_t)subtype;
+	req.priority = rte_le_to_cpu_16(priority);
+	req.track_type = (tt == CFA_TRACK_TYPE_FID ?
+			  HWRM_TFC_TCAM_PRI_UPDATE_INPUT_TRACK_TYPE_TRACK_TYPE_FID :
+			  HWRM_TFC_TCAM_PRI_UPDATE_INPUT_TRACK_TYPE_TRACK_TYPE_SID);
+
+	rc = bnxt_hwrm_tf_message_direct(bp, false, HWRM_TFC_TCAM_PRI_UPDATE,
+					 &req, sizeof(req), &resp,
+					 sizeof(resp));
+	return rc;
+}
+
 int
 tfc_msg_if_tbl_set(struct tfc *tfcp, uint16_t fid, uint16_t sid,
 		   enum cfa_dir dir, enum cfa_resource_subtype_if_tbl subtype,
drivers/net/bnxt/tf_core/v3/tfc_msg.h +6 -0
index a03452f00a..2d1a6816c0 100644
@@ -154,6 +154,12 @@ tfc_msg_tcam_free(struct tfc *tfcp, uint16_t fid, uint16_t sid,
 		 enum cfa_dir dir, enum cfa_resource_subtype_tcam subtype,
 		 uint16_t tcam_id);
 
+int
+tfc_msg_tcam_prioriry_update(struct tfc *tfcp, uint16_t fid, uint16_t sid,
+			     enum cfa_dir dir, enum cfa_track_type tt,
+			     enum cfa_resource_subtype_tcam subtype,
+			     uint16_t tcam_id, uint16_t priority);
+
 int
 tfc_msg_if_tbl_set(struct tfc *tfcp, uint16_t fid, uint16_t sid,
 		   enum cfa_dir dir, enum cfa_resource_subtype_if_tbl subtype,
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +3 -0
index e0e31532fd..3a2745d405 100644
@@ -327,4 +327,7 @@ bnxt_ulp_grp_miss_act_set(struct rte_eth_dev *dev,
 			  const struct rte_flow_action actions[],
 			  uint32_t *flow_id);
 
+int32_t
+bnxt_ulp_hot_upgrade_process(struct bnxt *bp);
+
 #endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h +2 -1
index 40e7aaa170..9c3d7ed7dc 100644
@@ -1060,7 +1060,8 @@ bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits)
 		BNXT_DRV_DBG(ERR, "Multi Instance Feature is enabled\n");
 	if (bit & BNXT_ULP_FEATURE_BIT_SPECIAL_VXLAN)
 		BNXT_DRV_DBG(ERR, "Special VXLAN Feature is enabled\n");
-
+	if (bit & BNXT_ULP_FEATURE_BIT_HOT_UPGRADE)
+		BNXT_DRV_DBG(ERR, "Hot Upgrade Feature is enabled\n");
 
 	*out_bits =  bit;
 	return 0;
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +29 -0
index b7a893a04f..30cd944362 100644
@@ -993,3 +993,32 @@ bnxt_ulp_grp_miss_act_set(struct rte_eth_dev *dev,
 flow_error:
 	return ret;
 }
+
+int32_t
+bnxt_ulp_hot_upgrade_process(struct bnxt *bp)
+{
+	uint32_t flow_type = BNXT_ULP_TEMPLATE_HOT_UPGRADE;
+	uint16_t port_id = bp->eth_dev->data->port_id;
+	struct ulp_tlv_param param_list[] = {
+		{
+			.type = BNXT_ULP_DF_PARAM_TYPE_DEV_PORT_ID,
+			.length = 2,
+			.value = {(port_id >> 8) & 0xff, port_id & 0xff}
+		},
+		{
+			.type = BNXT_ULP_DF_PARAM_TYPE_LAST,
+			.length = 0,
+			.value = {0}
+		}
+	};
+
+	if (!BNXT_CHIP_P7(bp))
+		return -EPERM;
+
+	if (ulp_flow_template_process(bp, param_list, flow_type,
+				      port_id, 0))
+		return -EIO;
+
+	BNXT_DRV_DBG(DEBUG, "Hot upgrade operation performed\n");
+	return 0;
+}
drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c +24 -0
index c2ae3dc3a2..ac0a7e6db1 100644
@@ -626,3 +626,27 @@ ulp_gen_tbl_simple_list_search(struct ulp_mapper_gen_tbl_list *tbl_list,
 	}
 	return rc;
 }
+
+uint32_t
+ulp_gen_tbl_simple_list_get_next(struct ulp_mapper_gen_tbl_list *tbl_list,
+				 uint32_t *key_idx)
+{
+	struct ulp_mapper_gen_tbl_cont *cont = &tbl_list->container;
+	enum ulp_gen_list_search_flag rc = ULP_GEN_LIST_SEARCH_FULL;
+	struct ulp_mapper_gen_tbl_entry ent = { 0 };
+	uint32_t idx = *key_idx;
+
+	/* Check the given idx is a valid entry, if not get next one */
+	while (idx < cont->num_elem) {
+		ent.ref_count = &cont->ref_count[idx];
+		/* check ref count not zero and exact key matches */
+		if (ULP_GEN_TBL_REF_CNT(&ent)) {
+			/* found the entry return */
+			rc = ULP_GEN_LIST_SEARCH_FOUND;
+			*key_idx = idx;
+			break;
+		}
+		idx++;
+	}
+	return rc;
+}
drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h +12 -0
index 2a6454bf9c..e88fd78acc 100644
@@ -219,4 +219,16 @@ uint32_t
 ulp_gen_tbl_simple_list_search(struct ulp_mapper_gen_tbl_list *tbl_list,
 			       uint8_t *match_key,
 			       uint32_t *key_idx);
+
+/*
+ * Perform simple list iteration
+ *
+ * tbl_list [in] - pointer to the generic table list
+ * key_idx [in/out] - returns key index .
+ *
+ * returns 2 on success.
+ */
+uint32_t
+ulp_gen_tbl_simple_list_get_next(struct ulp_mapper_gen_tbl_list *tbl_list,
+				 uint32_t *key_idx);
 #endif /* _ULP_EN_TBL_H_ */
drivers/net/bnxt/tf_ulp/ulp_mapper.c +67 -1

104 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +7 -1
index 79052664dd..a4a42ab84d 100644
@@ -103,6 +103,13 @@ struct ulp_mapper_core_ops {
 	(*ulp_mapper_core_tcam_entry_free)(struct bnxt_ulp_context *ulp_ctx,
 					   struct ulp_flow_db_res_params *res);
 	int32_t
+	(*ulp_mapper_core_tcam_prio_update)(struct bnxt_ulp_mapper_parms *parms,
+					    uint8_t dir,
+					    enum cfa_track_type tt,
+					    enum cfa_resource_subtype_tcam type,
+					    uint32_t tcam_id,
+					    uint16_t priority);
+	int32_t
 	(*ulp_mapper_core_em_tbl_process)(struct bnxt_ulp_mapper_parms *parms,
 					  struct bnxt_ulp_mapper_tbl_info *t,
 					  void *error);
@@ -110,7 +117,6 @@ struct ulp_mapper_core_ops {
 	(*ulp_mapper_core_em_entry_free)(struct bnxt_ulp_context *ulp,
 					 struct ulp_flow_db_res_params *res,
 					 void *error);
-
 	int32_t
 	(*ulp_mapper_core_index_tbl_process)(struct bnxt_ulp_mapper_parms *parm,
 					     struct bnxt_ulp_mapper_tbl_info
drivers/net/bnxt/tf_ulp/ulp_mapper_tf.c +1 -0
index e548a6b91f..72d0f96573 100644
@@ -1368,6 +1368,7 @@ ulp_mapper_tf_mpc_batch_started(struct tfc_mpc_batch_info_t *batch_info __rte_un
 const struct ulp_mapper_core_ops ulp_mapper_tf_core_ops = {
 	.ulp_mapper_core_tcam_tbl_process = ulp_mapper_tf_tcam_tbl_process,
 	.ulp_mapper_core_tcam_entry_free = ulp_mapper_tf_tcam_entry_free,
+	.ulp_mapper_core_tcam_prio_update = NULL,
 	.ulp_mapper_core_em_tbl_process = ulp_mapper_tf_em_tbl_process,
 	.ulp_mapper_core_em_entry_free = ulp_mapper_tf_em_entry_free,
 	.ulp_mapper_core_index_tbl_process = ulp_mapper_tf_index_tbl_process,
drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c +36 -0
index d4c03a2d74..046d2c5cf9 100644
@@ -1911,11 +1911,47 @@ ulp_mapper_tfc_mtr_stats_hndl_del(uint32_t mtr_id)
 		}
 
 	return rc;
+
+static inline int32_t
+ulp_mapper_tfc_tcam_prio_update(struct bnxt_ulp_mapper_parms *parms,
+				uint8_t dir,
+				enum cfa_track_type tt,
+				enum cfa_resource_subtype_tcam rtype,
+				uint32_t tcam_id,
+				uint16_t priority)
+{
+	struct tfc *tfcp = NULL;
+	struct tfc_tcam_info tcam_info = { 0 };
+	uint16_t fw_fid = 0;
+
+	if (unlikely(bnxt_ulp_cntxt_fid_get(parms->ulp_ctx, &fw_fid))) {
+		BNXT_DRV_DBG(ERR, "Failed to get func_id\n");
+		return -EINVAL;
+	}
+
+	tfcp = bnxt_ulp_cntxt_tfcp_get(parms->ulp_ctx);
+	if (unlikely(tfcp == NULL)) {
+		PMD_DRV_LOG_LINE(ERR, "Failed to get tfcp pointer");
+		return -EINVAL;
+	}
+	tcam_info.dir = (enum cfa_dir)dir;
+	tcam_info.rsubtype = rtype;
+	tcam_info.id = (uint16_t)tcam_id;
+
+	if (unlikely(!tfcp || tfc_tcam_priority_update(tfcp, fw_fid, tt,
+						       &tcam_info,
+						       priority))) {
+		BNXT_DRV_DBG(ERR, "Unable to update tcam priority %u\n",
+			     tcam_info.id);
+		return -EINVAL;
+	}
+	return 0;
 }
 
 const struct ulp_mapper_core_ops ulp_mapper_tfc_core_ops = {
 	.ulp_mapper_core_tcam_tbl_process = ulp_mapper_tfc_tcam_tbl_process,
 	.ulp_mapper_core_tcam_entry_free = ulp_mapper_tfc_tcam_entry_free,
+	.ulp_mapper_core_tcam_prio_update = ulp_mapper_tfc_tcam_prio_update,
 	.ulp_mapper_core_em_tbl_process = ulp_mapper_tfc_em_tbl_process,
 	.ulp_mapper_core_em_entry_free = ulp_mapper_tfc_em_entry_free,
 	.ulp_mapper_core_index_tbl_process = ulp_mapper_tfc_index_tbl_process,
Signature · 1 line
2.39.5 (Apple Git-154)
#228 lore raw

PATCH v5 19/57 net/bnxt/tf_ulp: hot upgrade support

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

Add support for hot upgrade for a generic application. An application can start a backup application and add the same flows that has been offloaded in primary application and secondary application can take over primary application.

Update the hwrm version to the correct version number, the corresponding code version for hot upgrade api got changed.

---
 drivers/net/bnxt/bnxt.h                       |   1 +
 drivers/net/bnxt/bnxt_ethdev.c                |  37 +++
 .../bnxt/hcapi/cfa_v3/include/cfa_resources.h |   8 +
 drivers/net/bnxt/hsi_struct_def_dpdk.h        | 207 +++++++++++++-
 drivers/net/bnxt/tf_core/v3/meson.build       |   1 +
 drivers/net/bnxt/tf_core/v3/tfc.h             |  84 ++++++
 drivers/net/bnxt/tf_core/v3/tfc_hot_upgrade.c | 142 ++++++++++
 drivers/net/bnxt/tf_core/v3/tfc_msg.c         |  52 ++++
 drivers/net/bnxt/tf_core/v3/tfc_msg.h         |   7 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |   3 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |  10 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c        |  42 ++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h      |  60 ++++
 drivers/net/bnxt/tf_ulp/meson.build           |  56 +++-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |   4 +
 drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c      |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_sc_mgr.c          |   7 +-
 drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.c      | 264 ++++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.h      |  40 +++
 19 files changed, 1012 insertions(+), 15 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/v3/tfc_hot_upgrade.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.h
drivers/net/bnxt/bnxt.h +1 -0
index 72ac66b0db..00bdb53215 100644
@@ -1061,6 +1061,7 @@ struct bnxt {
 	struct bnxt_flow_stat_info *flow_stat;
 	uint16_t		max_num_kflows;
 	uint8_t			app_id;
+	uint8_t			app_instance_id;
 	uint32_t		tx_cfa_action;
 	struct bnxt_ring_stats	*prev_rx_ring_stats;
 	struct bnxt_ring_stats	*prev_tx_ring_stats;
drivers/net/bnxt/bnxt_ethdev.c +37 -0
index bf78f9dff5..b2b8e20516 100644
@@ -162,6 +162,9 @@ static const struct rte_eth_speed_lanes_capa speed_lanes_capa_tbl[] = {
  */
 #define BNXT_DEVARG_APP_ID_INVALID(val)			((val) > 255)
 
+/* app-instance-id = an non-negative 3-bit number */
+#define BNXT_DEVARG_APP_INSTANCE_ID_INVALID(val)	((val) > 8)
+
 /*
  * ieee-1588 = an non-negative 8-bit number
  */
@@ -6058,6 +6061,40 @@ bnxt_parse_devarg_cqe_mode(__rte_unused const char *key,
 	return 0;
 }
 
+static int
+bnxt_parse_devarg_app_instance_id(__rte_unused const char *key,
+				  const char *value, void *opaque_arg)
+{
+	struct bnxt *bp = opaque_arg;
+	unsigned long app_instance_id;
+	char *end = NULL;
+
+	if (!opaque_arg) {
+		PMD_DRV_LOG_LINE(ERR,
+				 "Invalid param passed to app-instance-id devarg");
+		return -EINVAL;
+	}
+
+	app_instance_id = strtoul(value, &end, 10);
+	if (end == NULL || *end != '\0' ||
+	    (app_instance_id == ULONG_MAX && errno == ERANGE)) {
+		PMD_DRV_LOG_LINE(ERR,
+				 "Invalid parameter passed to instance devargs");
+		return -EINVAL;
+	}
+
+	if (BNXT_DEVARG_APP_INSTANCE_ID_INVALID(app_instance_id)) {
+		PMD_DRV_LOG_LINE(ERR, "Invalid app-instance-id(%d) devargs",
+				 (uint16_t)app_instance_id);
+		return -EINVAL;
+	}
+
+	bp->app_instance_id = app_instance_id;
+	PMD_DRV_LOG_LINE(INFO, "app_instance_id=%u feature enabled",
+			 (uint16_t)app_instance_id);
+	return 0;
+}
+
 static int
 bnxt_parse_devarg_app_id(__rte_unused const char *key,
 				 const char *value, void *opaque_arg)
drivers/net/bnxt/hcapi/cfa_v3/include/cfa_resources.h +8 -0
index d1d62738d3..ada9741dfa 100644
@@ -194,6 +194,14 @@ enum cfa_resource_subtype_gim {
 	 CFA_RSUBTYPE_SM_MAX + CFA_RSUBTYPE_TSM_MAX + CFA_RSUBTYPE_TIM_MAX +   \
 	 CFA_RSUBTYPE_GIM_MAX)
 
+#define CFA_HOT_UPGRADE_APP_INSTANCE_MAX 4
+enum cfa_hot_upgrade_cmd_op {
+	CFA_HOT_UPGRADE_CMD_ALLOC = 1,
+	CFA_HOT_UPGRADE_CMD_FREE,
+	CFA_HOT_UPGRADE_CMD_GET,
+	CFA_HOT_UPGRADE_CMD_SET
+};
+
 /**
  * @}
  */
drivers/net/bnxt/hsi_struct_def_dpdk.h +205 -2

237 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/meson.build +1 -0
index 5f467d6e5e..159e7a2b17 100644
@@ -31,4 +31,5 @@ sources += files(
         'tfc_util.c',
         'tfo.c',
         'tfc_vf2pf_msg.c',
+        'tfc_hot_upgrade.c',
 )
drivers/net/bnxt/tf_core/v3/tfc.h +84 -0

88 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_hot_upgrade.c new file +142 -0

142 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_msg.c +52 -0

55 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_msg.h +7 -0
index 2d1a6816c0..3bf6b04a12 100644
@@ -174,3 +174,10 @@ tfc_msg_if_tbl_get(struct tfc *tfcp, uint16_t fid, uint16_t sid,
 int tfc_msg_resc_usage_query(struct tfc *tfcp, uint16_t sid, enum cfa_dir dir,
 			     uint16_t *data_size, void *data);
 #endif /* TF_FLOW_SCALE_QUERY  */
+
+int
+tfc_msg_hot_upgrade_process(struct tfc *tfcp, uint16_t fid, uint16_t sid,
+			    uint8_t app_inst_id,
+			    enum cfa_hot_upgrade_cmd_op cmd_op,
+			    uint8_t cur_cnt,
+			    uint8_t *app_inst_cnt);
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +3 -0
index 3a2745d405..afd883df2c 100644
@@ -139,6 +139,7 @@ struct bnxt_ulp_data {
 	uint32_t			max_def_priority;
 	uint32_t			min_flow_priority;
 	uint32_t			max_flow_priority;
+	uint32_t			ha_priority;
 	uint32_t			vxlan_port;
 	uint32_t			vxlan_gpe_port;
 	uint32_t			vxlan_ip_port;
@@ -164,6 +165,8 @@ struct bnxt_ulp_data {
 	uint64_t			default_act_bits;
 	struct ulp_fc_tfc_stats_cache_entry *stats_cache;
 	struct bnxt_ulp_sc_info		*sc_info;
+	struct bnxt_ulp_tfc_ha_mgr_info *tfc_ha_info;
+	uint8_t				app_instance_id;
 };
 
 enum bnxt_ulp_tfo_type {
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +10 -0
index ab02b01b46..4c4d963a3a 100644
@@ -13,6 +13,7 @@
 #include "ulp_fc_mgr.h"
 #include "ulp_port_db.h"
 #include "ulp_ha_mgr.h"
+#include "ulp_tfc_ha_mgr.h"
 #include "ulp_tun.h"
 #include <rte_malloc.h>
 #include "ulp_template_db_tbl.h"
@@ -90,8 +91,10 @@ bnxt_ulp_set_prio_attribute(struct ulp_rte_parser_params *params,
 {
 	uint32_t max_p = bnxt_ulp_max_flow_priority_get(params->ulp_ctx);
 	uint32_t min_p = bnxt_ulp_min_flow_priority_get(params->ulp_ctx);
+	uint32_t hot_prio = bnxt_ulp_ha_priority_id_get(params->ulp_ctx);
 
 	if (max_p < min_p) {
+		min_p -= hot_prio;
 		if (unlikely(attr->priority > min_p || attr->priority < max_p)) {
 			BNXT_DRV_DBG(ERR, "invalid prio, not in range %u:%u\n",
 				     max_p, min_p);
@@ -99,6 +102,7 @@ bnxt_ulp_set_prio_attribute(struct ulp_rte_parser_params *params,
 		}
 		params->priority = attr->priority;
 	} else {
+		max_p -= hot_prio;
 		if (unlikely(attr->priority > max_p || attr->priority < min_p)) {
 			BNXT_DRV_DBG(ERR, "invalid prio, not in range %u:%u\n",
 				     min_p, max_p);
@@ -243,6 +247,12 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_parms *mparms,
 				    1);
 	}
 
+	/* update the Hot upgrade flag */
+	if (bnxt_ulp_tfc_hot_upgrade_enabled(params->ulp_ctx) &&
+	    bnxt_ulp_tfc_hot_upgrade_is_secondary(params->ulp_ctx))
+		ULP_BITMAP_SET(mparms->cf_bitmap,
+			       BNXT_ULP_CF_BIT_HOT_UP_SECONDARY);
+
 	/* Update the socket direct flag */
 	if (ULP_BITMAP_ISSET(params->hdr_bitmap.bits,
 			     BNXT_ULP_HDR_BIT_SVIF_IGNORE)) {
drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c +34 -8

78 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h +60 -0

64 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/meson.build +55 -1

61 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.c +4 -0
index c463bce3d4..1901845499 100644
@@ -3785,6 +3785,7 @@ ulp_mapper_func_info_process(struct bnxt_ulp_mapper_parms *parms,
 		process_src1 = 1;
 	case BNXT_ULP_FUNC_OPC_COND_LIST:
 	case BNXT_ULP_FUNC_OPC_APP_PRIORITY:
+	case BNXT_ULP_FUNC_OPC_GET_HA_PRIORITY:
 		break;
 	case BNXT_ULP_FUNC_OPC_PORT_TABLE:
 		process_src1 = 1;
@@ -3920,6 +3921,9 @@ ulp_mapper_func_info_process(struct bnxt_ulp_mapper_parms *parms,
 							    CFA_RSUBTYPE_TCAM_WC,
 							    (uint32_t)res1,
 							    (uint16_t)res2);
+	case BNXT_ULP_FUNC_OPC_GET_HA_PRIORITY:
+		res = bnxt_ulp_ha_priority_id_get(parms->ulp_ctx);
+		break;
 	default:
 		BNXT_DRV_DBG(ERR, "invalid func code %u\n",
 			     func_info->func_opc);
drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c +1 -1
index 046d2c5cf9..20b1ac09fc 100644
@@ -316,7 +316,7 @@ ulp_mapper_tfc_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		/* allocate the tcam entry, only need the length */
 		(void)ulp_blob_data_get(key, &key_sz_in_bits);
 		key_sz_in_words = ULP_BITS_2_BYTE(key_sz_in_bits);
-		tfc_inf.dir = tbl->direction; /* PKB.need an api */
+		tfc_inf.dir = tbl->direction;
 		tfc_inf.rsubtype = tbl->resource_type;
 
 		rc = tfc_tcam_alloc(tfcp, fw_fid, tt, priority,
drivers/net/bnxt/tf_ulp/ulp_sc_mgr.c +4 -3
index 6b6733133a..fc4207b36c 100644
@@ -158,6 +158,8 @@ ulp_sc_mgr_deinit(struct bnxt_ulp_context *ctxt)
 	if (!ulp_sc_info)
 		return -EINVAL;
 
+	ulp_sc_mgr_thread_cancel(ctxt);
+
 	if (ulp_sc_info->stats_cache_tbl)
 		rte_free(ulp_sc_info->stats_cache_tbl);
 
@@ -208,11 +210,11 @@ static uint32_t ulp_stats_cache_main_loop(void *arg)
 				goto terminate;
 			rte_delay_us_block(ULP_SC_CTX_DELAY);
 		}
+		bnxt_ulp_cntxt_entry_release();
 
 		/* get the stats counter info block from ulp context */
 		ulp_sc_info = bnxt_ulp_cntxt_ptr2_sc_info_get(ctxt);
 		if (unlikely(!ulp_sc_info)) {
-			bnxt_ulp_cntxt_entry_release();
 			goto terminate;
 		}
 
@@ -247,7 +249,6 @@ static uint32_t ulp_stats_cache_main_loop(void *arg)
 				tfcp = bnxt_ulp_cntxt_tfcp_get(sce->ctxt);
 				if (unlikely(!tfcp)) {
 					bnxt_ulp_cntxt_release_fdb_lock(ctxt);
-					bnxt_ulp_cntxt_entry_release();
 					goto terminate;
 				}
 
@@ -307,7 +308,6 @@ static uint32_t ulp_stats_cache_main_loop(void *arg)
 				data += ULP_SC_PAGE_SIZE;
 			}
 		}
-		bnxt_ulp_cntxt_entry_release();
 		/* Sleep to give any other threads opportunity to access ULP */
 		rte_delay_us_sleep(ULP_SC_PERIOD_US);
 	}
@@ -400,6 +400,7 @@ void ulp_sc_mgr_thread_cancel(struct bnxt_ulp_context *ctxt)
 		return;
 
 	ulp_sc_info->flags &= ~ULP_FLAG_SC_THREAD;
+	pthread_cancel(ulp_sc_info->tid);
 }
 
 /*
drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.c new file +264 -0

264 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.h new file +40 -0
new file mode 100644
index 0000000000..44cbf56c0a
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2014-2024 Broadcom
+ * All rights reserved.
+ */
+
+#ifndef _ULP_TFC_HA_MGR_H_
+#define _ULP_TFC_HA_MGR_H_
+
+#include "bnxt_ulp.h"
+
+enum ulp_tfc_ha_mgr_state {
+	ULP_TFC_HA_STATE_INVALID = 0,
+	ULP_TFC_HA_STATE_PRIMARY,
+	ULP_TFC_HA_STATE_SECONDARY,
+	ULP_TFC_HA_STATE_MAX,
+};
+
+struct bnxt_ulp_tfc_ha_mgr_info {
+	enum ulp_tfc_ha_mgr_state ha_state;
+	uint32_t app_inst_id;
+	uint32_t app_inst_cnt;
+};
+
+bool
+bnxt_ulp_tfc_hot_upgrade_enabled(struct bnxt_ulp_context *ulp_ctx);
+
+bool
+bnxt_ulp_tfc_hot_upgrade_is_secondary(struct bnxt_ulp_context *ulp_ctx);
+
+int32_t
+ulp_tfc_hot_upgrade_mgr_init(struct bnxt_ulp_context *ulp_ctx);
+
+void
+ulp_tfc_hot_upgrade_mgr_deinit(struct bnxt_ulp_context *ulp_ctx);
+
+int32_t
+ulp_ha_mgr_state_get(struct bnxt_ulp_context *ulp_ctx,
+		     enum ulp_ha_mgr_state *state);
+
+#endif /* _ULP_TFC_HA_MGR_H_*/
Signature · 1 line
2.39.5 (Apple Git-154)
#229 lore raw

Re: [PATCH v5 19/57] net/bnxt/tf_ulp: hot upgrade support

Quoted 7 lines · On Wed, 29 Oct 2025 12:06:34 -0400 Manish Kurup <[email protected]>…

From: Kishore Padmanabha <[email protected]>

Add support for hot upgrade for a generic application. An application can start a backup application and add the same flows that has been offloaded in primary application and secondary application can take over primary application.

Quoted 7 lines

Update the hwrm version to the correct version number, the corresponding code version for hot upgrade api got changed.

---

After merge to main the build fails because of this patch

$ meson setup build
...
Has header "bpf/bpf.h" : YES
Checking for function "xsk_socket__create_shared" with dependencies libxdp, libbpf: YES
Checking for function "bpf_object__next_program" with dependency libbpf: YES
Checking for function "bpf_xdp_attach" with dependency libbpf: YES
Checking for function "xsk_socket__update_xskmap" with dependencies libxdp, libbpf: YES
Message: drivers/net/af_xdp: Defining dependency "net_af_xdp"
Message: drivers/net/ark: Defining dependency "net_ark"
Message: drivers/net/atlantic: Defining dependency "net_atlantic"
Message: drivers/net/avp: Defining dependency "net_avp"
Message: drivers/net/axgbe: Defining dependency "net_axgbe"
Run-time dependency zlib found: YES 1.3.1
Message: drivers/net/bnx2x: Defining dependency "net_bnx2x"
Compiler for C supports arguments -DSUPPORT_CFA_HW_P70=1: YES
drivers/net/bnxt/tf_ulp/meson.build:41:3: ERROR: Option bnxt_tf_template does not exist.
A full log can be found at /home/shemminger/DPDK/main/build/meson-logs/meson-log.txt
#230 lore raw

Re: [PATCH v5 19/57] net/bnxt/tf_ulp: hot upgrade support

Quoted 34 lines · On Mon, Nov 10, 2025 at 16:52 Stephen Hemminger <[email protected]>…
Quoted 7 lines · On Wed, 29 Oct 2025 12:06:34 -0400 Manish Kurup <[email protected]>…

From: Kishore Padmanabha <[email protected]>

Add support for hot upgrade for a generic application. An application can start a backup application and add the same flows that has been offloaded in primary application and secondary application can take over primary application.

Quoted 7 lines

Update the hwrm version to the correct version number, the corresponding code version for hot upgrade api got changed.

---

After merge to main the build fails because of this patch

$ meson setup build
...
Has header "bpf/bpf.h" : YES
Checking for function "xsk_socket__create_shared" with dependencies
libxdp, libbpf: YES
Checking for function "bpf_object__next_program" with dependency libbpf:
YES
Checking for function "bpf_xdp_attach" with dependency libbpf: YES
Checking for function "xsk_socket__update_xskmap" with dependencies
libxdp, libbpf: YES
Message: drivers/net/af_xdp: Defining dependency "net_af_xdp"
Message: drivers/net/ark: Defining dependency "net_ark"
Message: drivers/net/atlantic: Defining dependency "net_atlantic"
Message: drivers/net/avp: Defining dependency "net_avp"
Quoted 8 lines
Message: drivers/net/axgbe: Defining dependency "net_axgbe"
Run-time dependency zlib found: YES 1.3.1
Message: drivers/net/bnx2x: Defining dependency "net_bnx2x"
Compiler for C supports arguments -DSUPPORT_CFA_HW_P70=1: YES
drivers/net/bnxt/tf_ulp/meson.build:41:3: ERROR: Option bnxt_tf_template
does not exist.
A full log can be found at
/home/shemminger/DPDK/main/build/meson-logs/meson-log.txt

Hi Stephen,

I noticed that one of the patches that update the meson build options was rejected. This is probably why the build fails. I’ll take a look to confirm.

Thanks

Quoted 2 lines
#231 lore raw

Re: [PATCH v5 19/57] net/bnxt/tf_ulp: hot upgrade support

Quoted 46 lines · On Mon, 10 Nov 2025 17:01:17 -0500 Manish Kurup <[email protected]>…
Quoted 34 lines · On Mon, Nov 10, 2025 at 16:52 Stephen Hemminger <[email protected]>…
Quoted 7 lines · On Wed, 29 Oct 2025 12:06:34 -0400 Manish Kurup <[email protected]>…

From: Kishore Padmanabha <[email protected]>

Add support for hot upgrade for a generic application. An application can start a backup application and add the same flows that has been offloaded in primary application and secondary application can take over primary application.

Quoted 7 lines

Update the hwrm version to the correct version number, the corresponding code version for hot upgrade api got changed.

---

After merge to main the build fails because of this patch

$ meson setup build
...
Has header "bpf/bpf.h" : YES
Checking for function "xsk_socket__create_shared" with dependencies
libxdp, libbpf: YES
Checking for function "bpf_object__next_program" with dependency libbpf:
YES
Checking for function "bpf_xdp_attach" with dependency libbpf: YES
Checking for function "xsk_socket__update_xskmap" with dependencies
libxdp, libbpf: YES
Message: drivers/net/af_xdp: Defining dependency "net_af_xdp"
Message: drivers/net/ark: Defining dependency "net_ark"
Message: drivers/net/atlantic: Defining dependency "net_atlantic"
Message: drivers/net/avp: Defining dependency "net_avp"
Quoted 8 lines
Message: drivers/net/axgbe: Defining dependency "net_axgbe"
Run-time dependency zlib found: YES 1.3.1
Message: drivers/net/bnx2x: Defining dependency "net_bnx2x"
Compiler for C supports arguments -DSUPPORT_CFA_HW_P70=1: YES
drivers/net/bnxt/tf_ulp/meson.build:41:3: ERROR: Option bnxt_tf_template
does not exist.
A full log can be found at
/home/shemminger/DPDK/main/build/meson-logs/meson-log.txt  
Quoted 9 lines

Hi Stephen,

I noticed that one of the patches that update the meson build options was rejected. This is probably why the build fails. I’ll take a look to confirm.

Thanks

Quoted 2 lines

This series should have never gone into the broadcom-next tree. One of the roles of maintainer is to make sure local builds with all flavors of compiler work before merging.

#232 lore raw

Re: [PATCH v5 19/57] net/bnxt/tf_ulp: hot upgrade support

10/11/2025 23:10, Stephen Hemminger:

Quoted 3 lines

This series should have never gone into the broadcom-next tree. One of the roles of maintainer is to make sure local builds with all flavors of compiler work before merging.

To name a few we could also talk about hiding fixes (and backports), forgetting the documentation, wrong commit explanations. And many more could be said.
As I said in another email, we should not accept such future series until something is seriously changed in bnxt management. For now I pull from the bnxt tree as it is what was planned.

#233 lore raw

Re: [PATCH v5 19/57] net/bnxt/tf_ulp: hot upgrade support

Also, it seems the driver is compiling different versions based on compile flags. This makes it hard to manage in a Linux distribution

Quoted 14 lines · On Mon, Nov 10, 2025, 14:30 Thomas Monjalon <[email protected]> wrote:

10/11/2025 23:10, Stephen Hemminger:

Quoted 3 lines

This series should have never gone into the broadcom-next tree. One of the roles of maintainer is to make sure local builds with all flavors of compiler work before merging.

To name a few we could also talk about hiding fixes (and backports), forgetting the documentation, wrong commit explanations. And many more could be said.
As I said in another email, we should not accept such future series until something is seriously changed in bnxt management. For now I pull from the bnxt tree as it is what was planned.

#234 lore raw

Re: [PATCH v5 19/57] net/bnxt/tf_ulp: hot upgrade support

In reply to Stephen Hemminger

10/11/2025 22:52, Stephen Hemminger:

Quoted 11 lines

After merge to main the build fails because of this patch

$ meson setup build
...
Has header "bpf/bpf.h" : YES
Checking for function "xsk_socket__create_shared" with dependencies libxdp, libbpf: YES
Checking for function "bpf_object__next_program" with dependency libbpf: YES
Checking for function "bpf_xdp_attach" with dependency libbpf: YES
Checking for function "xsk_socket__update_xskmap" with dependencies libxdp, libbpf: YES
Message: drivers/net/af_xdp: Defining dependency "net_af_xdp"
Message: drivers/net/ark: Defining dependency "net_ark"
Quoted 8 lines
Message: drivers/net/atlantic: Defining dependency "net_atlantic"
Message: drivers/net/avp: Defining dependency "net_avp"
Message: drivers/net/axgbe: Defining dependency "net_axgbe"
Run-time dependency zlib found: YES 1.3.1
Message: drivers/net/bnx2x: Defining dependency "net_bnx2x"
Compiler for C supports arguments -DSUPPORT_CFA_HW_P70=1: YES
drivers/net/bnxt/tf_ulp/meson.build:41:3: ERROR: Option bnxt_tf_template does not exist.
A full log can be found at /home/shemminger/DPDK/main/build/meson-logs/meson-log.txt

Yes, sorry the merge is only partial.
I was assuming each commit could compile. It is totally wrong.
Even after the first patch, compilation is broken. I'm hesitating to reject all.

I propose to make sure the build is fixed after the series, and keep compilation breakages in the middle of the series, making git bisect impossible at this point of the tree.
If I do that, I probably won't merge any other bnxt patch for a long time, waiting for a better process in bnxt management in general.

#235 lore raw

PATCH v5 20/57 net/bnxt/tf_core: tcam manager logical id free

In reply to Manish Kurup

From: Farah Smith <[email protected]>

Remove code allocating entry 0 during initialization as it is not required. 0 is a valid entry. Update session_bmp naming to more descriptive logical_id_bmp. The data structure cfa_tcam_mgr_data is per session. Within the cfa_tcam_mgr_data, logical ids for TCAM entries are allocated from a global pool.

---
 drivers/net/bnxt/tf_core/cfa_tcam_mgr.c       | 35 +++++++------------
 .../net/bnxt/tf_core/cfa_tcam_mgr_device.h    |  6 ++--
 drivers/net/bnxt/tf_core/cfa_tcam_mgr_p4.c    |  2 +-
 drivers/net/bnxt/tf_core/cfa_tcam_mgr_p58.c   |  2 +-
 4 files changed, 19 insertions(+), 26 deletions(-)
drivers/net/bnxt/tf_core/cfa_tcam_mgr.c +13 -22
index 89ca6814e5..c527750041 100644
@@ -914,9 +914,8 @@ cfa_tcam_mgr_bitmap_alloc(struct tf *tfp __rte_unused,
 			  struct cfa_tcam_mgr_data *tcam_mgr_data)
 {
 	struct tfp_calloc_parms cparms;
-	uint64_t session_bmp_size;
-	struct bitalloc *session_bmp;
-	int32_t first_idx;
+	uint64_t logical_id_bmp_size;
+	struct bitalloc *logical_id_bmp;
 	int max_entries;
 	int rc;
 
@@ -924,11 +923,11 @@ cfa_tcam_mgr_bitmap_alloc(struct tf *tfp __rte_unused,
 		return -CFA_TCAM_MGR_ERR_CODE(INVAL);
 
 	max_entries = tcam_mgr_data->cfa_tcam_mgr_max_entries;
-	session_bmp_size = (sizeof(uint64_t) *
+	logical_id_bmp_size = (sizeof(uint64_t) *
 				(((max_entries - 1) / sizeof(uint64_t)) + 1));
 
 	cparms.nitems = 1;
-	cparms.size = session_bmp_size;
+	cparms.size = logical_id_bmp_size;
 	cparms.alignment = 0;
 	rc = tfp_calloc(&cparms);
 	if (rc) {
@@ -939,23 +938,15 @@ cfa_tcam_mgr_bitmap_alloc(struct tf *tfp __rte_unused,
 		return -CFA_TCAM_MGR_ERR_CODE(NOMEM);
 	}
 
-	session_bmp = (struct bitalloc *)cparms.mem_va;
-	rc = ba_init(session_bmp, max_entries, true);
+	logical_id_bmp = (struct bitalloc *)cparms.mem_va;
+	rc = ba_init(logical_id_bmp, max_entries, true);
 
-	tcam_mgr_data->session_bmp = session_bmp;
-	tcam_mgr_data->session_bmp_size = max_entries;
-
-	/* Allocate first index to avoid idx 0 */
-	first_idx = ba_alloc(tcam_mgr_data->session_bmp);
-	if (first_idx == BA_FAIL) {
-		tfp_free(tcam_mgr_data->session_bmp);
-		tcam_mgr_data->session_bmp = NULL;
-		return -CFA_TCAM_MGR_ERR_CODE(NOSPC);
-	}
+	tcam_mgr_data->logical_id_bmp = logical_id_bmp;
+	tcam_mgr_data->logical_id_bmp_size = max_entries;
 
 	TFP_DRV_LOG(DEBUG,
 		    "session bitmap size is %" PRIX64 "\n",
-		    tcam_mgr_data->session_bmp_size);
+		    tcam_mgr_data->logical_id_bmp_size);
 
 	return 0;
 }
@@ -1135,7 +1126,7 @@ static int cfa_tcam_mgr_free_entries(struct tf *tfp)
 	 * may not be of the same type, resulting in errors.
 	 */
 
-	while ((entry_id = ba_find_next_inuse_free(tcam_mgr_data->session_bmp,
+	while ((entry_id = ba_find_next_inuse_free(tcam_mgr_data->logical_id_bmp,
 						   0)) >= 0) {
 		free_parms.id = entry_id;
 		free_parms.type = CFA_TCAM_MGR_TBL_TYPE_MAX;
@@ -1405,7 +1396,7 @@ static int cfa_tcam_mgr_alloc_entry(struct tf *tfp __rte_unused,
 	int32_t free_idx;
 
 	/* Scan bitmap to get the free pool */
-	free_idx = ba_alloc(tcam_mgr_data->session_bmp);
+	free_idx = ba_alloc(tcam_mgr_data->logical_id_bmp);
 	if (free_idx == BA_FAIL) {
 		PMD_DRV_LOG_LINE(ERR,
 				 "Table full (session)");
@@ -1423,10 +1414,10 @@ static int cfa_tcam_mgr_free_entry(struct tf *tfp __rte_unused,
 {
 	int rc = 0;
 
-	if (entry_id >= tcam_mgr_data->session_bmp_size)
+	if (entry_id >= tcam_mgr_data->logical_id_bmp_size)
 		return -CFA_TCAM_MGR_ERR_CODE(INVAL);
 
-	rc = ba_free(tcam_mgr_data->session_bmp, entry_id);
+	rc = ba_free(tcam_mgr_data->logical_id_bmp, entry_id);
 	if (rc)
 		return rc;
 
drivers/net/bnxt/tf_core/cfa_tcam_mgr_device.h +4 -2
index 9d7f560e7b..1b5803f021 100644
@@ -123,8 +123,10 @@ struct cfa_tcam_mgr_data {
 		cfa_tcam_mgr_tables[TF_DIR_MAX][CFA_TCAM_MGR_TBL_TYPE_MAX];
 	void *table_rows;
 	struct cfa_tcam_mgr_entry_data *entry_data;
-	struct bitalloc *session_bmp;
-	uint64_t session_bmp_size;
+	/* Logical ids assigned for all TCAM types */
+	struct bitalloc *logical_id_bmp;
+	/* Sum of all TCAM entries allocated  */
+	uint64_t logical_id_bmp_size;
 	void *row_tables[TF_DIR_MAX][TF_TCAM_TBL_TYPE_MAX];
 	void *rx_row_data;
 	void *tx_row_data;
drivers/net/bnxt/tf_core/cfa_tcam_mgr_p4.c +1 -1
index ddc2728785..55b6b96439 100644
@@ -374,7 +374,7 @@ static void cfa_tcam_mgr_data_free(struct tf_session *tfs)
 
 	tfp_free(tcam_mgr_data->table_rows);
 	tfp_free(tcam_mgr_data->entry_data);
-	tfp_free(tcam_mgr_data->session_bmp);
+	tfp_free(tcam_mgr_data->logical_id_bmp);
 	cfa_tcam_mgr_row_data_free(tcam_mgr_data);
 
 	tfp_free(tcam_mgr_data);
drivers/net/bnxt/tf_core/cfa_tcam_mgr_p58.c +1 -1
index d5725f92e0..5b7e469e8a 100644
@@ -372,7 +372,7 @@ static void cfa_tcam_mgr_data_free(struct tf_session *tfs)
 
 	tfp_free(tcam_mgr_data->table_rows);
 	tfp_free(tcam_mgr_data->entry_data);
-	tfp_free(tcam_mgr_data->session_bmp);
+	tfp_free(tcam_mgr_data->logical_id_bmp);
 	cfa_tcam_mgr_row_data_free(tcam_mgr_data);
 
 	tfp_free(tcam_mgr_data);
Signature · 1 line
2.39.5 (Apple Git-154)
#236 lore raw

PATCH v5 21/57 net/bnxt/tf_ulp: stats counter memory cleanup

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

The stats counter cache memory initialization did not print the error message on failure, updated the initialization to print error message on failure.

---
 drivers/net/bnxt/tf_ulp/ulp_sc_mgr.c | 35 ++++++++++++++++++----------
 1 file changed, 23 insertions(+), 12 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_sc_mgr.c +23 -12
index fc4207b36c..b246b90fe2 100644
@@ -63,29 +63,30 @@ int32_t ulp_sc_mgr_init(struct bnxt_ulp_context *ctxt)
 	int i;
 
 	if (!ctxt) {
-		BNXT_DRV_DBG(DEBUG, "Invalid ULP CTXT\n");
+		BNXT_DRV_DBG(ERR, "Invalid ULP CTXT\n");
 		return -EINVAL;
 	}
 
 	if (bnxt_ulp_cntxt_dev_id_get(ctxt, &dev_id)) {
-		BNXT_DRV_DBG(DEBUG, "Failed to get device id\n");
+		BNXT_DRV_DBG(ERR, "Failed to get device id\n");
 		return -EINVAL;
 	}
 
 	dparms = bnxt_ulp_device_params_get(dev_id);
 	if (!dparms) {
-		BNXT_DRV_DBG(DEBUG, "Failed to device parms\n");
+		BNXT_DRV_DBG(ERR, "Failed to device parms\n");
 		return -EINVAL;
 	}
 
 	sc_ops = bnxt_ulp_sc_ops_get(ctxt);
 	if (sc_ops == NULL) {
-		BNXT_DRV_DBG(DEBUG, "Failed to get the counter ops\n");
+		BNXT_DRV_DBG(ERR, "Failed to get the counter ops\n");
 		return -EINVAL;
 	}
 
 	ulp_sc_info = rte_zmalloc("ulp_sc_info", sizeof(*ulp_sc_info), 0);
 	if (!ulp_sc_info) {
+		BNXT_DRV_DBG(ERR, "Failed to allocate stats cache container\n");
 		rc = -ENOMEM;
 		goto error;
 	}
@@ -99,8 +100,9 @@ int32_t ulp_sc_mgr_init(struct bnxt_ulp_context *ctxt)
 	ulp_sc_info->num_counters = dparms->ext_flow_db_num_entries;
 	if (!ulp_sc_info->num_counters) {
 		/* No need for software counters, call fw directly */
-		BNXT_DRV_DBG(DEBUG, "Sw flow counter support not enabled\n");
-		return 0;
+		BNXT_DRV_DBG(ERR, "Num of flow entries is not configured\n");
+		rc = -EINVAL;
+		goto error;
 	}
 
 	/*
@@ -115,6 +117,7 @@ int32_t ulp_sc_mgr_init(struct bnxt_ulp_context *ctxt)
 	ulp_sc_info->stats_cache_tbl = rte_zmalloc("ulp_stats_cache_tbl",
 						   stats_cache_tbl_sz, 0);
 	if (!ulp_sc_info->stats_cache_tbl) {
+		BNXT_DRV_DBG(ERR, "Failed to allocate stats cache table\n");
 		rc = -ENOMEM;
 		goto error;
 	}
@@ -123,7 +126,7 @@ int32_t ulp_sc_mgr_init(struct bnxt_ulp_context *ctxt)
 					     ULP_SC_BATCH_SIZE * ULP_SC_PAGE_SIZE,
 					     ULP_SC_PAGE_SIZE);
 	if (!ulp_sc_info->read_data) {
-		rte_free(ulp_sc_info->stats_cache_tbl);
+		BNXT_DRV_DBG(ERR, "Failed to allocate stats cache data\n");
 		rc = -ENOMEM;
 		goto error;
 	}
@@ -135,10 +138,15 @@ int32_t ulp_sc_mgr_init(struct bnxt_ulp_context *ctxt)
 	}
 
 	rc = ulp_sc_mgr_thread_start(ctxt);
-	if (rc)
-		BNXT_DRV_DBG(DEBUG, "Stats counter thread start failed\n");
+	if (rc) {
+		BNXT_DRV_DBG(ERR, "Stats cache thread start failed\n");
+		rc = -EIO;
+		goto error;
+	}
 
- error:
+	return 0;
+error:
+	ulp_sc_mgr_deinit(ctxt);
 	return rc;
 }
 
@@ -399,8 +407,11 @@ void ulp_sc_mgr_thread_cancel(struct bnxt_ulp_context *ctxt)
 	if (!ulp_sc_info)
 		return;
 
-	ulp_sc_info->flags &= ~ULP_FLAG_SC_THREAD;
-	pthread_cancel(ulp_sc_info->tid);
+	/* if thread started then stop it */
+	if (ulp_sc_info->flags & ULP_FLAG_SC_THREAD) {
+		pthread_cancel((pthread_t)ulp_sc_info->tid.opaque_id);
+		ulp_sc_info->flags &= ~ULP_FLAG_SC_THREAD;
+	}
 }
 
 /*
Signature · 1 line
2.39.5 (Apple Git-154)
#237 lore raw

PATCH v5 22/57 net/bnxt: Cleanup max VF calculation for thor2

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

The number of max VFs per PF is 128 for THOR2. Correctly calculated the VNIC hash table creation if the number of max vnics is less than 8.

---
 drivers/net/bnxt/bnxt.h      |  2 ++
 drivers/net/bnxt/bnxt_vnic.c | 11 +++++++++++
 2 files changed, 13 insertions(+)
drivers/net/bnxt/bnxt.h +2 -0
index 00bdb53215..90352d537c 100644
@@ -260,8 +260,10 @@ struct bnxt_pf_info {
 #define BNXT_MAX_VFS(bp)	((bp)->pf->max_vfs)
 #define BNXT_MAX_VF_REPS_P4     64
 #define BNXT_MAX_VF_REPS_P5     256
+#define BNXT_MAX_VF_REPS_P7     128
 #define BNXT_MAX_VF_REPS(bp) \
 				(BNXT_CHIP_P5(bp) ? BNXT_MAX_VF_REPS_P5 : \
+				BNXT_CHIP_P7(bp) ? BNXT_MAX_VF_REPS_P7 : \
 				BNXT_MAX_VF_REPS_P4)
 #define BNXT_TOTAL_VFS(bp)	((bp)->pf->total_vfs)
 #define BNXT_FIRST_VF_FID	128
drivers/net/bnxt/bnxt_vnic.c +11 -0
index 7b028f2ee5..637e9b9aa4 100644
@@ -16,6 +16,11 @@
 #include "hsi_struct_def_dpdk.h"
 #include "bnxt_hwrm.h"
 
+#ifndef RTE_HASH_BUCKET_ENTRIES
+/* it is defined in lib/hash/rte_cuckoo_hash.h */
+#define RTE_HASH_BUCKET_ENTRIES     8
+#endif /* RTE_HASH_BUCKET_ENTRIES */
+
 /* Macros to manipulate vnic bitmaps*/
 #define BNXT_VNIC_BITMAP_SIZE	64
 #define BNXT_VNIC_BITMAP_SET(b, i)	((b[(i) / BNXT_VNIC_BITMAP_SIZE]) |= \
@@ -978,6 +983,12 @@ int32_t bnxt_vnic_queue_db_init(struct bnxt *bp)
 	hash_tbl_params.name = hash_tbl_name;
 	hash_tbl_params.entries = (bp->max_vnics > BNXT_VNIC_MAX_SUPPORTED_ID) ?
 		BNXT_VNIC_MAX_SUPPORTED_ID : bp->max_vnics;
+
+	/* if the number of max vnis is less than bucket size */
+	/* then let the max entries size be the least value */
+	if (hash_tbl_params.entries <= RTE_HASH_BUCKET_ENTRIES)
+		hash_tbl_params.entries = RTE_HASH_BUCKET_ENTRIES;
+
 	hash_tbl_params.key_len = BNXT_VNIC_MAX_QUEUE_SZ_IN_8BITS;
 	hash_tbl_params.socket_id = rte_socket_id();
 	bp->vnic_queue_db.rss_q_db = rte_hash_create(&hash_tbl_params);
Signature · 1 line
2.39.5 (Apple Git-154)
#238 lore raw

PATCH v5 23/57 net/bnxt/tf_ulp: ovs-dpdk packet drop observed with thor2

In reply to Manish Kurup

From: Peter Spreadborough <[email protected]>

Incorrect packet counts were being returned for ovs flows. This was happening when stats counter was doing read-clear for flow stats at a rate faster than OVS was reading the stats from us. In this scenario SC would read a count and as a result the HW counter would be reset, SC would then do a second read which would replace the current count and it would be lost. The fix is to never do read-clear and always update with the latest full count. If the application requests a reset then the current count is returned minus the last value read and the last value read updated with the current count, hence just the delta is returned.

---
 drivers/net/bnxt/tf_ulp/ulp_sc_mgr.c | 79 +++++++++++++++++++---------
 drivers/net/bnxt/tf_ulp/ulp_sc_mgr.h |  2 +
 2 files changed, 57 insertions(+), 24 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_sc_mgr.c +55 -24
index b246b90fe2..24012e30b1 100644
@@ -26,6 +26,8 @@
 #define ULP_TFC_CNTR_ALIGN 32
 #define ULP_TFC_ACT_WORD_SZ 32
 
+#define ULP_SC_MAX_COUNT 0xFFFFFFFFFFFFFFFFULL
+
 static const struct bnxt_ulp_sc_core_ops *
 bnxt_ulp_sc_ops_get(struct bnxt_ulp_context *ctxt)
 {
@@ -182,7 +184,7 @@ ulp_sc_mgr_deinit(struct bnxt_ulp_context *ctxt)
 	return 0;
 }
 
-#define ULP_SC_PERIOD_US 256
+#define ULP_SC_PERIOD_US 100000
 #define ULP_SC_CTX_DELAY 10000
 
 static uint32_t ulp_stats_cache_main_loop(void *arg)
@@ -265,12 +267,12 @@ static uint32_t ulp_stats_cache_main_loop(void *arg)
 					(uint64_t)sce;
 
 				rc = sc_ops->ulp_stats_cache_update(tfcp,
-								    sce->dir,
-								    data,
-								    sce->handle,
-								    &words,
-								    &batch_info,
-								    sce->reset);
+					    sce->dir,
+					    &ulp_sc_info->read_data_iova[batch],
+					    sce->handle,
+					    &words,
+					    &batch_info,
+					    false);
 				if (unlikely(rc)) {
 					/* Abort this batch */
 					PMD_DRV_LOG_LINE(ERR,
@@ -278,9 +280,6 @@ static uint32_t ulp_stats_cache_main_loop(void *arg)
 					break;
 				}
 
-				if (sce->reset)
-					sce->reset = false;
-
 				/* Next */
 				batch++;
 				sce++;
@@ -308,9 +307,15 @@ static uint32_t ulp_stats_cache_main_loop(void *arg)
 					PMD_DRV_LOG_LINE(ERR, "batch:%d result:%d",
 							 batch, batch_info.result[batch]);
 				} else {
-					count = (struct ulp_sc_tfc_stats_cache_entry *)
-						((uintptr_t)batch_info.em_hdl[batch]);
-					memcpy(&count->packet_count, data, ULP_TFC_ACT_WORD_SZ);
+					uint64_t *cptr = (uint64_t *)data;
+				   uintptr_t em_hdl = batch_info.em_hdl[batch];
+
+					count = (struct ulp_sc_tfc_stats_cache_entry *)em_hdl;
+					if (*cptr != count->packet_count) {
+						count->packet_count = *cptr;
+						cptr++;
+						count->byte_count = *cptr;
+					}
 				}
 
 				data += ULP_SC_PAGE_SIZE;
@@ -440,6 +445,8 @@ int ulp_sc_mgr_query_count_get(struct bnxt_ulp_context *ctxt,
 	uint32_t f2_cnt;
 	uint64_t *t;
 	uint64_t bs;
+	uint64_t packet_count;
+	uint64_t byte_count;
 	int rc = 0;
 
 	/* Get stats cache info */
@@ -450,8 +457,22 @@ int ulp_sc_mgr_query_count_get(struct bnxt_ulp_context *ctxt,
 	sce = ulp_sc_info->stats_cache_tbl;
 	sce += flow_id;
 
+	/* Save the counts to local variables since they could be modified
+	 * in the stats cache loop.
+	 */
+	packet_count = sce->packet_count;
+	byte_count = sce->byte_count;
+
 	/* To handle the parent flow */
 	if (sce->flags & ULP_SC_ENTRY_FLAG_PARENT) {
+		struct ulp_sc_tfc_stats_cache_entry *f1_sce = sce;
+
+		if (!(f1_sce->flags & ULP_SC_ENTRY_FLAG_VALID))
+			return -EBUSY;
+
+		packet_count = 0;
+		byte_count = 0;
+
 		flow_db = bnxt_ulp_cntxt_ptr2_flow_db_get(ctxt);
 		if (!flow_db) {
 			BNXT_DRV_DBG(ERR, "parent child db validation failed\n");
@@ -490,26 +511,36 @@ int ulp_sc_mgr_query_count_get(struct bnxt_ulp_context *ctxt,
 				/* no counter action, then ignore flows */
 				if (!(sce->flags & ULP_SC_ENTRY_FLAG_VALID))
 					continue;
-				count->hits += sce->packet_count;
-				count->hits_set = 1;
-				count->bytes += sce->byte_count;
-				count->bytes_set = 1;
+
+				packet_count += sce->packet_count;
+				byte_count += sce->byte_count;
 			} while (bs && f2_cnt);
 		}
+
+		sce = f1_sce;
 	} else {
 		/* To handle regular or child flows */
 		/* If entry is not valid return an error */
 		if (!(sce->flags & ULP_SC_ENTRY_FLAG_VALID))
 			return -EBUSY;
+	}
 
-		count->hits = sce->packet_count;
-		count->hits_set = 1;
-		count->bytes = sce->byte_count;
-		count->bytes_set = 1;
-
-		if (count->reset)
-			sce->reset = true;
+	if (count->reset) {
+		/* Calculate packet count delta */
+		count->hits = (packet_count - sce->last_packet_count) & ULP_SC_MAX_COUNT;
+		count->bytes = (byte_count - sce->last_byte_count) & ULP_SC_MAX_COUNT;
+	} else {
+		count->hits = packet_count;
+		count->bytes = byte_count;
 	}
+
+	/* Save the raw packet count */
+	sce->last_packet_count = packet_count;
+	sce->last_byte_count = byte_count;
+
+	count->bytes_set = 1;
+	count->hits_set = 1;
+
 	return rc;
 }
 
drivers/net/bnxt/tf_ulp/ulp_sc_mgr.h +2 -0
index 29d0b0a1a4..631e2f77b2 100644
@@ -30,6 +30,8 @@ struct ulp_sc_tfc_stats_cache_entry {
 	uint64_t byte_count;
 	uint64_t count_fields1;
 	uint64_t count_fields2;
+	uint64_t last_packet_count;
+	uint64_t last_byte_count;
 	bool reset;
 };
 
Signature · 1 line
2.39.5 (Apple Git-154)
#239 lore raw

PATCH v5 24/57 net/bnxt/tf_ulp: Cleanup devargs argument parsing code

In reply to Manish Kurup

From: Sangtani Parag Satishbhai <[email protected]>

For Thor2 if any of the ports are attached on testpmd without "mpc=1" argument, code flow will not initialize core mpc structure which can lead to seg fault in bnxt_mpc_send while accessing tx queues. Adding a NULL conditional check for the MPC member of the bp structure.

---
 drivers/net/bnxt/bnxt_mpc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_mpc.c +11 -1
index 2582b50782..ff2f0d7043 100644
@@ -719,10 +719,20 @@ int bnxt_mpc_send(struct bnxt *bp,
 		  bool batch)
 {
 	int rc;
-	struct bnxt_mpc_txq *mpc_queue = bp->mpc->mpc_txq[in_msg->chnl_id];
+	struct bnxt_mpc_txq *mpc_queue;
 	int retry = BNXT_MPC_RX_RETRY;
 	uint32_t pi = 0;
 
+	/*
+	 * TODO: This condition check is added to avoid
+	 * segmentation fault in case mpc argument is
+	 * missing in dev-args. Fix this by removing
+	 * mpc argument from dev args.
+	 */
+	if (!bp->mpc)
+		return -1;
+	mpc_queue = bp->mpc->mpc_txq[in_msg->chnl_id];
+
 	if (out_msg->cmp_type != CMPL_BASE_TYPE_MID_PATH_SHORT &&
 	    out_msg->cmp_type != CMPL_BASE_TYPE_MID_PATH_LONG)
 		return -1;
Signature · 1 line
2.39.5 (Apple Git-154)
#240 lore raw

PATCH v5 25/57 net/bnxt: cleanup default rss config

In reply to Manish Kurup

From: Sriharsha Basavapatna <[email protected]>

On Thor2, the set of supported RSS hash types reported in dev_info->flow_type_rss_offloads includes both IPV6 and IPV6_FLOW_LABEL. However, hardware support is mutually exclusive. That is, either hash type IPV6 or IPV6_FLOW_LABEL can be specified, but not both.

But, an application (such as testpmd) that sets the default hash types based on dev_info could end up specifying both bits in rss_conf->rss_hf field. This results in an error when both are set in HWRM_VNIC_RSS_CFG command.

testpmd> port config all rss default bnxt_hwrm_vnic_rss_cfg_p5(): error 2:0:00000000:0000 Configuration of RSS hash at ethernet port 0 failed with
error (22): Invalid argument.
bnxt_hwrm_vnic_rss_cfg_p5(): error 2:0:00000000:0000 Configuration of RSS hash at ethernet port 1 failed with
error (22): Invalid argument.

Mitigate this issue by specifying only hash type IPV6_FLOW_LABEL in the hwrm, when both are specified in the rte command. This works since the hw includes IPV6 src and dst fields also in its hash function when the type is IPV6_FLOW_LABEL.

---
 drivers/net/bnxt/bnxt_ethdev.c | 11 +++++++++++
 drivers/net/bnxt/bnxt_vnic.c   | 10 +++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +11 -0
index b2b8e20516..4bca2239c3 100644
@@ -2485,6 +2485,17 @@ static int bnxt_rss_hash_conf_get_op(struct rte_eth_dev *eth_dev,
 			memcpy(rss_conf->rss_key, vnic->rss_hash_key, len);
 		}
 		bnxt_hwrm_rss_to_rte_hash_conf(vnic, &rss_conf->rss_hf);
+		/* HASH_TYPE_IPV6_FLOW_LABEL and HASH_TYPE_IPV6 are mutually
+		 * exclusive in hardware. See related comments in
+		 * bnxt_rte_to_hwrm_hash_types(). If the cached user config
+		 * has both bits enabled, make sure both are reported in
+		 * conf_get_op().
+		 */
+		if (bp->rss_conf.rss_hf &&
+		    (bp->rss_conf.rss_hf &
+		    (RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_IPV6_FLOW_LABEL)) &&
+		    (rss_conf->rss_hf & RTE_ETH_RSS_IPV6_FLOW_LABEL))
+			rss_conf->rss_hf |= RTE_ETH_RSS_IPV6;
 		rss_conf->rss_hf |=
 			bnxt_hwrm_to_rte_rss_level(bp, vnic->hash_mode);
 	} else {
drivers/net/bnxt/bnxt_vnic.c +9 -1
index 637e9b9aa4..f0ec87198f 100644
@@ -285,8 +285,16 @@ 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)
+	if (rte_type & RTE_ETH_RSS_IPV6_FLOW_LABEL) {
+		/* HASH_TYPE_IPV6_FLOW_LABEL and HASH_TYPE_IPV6 are mutually
+		 * exclusive. If both bits are specified in rte_type, set only
+		 * HASH_TYPE_IPV6_FLOW_LABEL in hardware since it subsumes
+		 * HASH_TYPE_IPV6 (see comments for HASH_TYPE_IPV6_FLOW_LABEL
+		 * in hsi.h).
+		 */
 		hwrm_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6_FLOW_LABEL;
+		hwrm_type &= ~HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV6;
+	}
 	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;
Signature · 1 line
2.39.5 (Apple Git-154)
#241 lore raw

PATCH v5 26/57 net/bnxt/tf_ulp: enable support for global index table

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

The multi instance applications use metadata profile tables to set the metadata mask and this mask needs to be shared by multiple applications. The code is extended to support global id for these metadata profiles that these can be shared across applications. Since there are limited number of these resources, to scale the number of applications this resource needs to be shared as global ids.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c     | 111 +++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_mapper.h     |  11 +++
 drivers/net/bnxt/tf_ulp/ulp_mapper_tf.c  |   2 +
 drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c |  77 ++++++++++++++++
 4 files changed, 201 insertions(+)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +111 -0
index 1901845499..9cda3b355b 100644
@@ -3129,6 +3129,110 @@ ulp_mapper_global_identifier_process(struct bnxt_ulp_mapper_parms *parms,
 	return rc;
 }
 
+static int32_t
+ulp_mapper_global_idx_tbl_process(struct bnxt_ulp_mapper_parms *parms,
+				  struct bnxt_ulp_mapper_tbl_info *tbl)
+{
+	const struct ulp_mapper_core_ops *op = parms->mapper_data->mapper_oper;
+	struct bnxt_ulp_glb_resource_info glb_res = { 0 };
+	struct ulp_flow_db_res_params fid_parms = { 0 };
+	struct bnxt_ulp_mapper_key_info	*kflds;
+	struct ulp_blob key;
+	uint32_t num_kflds = 0;
+	uint16_t tmplen = 0;
+	uint64_t idx = 0;
+	uint8_t *context;
+	int32_t rc = 0;
+	uint32_t i;
+
+	/* check the table opcode  */
+	if (tbl->tbl_opcode != BNXT_ULP_GLOBAL_IDX_TBL_OPC_ALLOC) {
+		BNXT_DRV_DBG(ERR, "Invalid global idx table opcode %d",
+			     tbl->tbl_opcode);
+		return -EINVAL;
+	}
+
+	/* Create the key blob */
+	if (unlikely(ulp_blob_init(&key, tbl->blob_key_bit_size,
+				   BNXT_ULP_BYTE_ORDER_BE))) {
+		BNXT_DRV_DBG(ERR, "blob init failed.");
+		return -EINVAL;
+	}
+
+	kflds = ulp_mapper_key_fields_get(parms, tbl, &num_kflds);
+	for (i = 0; i < num_kflds; i++) {
+		rc = ulp_mapper_field_opc_process(parms, tbl->direction,
+						  &kflds[i].field_info_spec,
+						  &key, 1,
+						  "Global Idx Context");
+		if (unlikely(rc)) {
+			BNXT_DRV_DBG(ERR, "Key field set failed %s",
+				     kflds[i].field_info_spec.description);
+			return rc;
+		}
+	}
+
+	context = ulp_blob_data_get(&key, &tmplen);
+	tmplen = ULP_BITS_2_BYTE(tmplen);
+
+	if (unlikely(!op->ulp_mapper_core_glb_idx_tbl_alloc)) {
+		BNXT_DRV_DBG(ERR, "global idx tbl process not supported");
+		return -EINVAL;
+	}
+
+	rc = op->ulp_mapper_core_glb_idx_tbl_alloc(parms->ulp_ctx,
+						   tbl->resource_type,
+						   tbl->direction, context,
+						   tmplen, &idx);
+	if (unlikely(rc)) {
+		BNXT_DRV_DBG(ERR, "global idx tbl process failed");
+		return rc;
+	}
+
+	/* Add the table index to the flow db */
+	memset(&fid_parms, 0, sizeof(fid_parms));
+	fid_parms.direction = tbl->direction;
+	fid_parms.resource_func = tbl->resource_func;
+	fid_parms.resource_type	= tbl->resource_type;
+	fid_parms.critical_resource = tbl->critical_resource;
+	fid_parms.resource_hndl = idx;
+
+	rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
+	if (unlikely(rc)) {
+		BNXT_DRV_DBG(ERR, "Fail to link res to flow rc = %d", rc);
+		goto error;
+	}
+
+	rc = bnxt_ulp_cntxt_dev_id_get(parms->ulp_ctx, &glb_res.device_id);
+	if (unlikely(rc)) {
+		BNXT_DRV_DBG(ERR, "Failed to get device id (%d)", rc);
+		goto error;
+	}
+
+	rc = bnxt_ulp_cntxt_app_id_get(parms->ulp_ctx, &glb_res.app_id);
+	if (unlikely(rc)) {
+		BNXT_DRV_DBG(ERR, "Failed to get app id (%d)", rc);
+		goto error;
+	}
+
+	glb_res.direction = tbl->direction;
+	glb_res.resource_func = tbl->resource_func;
+	glb_res.resource_type = tbl->resource_type;
+	glb_res.glb_regfile_index = tbl->tbl_operand;
+	/* Write the table index into the regfile*/
+	if (ulp_mapper_glb_resource_write(parms->mapper_data, &glb_res,
+					  tfp_cpu_to_be_64(idx), false)) {
+		BNXT_DRV_DBG(ERR, "Glb Regfile[%d] write failed.",
+			     tbl->tbl_operand);
+		rc = -EINVAL;
+		goto error;
+	}
+	return rc;
+error:
+	(void)op->ulp_mapper_core_glb_idx_tbl_free(parms->ulp_ctx, &fid_parms);
+	return rc;
+}
+
 /* Free the vnic resource */
 static int32_t
 ulp_mapper_vnic_tbl_res_free(struct bnxt_ulp_context *ulp __rte_unused,
@@ -4357,6 +4461,9 @@ ulp_mapper_tbls_process(struct bnxt_ulp_mapper_parms *parms, void *error)
 		case BNXT_ULP_RESOURCE_FUNC_GLOBAL_IDENTIFIER:
 			rc = ulp_mapper_global_identifier_process(parms, tbl);
 			break;
+		case BNXT_ULP_RESOURCE_FUNC_GLOBAL_IDX_TBL:
+			rc = ulp_mapper_global_idx_tbl_process(parms, tbl);
+			break;
 		default:
 			BNXT_DRV_DBG(ERR, "Unexpected mapper resource %d\n",
 				     tbl->resource_func);
@@ -4501,6 +4608,10 @@ ulp_mapper_resource_free(struct bnxt_ulp_context *ulp,
 		break;
 	case BNXT_ULP_RESOURCE_FUNC_GLOBAL_IDENTIFIER:
 		rc = mapper_op->ulp_mapper_core_global_ident_free(ulp, res);
+		break;
+	case BNXT_ULP_RESOURCE_FUNC_GLOBAL_IDX_TBL:
+		rc = mapper_op->ulp_mapper_core_glb_idx_tbl_free(ulp, res);
+		break;
 	default:
 		break;
 	}
drivers/net/bnxt/tf_ulp/ulp_mapper.h +11 -0
index a4a42ab84d..732f095f01 100644
@@ -166,6 +166,17 @@ struct ulp_mapper_core_ops {
 	(*ulp_mapper_core_global_ident_free)(struct bnxt_ulp_context *ulp_ctx,
 					     struct ulp_flow_db_res_params *r);
 
+	int32_t
+	(*ulp_mapper_core_glb_idx_tbl_alloc)(struct bnxt_ulp_context *ctx,
+					     uint16_t sub_type,
+					     uint8_t direction,
+					     uint8_t *context_id,
+					     uint16_t context_len,
+					     uint64_t *idx_id);
+
+	int32_t
+	(*ulp_mapper_core_glb_idx_tbl_free)(struct bnxt_ulp_context *ulp_ctx,
+					    struct ulp_flow_db_res_params *r);
 	uint32_t
 	(*ulp_mapper_core_dyn_tbl_type_get)(struct bnxt_ulp_mapper_parms *parms,
 					    struct bnxt_ulp_mapper_tbl_info *t,
drivers/net/bnxt/tf_ulp/ulp_mapper_tf.c +2 -0
index 72d0f96573..3960be4e48 100644
@@ -1380,6 +1380,8 @@ const struct ulp_mapper_core_ops ulp_mapper_tf_core_ops = {
 	.ulp_mapper_core_ident_free = ulp_mapper_tf_ident_free,
 	.ulp_mapper_core_global_ident_alloc = NULL,
 	.ulp_mapper_core_global_ident_free = NULL,
+	.ulp_mapper_core_glb_idx_tbl_alloc = NULL,
+	.ulp_mapper_core_glb_idx_tbl_free = NULL,
 	.ulp_mapper_core_dyn_tbl_type_get = ulp_mapper_tf_dyn_tbl_type_get,
 	.ulp_mapper_core_index_tbl_alloc_process =
 		ulp_mapper_tf_index_tbl_alloc_process,
drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c +77 -0

89 lines not on this page · raw message

Signature · 1 line
2.39.5 (Apple Git-154)
#242 lore raw

PATCH v5 27/57 net/bnxt/tf_core: Cleanup flow scale option build flags

In reply to Manish Kurup

From: Shuanglin Wang <[email protected]>

Resolved the build failure when building dpdk with the extra c flag:
-DTF_FLOW_SCALE_QUERY. The issue is caused by the new debug code in DPDK 24.11.

---
 drivers/net/bnxt/tf_core/tf_resources.c     |  2 +-
 drivers/net/bnxt/tf_core/v3/tfc_resources.c | 12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)
drivers/net/bnxt/tf_core/tf_resources.c +1 -1
index b3174ba1af..3219d61cab 100644
@@ -535,7 +535,7 @@ void tf_resc_usage_update_all(struct bnxt *bp)
 
 	tfp = bnxt_ulp_bp_tfp_get(bp, BNXT_ULP_SESSION_TYPE_DEFAULT);
 	if (!tfp || !tfp->session) {
-		BNXT_DRV_DBG(ERR, "Failed to get truflow or session pointer\n");
+		BNXT_DRV_DBG(ERR, "Failed to get truflow or session pointer");
 		return;
 	}
 
drivers/net/bnxt/tf_core/v3/tfc_resources.c +7 -5
index 5fa6d113ca..44b7a0afcb 100644
@@ -59,14 +59,16 @@ tfc_query_resc_usage(struct tfc *tfcp, enum cfa_dir dir)
 
 	rc = tfo_sid_get(tfcp->tfo, &sid);
 	if (rc) {
-		PMD_DRV_LOG_LINE(ERR, "Failed to retrieve SID, rc:%s\n",
-				 strerror(-rc));
+		PMD_DRV_LOG_LINE(ERR, "%s: Failed to retrieve SID, rc:%s",
+				 __func__, strerror(-rc));
 		return rc;
 	}
 	tfc_msg_resc_usage_query(tfcp, sid, dir, &data_size, &stats_info);
 	PMD_DRV_LOG_LINE(ERR,
-			 "dir:%s, %d - %d %d(1-slice) - %d %d(2-slices) - %d(4-slices) - %d(unused row) - %d(used_slices)\n",
-			 dir ? "TX" : "RX", stats_info.max_slices,
+			 "%s: dir:%s, %d - %d %d(1-slice) - %d %d(2-slices) - %d(4-slices) - %d(unused row) - %d(used_slices)",
+			 __func__,
+			 dir ? "TX" : "RX",
+			 stats_info.max_slices,
 			 stats_info.row_1_slice_p_used,
 			 stats_info.row_1_slice_f_used,
 			 stats_info.row_2_slice_p_used,
@@ -86,7 +88,7 @@ void tfc_resc_usage_query_all(struct bnxt *bp)
 
 	tfcp = bnxt_ulp_cntxt_tfcp_get(bp->ulp_ctx);
 	if (!tfcp) {
-		BNXT_DRV_DBG(ERR, "Failed to get truflow pointer\n");
+		BNXT_DRV_DBG(ERR, "Failed to get truflow pointer");
 		return;
 	}
 
Signature · 1 line
2.39.5 (Apple Git-154)
#243 lore raw

PATCH v5 28/57 net/bnxt: truflow remove redundant code for mpc init

In reply to Manish Kurup

From: Sangtani Parag Satishbhai <[email protected]>

This patch removes redundant code from two files which is used during mpc init. The NULL condition check for mpc member in bnxt_mpc.c file is not required as mpc will always be initialized for P7 platform. The extra condition added in bnxt_ethdev.c to enable mpc for tf apps is not required as it will be always be enabled for P7 platform.

---
 drivers/net/bnxt/bnxt_mpc.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/net/bnxt/bnxt_mpc.c +1 -11
index ff2f0d7043..2582b50782 100644
@@ -719,20 +719,10 @@ int bnxt_mpc_send(struct bnxt *bp,
 		  bool batch)
 {
 	int rc;
-	struct bnxt_mpc_txq *mpc_queue;
+	struct bnxt_mpc_txq *mpc_queue = bp->mpc->mpc_txq[in_msg->chnl_id];
 	int retry = BNXT_MPC_RX_RETRY;
 	uint32_t pi = 0;
 
-	/*
-	 * TODO: This condition check is added to avoid
-	 * segmentation fault in case mpc argument is
-	 * missing in dev-args. Fix this by removing
-	 * mpc argument from dev args.
-	 */
-	if (!bp->mpc)
-		return -1;
-	mpc_queue = bp->mpc->mpc_txq[in_msg->chnl_id];
-
 	if (out_msg->cmp_type != CMPL_BASE_TYPE_MID_PATH_SHORT &&
 	    out_msg->cmp_type != CMPL_BASE_TYPE_MID_PATH_LONG)
 		return -1;
Signature · 1 line
2.39.5 (Apple Git-154)
#244 lore raw

PATCH v5 29/57 net/bnxt/tf_ulp: optimize template enums

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

The template enums are broken into two files, the enum file contains the enumeration that is common for applications and define file that contains application specific enumerations.

---
 .../ulp_template_db_enum.h                    | 82 +------------------
 1 file changed, 3 insertions(+), 79 deletions(-)
 rename drivers/net/bnxt/tf_ulp/{generic_templates => }/ulp_template_db_enum.h (96%)
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h renamed from drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_enum.h +3 -79
similarity index 96%
rename from drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_enum.h
rename to drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h
index 87e24c37c2..4e7cb570b0 100644
@@ -3,74 +3,10 @@
  * All rights reserved.
  */
 
-#ifndef ULP_TEMPLATE_DB_H_
-#define ULP_TEMPLATE_DB_H_
+#ifndef ULP_TEMPLATE_DB_ENUM_H_
+#define ULP_TEMPLATE_DB_ENUM_H_
 
-#define BNXT_ULP_REGFILE_MAX_SZ 107
-#define BNXT_ULP_MAX_NUM_DEVICES 5
-#define BNXT_ULP_LOG2_MAX_NUM_DEV 2.32192809488736
-#define BNXT_ULP_GEN_TBL_MAX_SZ 62
-#define BNXT_ULP_ALLOCATOR_TBL_MAX_SZ 2
-#define BNXT_ULP_CLASS_MATCH_LIST_MAX_SZ 163
-#define BNXT_ULP_ACT_MATCH_LIST_MAX_SZ 21
-#define BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ 0
-#define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 57
-#define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 0
-#define BNXT_ULP_RESOURCE_RESV_LIST_MAX_SZ 73
-#define BNXT_ULP_APP_CAP_TBL_MAX_SZ 3
-#define BNXT_ULP_COND_GOTO_REJECT 1023
-#define BNXT_ULP_COND_GOTO_RF 0x10000
-#define BNXT_ULP_APP_ID_CONFIG 0
-#define BNXT_ULP_GLB_FIELD_TBL_SIZE 129
-#define BNXT_ULP_GLB_SIG_TBL_SIZE 1
-#define ULP_WH_PLUS_CLASS_TMPL_LIST_SIZE 8
-#define ULP_WH_PLUS_CLASS_TBL_LIST_SIZE 98
-#define ULP_WH_PLUS_CLASS_KEY_INFO_LIST_SIZE 683
-#define ULP_WH_PLUS_CLASS_KEY_EXT_LIST_SIZE 0
-#define ULP_WH_PLUS_CLASS_IDENT_LIST_SIZE 29
-#define ULP_WH_PLUS_CLASS_RESULT_FIELD_LIST_SIZE 657
-#define ULP_WH_PLUS_CLASS_COND_LIST_SIZE 50
-#define ULP_WH_PLUS_CLASS_COND_OPER_LIST_SIZE 0
-#define ULP_THOR_CLASS_TMPL_LIST_SIZE 8
-#define ULP_THOR_CLASS_TBL_LIST_SIZE 214
-#define ULP_THOR_CLASS_KEY_INFO_LIST_SIZE 940
-#define ULP_THOR_CLASS_KEY_EXT_LIST_SIZE 778
-#define ULP_THOR_CLASS_IDENT_LIST_SIZE 67
-#define ULP_THOR_CLASS_RESULT_FIELD_LIST_SIZE 1322
-#define ULP_THOR_CLASS_COND_LIST_SIZE 4909
-#define ULP_THOR_CLASS_COND_OPER_LIST_SIZE 15
-#define ULP_THOR2_CLASS_TMPL_LIST_SIZE 8
-#define ULP_THOR2_CLASS_TBL_LIST_SIZE 182
-#define ULP_THOR2_CLASS_KEY_INFO_LIST_SIZE 737
-#define ULP_THOR2_CLASS_KEY_EXT_LIST_SIZE 668
-#define ULP_THOR2_CLASS_IDENT_LIST_SIZE 61
-#define ULP_THOR2_CLASS_RESULT_FIELD_LIST_SIZE 1603
-#define ULP_THOR2_CLASS_COND_LIST_SIZE 4214
-#define ULP_THOR2_CLASS_COND_OPER_LIST_SIZE 14
-#define ULP_WH_PLUS_ACT_TMPL_LIST_SIZE 13
-#define ULP_WH_PLUS_ACT_TBL_LIST_SIZE 155
-#define ULP_WH_PLUS_ACT_KEY_INFO_LIST_SIZE 49
-#define ULP_WH_PLUS_ACT_KEY_EXT_LIST_SIZE 0
-#define ULP_WH_PLUS_ACT_IDENT_LIST_SIZE 20
-#define ULP_WH_PLUS_ACT_RESULT_FIELD_LIST_SIZE 995
-#define ULP_WH_PLUS_ACT_COND_LIST_SIZE 134
-#define ULP_WH_PLUS_ACT_COND_OPER_LIST_SIZE 6
-#define ULP_THOR_ACT_TMPL_LIST_SIZE 13
-#define ULP_THOR_ACT_TBL_LIST_SIZE 104
-#define ULP_THOR_ACT_KEY_INFO_LIST_SIZE 83
-#define ULP_THOR_ACT_KEY_EXT_LIST_SIZE 5
-#define ULP_THOR_ACT_IDENT_LIST_SIZE 19
-#define ULP_THOR_ACT_RESULT_FIELD_LIST_SIZE 416
-#define ULP_THOR_ACT_COND_LIST_SIZE 90
-#define ULP_THOR_ACT_COND_OPER_LIST_SIZE 0
-#define ULP_THOR2_ACT_TMPL_LIST_SIZE 13
-#define ULP_THOR2_ACT_TBL_LIST_SIZE 121
-#define ULP_THOR2_ACT_KEY_INFO_LIST_SIZE 86
-#define ULP_THOR2_ACT_KEY_EXT_LIST_SIZE 5
-#define ULP_THOR2_ACT_IDENT_LIST_SIZE 42
-#define ULP_THOR2_ACT_RESULT_FIELD_LIST_SIZE 452
-#define ULP_THOR2_ACT_COND_LIST_SIZE 96
-#define ULP_THOR2_ACT_COND_OPER_LIST_SIZE 0
+#include "ulp_template_db_defs.h"
 
 enum bnxt_ulp_act_bit {
 	BNXT_ULP_ACT_BIT_MARK                = 0x0000000000000001,
@@ -2181,16 +2117,4 @@ enum ulp_thor2_sym {
 	ULP_THOR2_SYM_T_ECPRI_CONTEXT_MASK = 0
 };
 
-enum bnxt_ulp_df_tpl {
-	BNXT_ULP_DF_TPL_DEFAULT_UPLINK_PORT = 3,
-	BNXT_ULP_DF_TPL_DEFAULT_VFR = 4
-};
-
-enum bnxt_ulp_template_id {
-	BNXT_ULP_TEMPLATE_PROMISCUOUS_ENABLE = 5,
-	BNXT_ULP_TEMPLATE_PROMISCUOUS_DISABLE = 6,
-	BNXT_ULP_TEMPLATE_GROUP_MISS_ACTION = 7
-};
-
 #endif
-
Signature · 1 line
2.39.5 (Apple Git-154)
#245 lore raw

PATCH v5 30/57 net/bnxt/tf_core: thor2 hot upgrade ungraceful quit crash

In reply to Manish Kurup

From: Farah Smith <[email protected]>

Change table scope shutdown sequence in DPDK to remove the function from the scope prior to requesting the memory being freed. The firmware will delete the scope when the last fid is removed so there is no need to issue the table scope deconfig HWRM.

---
 drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c | 24 ++++++++-------------
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c      | 20 +++++++++++------
 2 files changed, 22 insertions(+), 22 deletions(-)
drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c +9 -15
index 60b8289805..ac805916cc 100644
@@ -1284,7 +1284,7 @@ int tfc_tbl_scope_mem_alloc(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
 						tsid,
 						dir,
 						CFA_REGION_TYPE_LKUP,
-						true,
+						parms->local,
 						&lkup_mem_cfg[dir]);
 			if (rc)
 				goto cleanup;
@@ -1293,7 +1293,7 @@ int tfc_tbl_scope_mem_alloc(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
 						tsid,
 						dir,
 						CFA_REGION_TYPE_ACT,
-						true,
+						parms->local,
 						&act_mem_cfg[dir]);
 			if (rc)
 				goto cleanup;
@@ -1388,9 +1388,13 @@ int tfc_tbl_scope_mem_free(struct tfc *tfcp, uint16_t fid, uint8_t tsid)
 			PMD_DRV_LOG_LINE(ERR, "tfc_vf2pf_mem_free failed");
 			/* continue cleanup regardless */
 		}
-		PMD_DRV_LOG_LINE(DEBUG, "tsid: %d, status %d", resp.tsid, resp.status);
-		if (shared)
+		PMD_DRV_LOG_LINE(DEBUG, "%s: tsid: %d, status %d",
+				 __func__, resp.tsid, resp.status);
+		if (shared) {
+			/* reset scope */
+			tfo_ts_set(tfcp->tfo, tsid, false, CFA_APP_TYPE_INVALID, false, 0);
 			return rc;
+		}
 	}
 
 	if (shared && is_pf) {
@@ -1495,11 +1499,9 @@ int tfc_tbl_scope_fid_add(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
 int tfc_tbl_scope_fid_rem(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
 			  uint16_t *fid_cnt)
 {
-	struct tfc_ts_mem_cfg mem_cfg;
 	struct tfc_cpm *cpm_lkup;
 	struct tfc_cpm *cpm_act;
 	int rc = 0;
-	bool local;
 
 	if (tfcp == NULL) {
 		PMD_DRV_LOG_LINE(ERR, "Invalid tfcp pointer");
@@ -1536,15 +1538,7 @@ int tfc_tbl_scope_fid_rem(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
 	if (rc == 0 && (cpm_lkup != NULL || cpm_act != NULL))
 		(void)tfc_tbl_scope_cpm_free(tfcp, tsid);
 
-	/*
-	 * Check if any table has memory configured and, if so, free it.
-	 */
-	(void)tfo_ts_get_mem_cfg(tfcp->tfo, tsid, CFA_DIR_RX,
-				 CFA_REGION_TYPE_LKUP, &local, &mem_cfg);
-
-	rc = tfo_ts_set(tfcp->tfo, tsid, false, CFA_APP_TYPE_INVALID,
-			false, 0);
-
+	/* tbl_scope_mem_free() will reset the remaining tsid state */
 	return rc;
 }
 
drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c +13 -7
index 167f2dcc1e..281c32dff8 100644
@@ -320,20 +320,21 @@ ulp_tfc_tbl_scope_deinit(struct bnxt *bp)
 	else
 		BNXT_DRV_DBG(DEBUG, "Freed CPM TSID:%d FID: %d\n", tsid, fid);
 
-	rc = tfc_tbl_scope_mem_free(tfcp, fid, tsid);
+
+	rc = tfc_tbl_scope_fid_rem(tfcp, fid, tsid, &fid_cnt);
 	if (rc)
-		BNXT_DRV_DBG(ERR, "Failed freeing tscope mem TSID:%d FID:%d\n",
+		BNXT_DRV_DBG(ERR, "Failed removing FID from TSID:%d FID:%d",
 			     tsid, fid);
 	else
-		BNXT_DRV_DBG(DEBUG, "Freed tscope mem TSID:%d FID:%d\n",
+		BNXT_DRV_DBG(DEBUG, "Removed FID from TSID:%d FID:%d",
 			     tsid, fid);
 
-	rc = tfc_tbl_scope_fid_rem(tfcp, fid, tsid, &fid_cnt);
+	rc = tfc_tbl_scope_mem_free(tfcp, fid, tsid);
 	if (rc)
-		BNXT_DRV_DBG(ERR, "Failed removing FID from TSID:%d FID:%d\n",
+		BNXT_DRV_DBG(ERR, "Failed freeing tscope mem TSID:%d FID:%d",
 			     tsid, fid);
 	else
-		BNXT_DRV_DBG(DEBUG, "Removed FID from TSID:%d FID:%d\n",
+		BNXT_DRV_DBG(DEBUG, "Freed tscope mem TSID:%d FID:%d",
 			     tsid, fid);
 }
 
@@ -456,7 +457,12 @@ ulp_tfc_tbl_scope_init(struct bnxt *bp)
 		qparms.act_pool_sz_exp[CFA_DIR_RX];
 	mem_parms.act_pool_sz_exp[CFA_DIR_TX] =
 		qparms.act_pool_sz_exp[CFA_DIR_TX];
-	mem_parms.local = true;
+
+	if (shared)
+		mem_parms.local = false;
+	else
+		mem_parms.local = true;
+
 	rc = tfc_tbl_scope_mem_alloc(tfcp, fid, tsid, &mem_parms);
 	if (rc) {
 		BNXT_DRV_DBG(ERR,
Signature · 1 line
2.39.5 (Apple Git-154)
#246 lore raw

PATCH v5 31/57 net/bnxt/tf_ulp: support MPLS packets

In reply to Manish Kurup

From: Shuanglin Wang <[email protected]>

Thor supports offloading MPLS packets and performing drop, forward, or queue actions for matchied packets.

---
 drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c |   4 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |  52 ++++
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |   5 +
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    | 239 +++++++++++++++++-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   3 +
 5 files changed, 289 insertions(+), 14 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c +2 -2
index 5b9caabe1d..6e1115b985 100644
@@ -297,8 +297,8 @@ struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {
 	.proto_hdr_func          = NULL
 	},
 	[RTE_FLOW_ITEM_TYPE_MPLS] = {
-	.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
-	.proto_hdr_func          = NULL
+	.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,
+	.proto_hdr_func          = ulp_rte_mpls_hdr_handler
 	},
 	[RTE_FLOW_ITEM_TYPE_GRE] = {
 	.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +52 -0

58 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +5 -0
index b20cb1ccde..5f451ba404 100644
@@ -164,6 +164,11 @@ int32_t
 ulp_rte_ecpri_hdr_handler(const struct rte_flow_item *item,
 			  struct ulp_rte_parser_params *params);
 
+/* Function to handle the parsing of RTE Flow item MPLS Header. */
+int32_t
+ulp_rte_mpls_hdr_handler(const struct rte_flow_item *item,
+			 struct ulp_rte_parser_params *params);
+
 /* Function to handle the parsing of RTE Flow item void Header. */
 int32_t
 ulp_rte_void_hdr_handler(const struct rte_flow_item *item,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +227 -12

387 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +3 -0
index fbce97269b..5b3e82f336 100644
@@ -34,6 +34,9 @@
 #define BNXT_ULP_PROTO_HDR_GRE_NUM	2
 #define BNXT_ULP_PROTO_HDR_ICMP_NUM	5
 #define BNXT_ULP_PROTO_HDR_ECPRI_NUM	2
+#define	BNXT_ULP_PROTO_HDR_IPV6_EXT_NUM	1
+#define BNXT_ULP_PROTO_HDR_SRV6_NUM	7
+#define BNXT_ULP_PROTO_HDR_MPLS_NUM	2
 #define BNXT_ULP_PROTO_HDR_MAX		128
 #define BNXT_ULP_PROTO_HDR_ENCAP_MAX	64
 #define BNXT_ULP_PROTO_HDR_FIELD_SVIF_IDX	1
Signature · 1 line
2.39.5 (Apple Git-154)
#247 lore raw

PATCH v5 32/57 net/bnxt/tf_core: add backing store debug to dpdk

In reply to Manish Kurup

From: Peter Spreadborough <[email protected]>

This change updates the existing backing store debug by adding more decode to EM entries and adding wildcard entry debug. A new cli command has also been added to exercise the function that loops through all ports and table scopes so that a single call can dump and decode all backing stores.

---
 drivers/net/bnxt/tf_core/v3/meson.build      |    3 +-
 drivers/net/bnxt/tf_core/v3/tfc_debug.h      |   12 +-
 drivers/net/bnxt/tf_core/v3/tfc_em.h         |   98 +-
 drivers/net/bnxt/tf_core/v3/tfc_mpc_debug.c  | 1411 +++++++++++++
 drivers/net/bnxt/tf_core/v3/tfc_mpc_table.c  |  565 ------
 drivers/net/bnxt/tf_core/v3/tfc_tcam_debug.c | 1875 ++++++++++++++++++
 drivers/net/bnxt/tf_core/v3/tfo.c            |   32 +
 drivers/net/bnxt/tf_core/v3/tfo.h            |   14 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.h       |    5 +
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr_tfc.c     |    1 -
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c        |    4 +-
 drivers/net/bnxt/tf_ulp/ulp_sc_mgr.c         |    1 -
 drivers/net/bnxt/tf_ulp/ulp_sc_mgr_tfc.c     |    1 -
 13 files changed, 3437 insertions(+), 585 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/v3/tfc_mpc_debug.c
 delete mode 100644 drivers/net/bnxt/tf_core/v3/tfc_mpc_table.c
 create mode 100644 drivers/net/bnxt/tf_core/v3/tfc_tcam_debug.c
drivers/net/bnxt/tf_core/v3/meson.build +2 -1
index 159e7a2b17..8d62e14274 100644
@@ -21,7 +21,8 @@ sources += files(
         'tfc_idx_tbl.c',
         'tfc_if_tbl.c',
         'tfc_init.c',
-        'tfc_mpc_table.c',
+        'tfc_mpc_debug.c',
+        'tfc_tcam_debug.c',
         'tfc_msg.c',
         'tfc_priv.c',
         'tfc_resources.c',
drivers/net/bnxt/tf_core/v3/tfc_debug.h +9 -3
index 0a4a0b4846..86492f3a69 100644
@@ -7,6 +7,7 @@
 #define _TFC_DEBUG_H_
 
 /* #define EM_DEBUG */
+/* #define WC_DEBUG */
 /* #define ACT_DEBUG */
 
 int tfc_mpc_table_write_zero(struct tfc *tfcp,
@@ -16,13 +17,18 @@ int tfc_mpc_table_write_zero(struct tfc *tfcp,
 			     uint32_t offset,
 			     uint8_t words,
 			     uint8_t *data);
-
-int tfc_act_show(struct tfc *tfcp, uint8_t tsid, enum cfa_dir dir);
-int tfc_em_show(struct tfc *tfcp, uint8_t tsid, enum cfa_dir dir);
+const char *get_lrec_opcode_str(uint8_t opcode);
+void act_show(FILE *fd, struct act_info_t *act_info, uint32_t offset);
+int tfc_em_show(FILE *fd, struct tfc *tfcp, uint8_t tsid, enum cfa_dir dir);
+int tfc_wc_show(FILE *fd, struct tfc *tfcp, uint8_t tsid, enum cfa_dir dir);
 int tfc_mpc_table_invalidate(struct tfc *tfcp,
 			     uint8_t tsid,
 			     enum cfa_dir dir,
 			     uint32_t type,
 			     uint32_t offset,
 			     uint32_t words);
+void act_process(uint32_t act_rec_ptr,
+		 struct act_info_t *act_info,
+		 struct tfc_ts_mem_cfg *act_mem_cfg);
+void tfc_backing_store_dump(FILE *fd);
 #endif
drivers/net/bnxt/tf_core/v3/tfc_em.h +86 -12

127 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_mpc_debug.c new file +1411 -0

1,411 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_mpc_table.c deleted +0 -565

565 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_tcam_debug.c new file +1875 -0

860 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfo.c +32 -0
index 5ec2f7afa2..21146d1daa 100644

Lines of this file are not shown. View the raw message.

drivers/net/bnxt/tf_core/v3/tfo.h +14 -0
index f97d4cdd2d..e572db5991 100644

Lines of this file are not shown. View the raw message.

drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.h +5 -0
index f2426ce3c1..ab6608ac74 100644

Lines of this file are not shown. View the raw message.

drivers/net/bnxt/tf_ulp/ulp_fc_mgr_tfc.c +0 -1
index d1b374e603..8e61c71f97 100644

Lines of this file are not shown. View the raw message.

drivers/net/bnxt/tf_ulp/ulp_flow_db.c +3 -1
index 943c9b799c..46f5a96baf 100644

Lines of this file are not shown. View the raw message.

drivers/net/bnxt/tf_ulp/ulp_sc_mgr.c +0 -1
index 24012e30b1..191157ebe1 100644

Lines of this file are not shown. View the raw message.

drivers/net/bnxt/tf_ulp/ulp_sc_mgr_tfc.c +0 -1
index 23edf9f755..3b863115f0 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.39.5 (Apple Git-154)

Part of the diff is not shown here. View the raw message.

#248 lore raw

PATCH v5 33/57 net/bnxt/tf_core: truflow global table scope

In reply to Manish Kurup

From: Farah Smith <[email protected]>

1. Add support for a global table scope used for socket direct applications. Create database, select database based upon table scope supplied. Table scopes can now be one of 3 types: global, shared application and non-shared.
2. Fix issue when shutting down DPDK. Firmware deconfigures the table scope when the fid is removed so no need to issue deconfig, just free the memory.

---
 drivers/net/bnxt/bnxt_ethdev.c                |  53 ++---
 .../net/bnxt/hcapi/cfa_v3/include/cfa_types.h |  10 +
 drivers/net/bnxt/hsi_struct_def_dpdk.h        | 221 +++++++++++++++---
 drivers/net/bnxt/tf_core/v3/tfc.h             |  81 ++++---
 drivers/net/bnxt/tf_core/v3/tfc_act.c         |  32 +--
 drivers/net/bnxt/tf_core/v3/tfc_cpm.c         |  13 ++
 drivers/net/bnxt/tf_core/v3/tfc_em.c          |  16 +-
 drivers/net/bnxt/tf_core/v3/tfc_mpc_debug.c   |  16 +-
 drivers/net/bnxt/tf_core/v3/tfc_msg.c         |  63 +++--
 drivers/net/bnxt/tf_core/v3/tfc_msg.h         |   8 +-
 drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c   | 205 ++++++++--------
 drivers/net/bnxt/tf_core/v3/tfc_tcam_debug.c  |   2 +-
 drivers/net/bnxt/tf_core/v3/tfc_util.c        |  15 ++
 drivers/net/bnxt/tf_core/v3/tfc_util.h        |  11 +
 drivers/net/bnxt/tf_core/v3/tfc_vf2pf_msg.c   |   3 +-
 drivers/net/bnxt/tf_core/v3/tfc_vf2pf_msg.h   |   4 +-
 drivers/net/bnxt/tf_core/v3/tfo.c             | 214 ++++++++++++-----
 drivers/net/bnxt/tf_core/v3/tfo.h             |  39 ++--
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c        |  70 ++++--
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   3 +-
 20 files changed, 716 insertions(+), 363 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +15 -38
index 4bca2239c3..94bec74c1e 100644
@@ -6142,37 +6142,6 @@ bnxt_parse_devarg_app_id(__rte_unused const char *key,
 	return 0;
 }
 
-static int
-bnxt_parse_devarg_mpc(__rte_unused const char *key,
-		      const char *value, __rte_unused void *opaque_arg)
-{
-	char *end = NULL;
-
-	if (!value || !opaque_arg) {
-		PMD_DRV_LOG_LINE(ERR,
-				 "Invalid parameter passed to app-id "
-				 "devargs");
-		return -EINVAL;
-	}
-
-	mpc = strtoul(value, &end, 10);
-	if (end == NULL || *end != '\0' ||
-	    (mpc == ULONG_MAX && errno == ERANGE)) {
-		PMD_DRV_LOG_LINE(ERR, "Invalid parameter passed to mpc "
-				 "devargs");
-		return -EINVAL;
-	}
-
-	if (BNXT_DEVARG_MPC_INVALID(mpc)) {
-		PMD_DRV_LOG_LINE(ERR, "Invalid mpc(%d) devargs",
-				 (uint16_t)mpc);
-		return -EINVAL;
-	}
-
-	PMD_DRV_LOG_LINE(INFO, "MPC%d feature enabled", (uint16_t)mpc);
-	return 0;
-}
-
 static int
 bnxt_parse_devarg_ieee_1588(__rte_unused const char *key,
 			    const char *value, void *opaque_arg)
@@ -6209,6 +6178,14 @@ bnxt_parse_devarg_ieee_1588(__rte_unused const char *key,
 	return 0;
 }
 
+static int
+bnxt_parse_devarg_mpc(__rte_unused const char *key,
+		      __rte_unused const char *value, __rte_unused void *opaque_arg)
+{
+	PMD_DRV_LOG_LINE(INFO, "mpc=1 arg not required.");
+	return 0;
+}
+
 static int
 bnxt_parse_devarg_rep_is_pf(__rte_unused const char *key,
 			    const char *value, void *opaque_arg)
@@ -6522,6 +6499,13 @@ bnxt_parse_dev_args(struct bnxt *bp, struct rte_devargs *devargs)
 		goto err;
 
 err:
+	/*
+	 * Handler for "mpc" devarg.
+	 * Invoked as for ex: "-a 000:00:0d.0,mpc=1"
+	 */
+	rte_kvargs_process(kvlist, BNXT_DEVARG_MPC,
+			   bnxt_parse_devarg_mpc, bp);
+
 	/*
 	 * Handler for "app-id" devarg.
 	 * Invoked as for ex: "-a 000:00:0d.0,app-id=1"
@@ -6536,13 +6520,6 @@ bnxt_parse_dev_args(struct bnxt *bp, struct rte_devargs *devargs)
 	rte_kvargs_process(kvlist, BNXT_DEVARG_IEEE_1588,
 			   bnxt_parse_devarg_ieee_1588, bp);
 
-	/*
-	 * Handler for "mpc" devarg.
-	 * Invoked as for ex: "-a 000:00:0d.0,mpc=1"
-	 */
-	rte_kvargs_process(kvlist, BNXT_DEVARG_MPC,
-			   bnxt_parse_devarg_mpc, bp);
-
 	/*
 	 * Handler for "cqe-mode" devarg.
 	 * Invoked as for ex: "-a 000:00:0d.0,cqe-mode=1"
drivers/net/bnxt/hcapi/cfa_v3/include/cfa_types.h +10 -0
index 4339fc1053..b00b21385d 100644
@@ -92,6 +92,16 @@ enum cfa_app_type {
 	CFA_APP_TYPE_INVALID = CFA_APP_TYPE_MAX,
 };
 
+/**
+ * CFA table scope types
+ */
+enum cfa_scope_type {
+	CFA_SCOPE_TYPE_NON_SHARED = 0,
+	CFA_SCOPE_TYPE_SHARED_APP = 1,
+	CFA_SCOPE_TYPE_GLOBAL = 2,
+	CFA_SCOPE_TYPE_INVALID = 3
+};
+
 /**
  * CFA FID types
  */
drivers/net/bnxt/hsi_struct_def_dpdk.h +188 -33

374 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc.h +54 -27

131 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_act.c +18 -14
index 7b1f82b842..3c1c76359b 100644
@@ -45,12 +45,12 @@ int tfc_act_alloc(struct tfc *tfcp,
 	struct tfc_cmm *cmm;
 	uint32_t entry_offset;
 	struct cfa_mm_alloc_parms aparms;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	struct tfc_ts_pool_info pi;
 	bool valid;
 	uint16_t max_pools;
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, &max_pools);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, &max_pools);
 	if (unlikely(rc)) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s", strerror(-rc));
 		return -EINVAL;
@@ -67,7 +67,11 @@ int tfc_act_alloc(struct tfc *tfcp,
 		return -EINVAL;
 	}
 
-	tfo_ts_get_pool_info(tfcp->tfo, tsid, cmm_info->dir, &pi);
+	rc = tfo_ts_get_pool_info(tfcp->tfo, tsid, cmm_info->dir, &pi);
+	if (unlikely(rc)) {
+		PMD_DRV_LOG_LINE(ERR, "%s: failed to get pool info: %s",
+				 __func__, strerror(-rc));
+	}
 
 	/* Get CPM instances */
 	rc = tfo_ts_get_cpm_inst(tfcp->tfo, tsid, cmm_info->dir, &cpm_lkup, &cpm_act);
@@ -99,8 +103,9 @@ int tfc_act_alloc(struct tfc *tfcp,
 		/* There is only 1 pool for a non-shared table scope
 		 * and it is full.
 		 */
-		if (unlikely(!is_shared)) {
-			PMD_DRV_LOG_LINE(ERR, "no records remain");
+		if (unlikely(scope_type == CFA_SCOPE_TYPE_NON_SHARED)) {
+			PMD_DRV_LOG_LINE(ERR, "%s: no records remain",
+					 __func__);
 			return -ENOMEM;
 		}
 		rc = tfc_get_fid(tfcp, &fid);
@@ -157,7 +162,6 @@ int tfc_act_alloc(struct tfc *tfcp,
 			return -EINVAL;
 		}
 	}
-
 	aparms.num_contig_records = 1 << next_pow2(num_contig_rec);
 	rc = cfa_mm_alloc(cmm, &aparms);
 	if (unlikely(rc)) {
@@ -231,7 +235,7 @@ int tfc_act_set(struct tfc *tfcp,
 	struct cfa_bld_mpcinfo *mpc_info;
 	uint32_t record_size;
 	uint8_t tsid;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	bool valid;
 
 	tfo_mpcinfo_get(tfcp->tfo, &mpc_info);
@@ -247,7 +251,7 @@ int tfc_act_set(struct tfc *tfcp,
 					  &record_size,
 					  &entry_offset);
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, NULL);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, NULL);
 	if (unlikely(rc)) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s", strerror(-rc));
 		return -EINVAL;
@@ -382,7 +386,7 @@ static int tfc_act_get_only(struct tfc *tfcp,
 	struct bnxt_mpc_mbuf mpc_msg_out;
 	uint32_t record_size;
 	uint8_t tsid;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	struct cfa_bld_mpcinfo *mpc_info;
 	bool valid;
 
@@ -393,7 +397,7 @@ static int tfc_act_get_only(struct tfc *tfcp,
 					  &record_size,
 					  &entry_offset);
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, NULL);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, NULL);
 	if (unlikely(rc)) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s", strerror(-rc));
 		return -EINVAL;
@@ -561,7 +565,7 @@ static int tfc_act_get_clear(struct tfc *tfcp,
 	struct bnxt_mpc_mbuf mpc_msg_out;
 	uint32_t record_size;
 	uint8_t tsid;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	struct cfa_bld_mpcinfo *mpc_info;
 	bool valid;
 	uint16_t mask = 0;
@@ -573,7 +577,7 @@ static int tfc_act_get_clear(struct tfc *tfcp,
 					  &record_size,
 					  &entry_offset);
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, NULL);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, NULL);
 	if (unlikely(rc)) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s",
 				 strerror(-rc));
@@ -739,7 +743,7 @@ int tfc_act_free(struct tfc *tfcp,
 	uint32_t record_offset;
 	struct cfa_mm_free_parms fparms;
 	uint8_t tsid;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	bool valid;
 	bool is_bs_owner;
 	struct tfc_ts_mem_cfg mem_cfg;
@@ -750,7 +754,7 @@ int tfc_act_free(struct tfc *tfcp,
 					  &record_size,
 					  &record_offset);
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, NULL);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, NULL);
 	if (unlikely(rc)) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s", strerror(-rc));
 		return -EINVAL;
drivers/net/bnxt/tf_core/v3/tfc_cpm.c +13 -0
index 36a9189805..f58ec48db7 100644
@@ -293,6 +293,10 @@ int tfc_cpm_set_cmm_inst(struct tfc_cpm *cpm, uint16_t pool_id, struct tfc_cmm *
 		return -EINVAL;
 	}
 
+	if (pool_id >= cpm->max_pools) {
+		PMD_DRV_LOG_LINE(ERR, "Pool ID:0x%x > max 0x%x", pool_id, cpm->max_pools);
+		return -EINVAL;
+	}
 	pool = &cpm->pools[pool_id];
 
 	if (pool->valid && cmm != NULL) {
@@ -324,6 +328,11 @@ int tfc_cpm_get_cmm_inst(struct tfc_cpm *cpm, uint16_t pool_id, struct tfc_cmm *
 		return -EINVAL;
 	}
 
+	if (pool_id >= cpm->max_pools) {
+		PMD_DRV_LOG_LINE(ERR, "Pool ID:0x%x > max 0x%x", pool_id, cpm->max_pools);
+		return -EINVAL;
+	}
+
 	pool = &cpm->pools[pool_id];
 
 	if (!pool->valid) {
@@ -359,6 +368,10 @@ int tfc_cpm_set_usage(struct tfc_cpm *cpm, uint16_t pool_id, uint32_t used_count
 		return -EINVAL;
 	}
 
+	if (pool_id >= cpm->max_pools) {
+		PMD_DRV_LOG_LINE(ERR, "Pool ID:0x%x > max 0x%x", pool_id, cpm->max_pools);
+		return -EINVAL;
+	}
 	pool = &cpm->pools[pool_id];
 
 	if (!pool->valid) {
drivers/net/bnxt/tf_core/v3/tfc_em.c +8 -8
index 8264f9a05d..828b7838f5 100644
@@ -133,19 +133,18 @@ int tfc_em_insert(struct tfc *tfcp, uint8_t tsid,
 	uint32_t i;
 	uint32_t hash = 0;
 	struct cfa_mpc_data_obj fields_cmd[CFA_BLD_MPC_EM_INSERT_CMD_MAX_FLD];
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	struct cfa_bld_mpcinfo *mpc_info;
 	bool valid;
 	uint16_t max_pools;
 #if TFC_EM_DYNAMIC_BUCKET_EN
 	struct cfa_mm_alloc_parms bucket_aparms;
-	bool shared = false;
 	uint32_t bucket_offset;
 #endif
 
 	tfo_mpcinfo_get(tfcp->tfo, &mpc_info);
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, &max_pools);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, &max_pools);
 	if (unlikely(rc)) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s", strerror(-rc));
 		return -EINVAL;
@@ -202,8 +201,9 @@ int tfc_em_insert(struct tfc *tfcp, uint8_t tsid,
 		/* There is only 1 pool for a non-shared table scope and
 		 * it is full.
 		 */
-		if (!is_shared) {
-			PMD_DRV_LOG_LINE(ERR, "no records remain");
+		if (scope_type == CFA_SCOPE_TYPE_NON_SHARED) {
+			PMD_DRV_LOG_LINE(ERR, "%s: no records remain",
+					 __func__);
 			return -ENOMEM;
 		}
 
@@ -278,7 +278,7 @@ int tfc_em_insert(struct tfc *tfcp, uint8_t tsid,
 	}
 
 #if TFC_EM_DYNAMIC_BUCKET_EN
-	if (!shared) {
+	if (scope_type == CFA_SCOPE_TYPE_NON_SHARED) {
 		/* Allocate dynamic bucket */
 		bucket_aparms.num_contig_records = TFC_EM_DYNAMIC_BUCKET_RECORD_SIZE;
 		rc = cfa_mm_alloc(cmm, &bucket_aparms);
@@ -598,7 +598,7 @@ int tfc_em_delete(struct tfc *tfcp, struct tfc_em_delete_parms *parms)
 	uint32_t record_size;
 	struct cfa_mm_free_parms fparms;
 	uint8_t tsid;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	struct tfc_ts_pool_info pi;
 	bool is_bs_owner;
 	struct tfc_ts_mem_cfg mem_cfg;
@@ -615,7 +615,7 @@ int tfc_em_delete(struct tfc *tfcp, struct tfc_em_delete_parms *parms)
 					&record_offset,
 					&static_bucket);
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, NULL);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, NULL);
 	if (rc != 0) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s",
 				 strerror(-rc));
drivers/net/bnxt/tf_core/v3/tfc_mpc_debug.c +8 -8
index 5690f072e2..9731127da0 100644
@@ -43,7 +43,7 @@ int tfc_mpc_table_read(struct tfc *tfcp,
 	struct cfa_mpc_data_obj fields_cmp[CFA_BLD_MPC_READ_CMP_MAX_FLD];
 	struct bnxt_mpc_mbuf mpc_msg_in;
 	struct bnxt_mpc_mbuf mpc_msg_out;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	struct cfa_bld_mpcinfo *mpc_info;
 	uint64_t host_address;
 	uint8_t discard_data[128];
@@ -53,7 +53,7 @@ int tfc_mpc_table_read(struct tfc *tfcp,
 
 	tfo_mpcinfo_get(tfcp->tfo, &mpc_info);
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, NULL);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, NULL);
 	if (rc != 0) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s", strerror(-rc));
 		return -EINVAL;
@@ -212,12 +212,12 @@ int tfc_mpc_table_write_zero(struct tfc *tfcp,
 	struct bnxt_mpc_mbuf mpc_msg_in;
 	struct bnxt_mpc_mbuf mpc_msg_out;
 	struct cfa_bld_mpcinfo *mpc_info;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	bool valid;
 
 	tfo_mpcinfo_get(tfcp->tfo, &mpc_info);
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, NULL);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, NULL);
 	if (rc != 0) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s", strerror(-rc));
 		return -EINVAL;
@@ -340,12 +340,12 @@ int tfc_mpc_table_invalidate(struct tfc *tfcp,
 	struct bnxt_mpc_mbuf mpc_msg_in;
 	struct bnxt_mpc_mbuf mpc_msg_out;
 	struct cfa_bld_mpcinfo *mpc_info;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	bool valid;
 
 	tfo_mpcinfo_get(tfcp->tfo, &mpc_info);
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, NULL);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, NULL);
 	if (rc != 0) {
 		PMD_DRV_LOG_LINE(ERR, "failed to get tsid: %s", strerror(-rc));
 		return -EINVAL;
@@ -1288,7 +1288,7 @@ static void bucket_show(FILE *fd, struct bucket_info_t *bucket_info, uint32_t of
 int tfc_em_show(FILE *fd, struct tfc *tfcp, uint8_t tsid, enum cfa_dir dir)
 {
 	int rc = 0;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	bool is_bs_owner;
 	struct tfc_ts_mem_cfg *lkup_mem_cfg;
 	struct tfc_ts_mem_cfg *act_mem_cfg;
@@ -1299,7 +1299,7 @@ int tfc_em_show(FILE *fd, struct tfc *tfcp, uint8_t tsid, enum cfa_dir dir)
 	uint32_t bucket_offset = 0;
 	bool valid;
 
-	rc = tfo_ts_get(tfcp->tfo, tsid, &is_shared, NULL, &valid, NULL);
+	rc = tfo_ts_get(tfcp->tfo, tsid, &scope_type, NULL, &valid, NULL);
 	if (rc != 0) {
 		fprintf(fd, "%s: failed to get tsid: %d\n",
 			   __func__, rc);
drivers/net/bnxt/tf_core/v3/tfc_msg.c +38 -25

101 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_msg.h +4 -4
index 3bf6b04a12..6f07890cd6 100644
@@ -16,11 +16,14 @@
 int
 tfc_msg_tbl_scope_qcaps(struct tfc *tfcp,
 			bool *tbl_scope_capable,
+			bool *global_scope_capable,
+			bool *locked_scope_capable,
 			uint32_t *max_lkup_rec_cnt,
 			uint32_t *max_act_rec_cnt,
 			uint8_t	*max_lkup_static_buckets_exp);
 
-int tfc_msg_tbl_scope_id_alloc(struct tfc *tfcp, uint16_t fid, bool shared,
+int tfc_msg_tbl_scope_id_alloc(struct tfc *tfcp, uint16_t fid,
+			       enum cfa_scope_type scope_type,
 			       enum cfa_app_type app_type, uint8_t *tsid,
 			       bool *first);
 
@@ -31,9 +34,6 @@ tfc_msg_backing_store_cfg_v2(struct tfc *tfcp, uint8_t tsid, enum cfa_dir dir,
 			     uint32_t rec_cnt, uint8_t static_bkt_cnt_exp,
 			     bool cfg_done);
 
-int
-tfc_msg_tbl_scope_deconfig(struct tfc *tfcp, uint8_t tsid);
-
 int
 tfc_msg_tbl_scope_fid_add(struct tfc *tfcp, uint16_t fid,
 			  uint8_t tsid, uint16_t *fid_cnt);
drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c +106 -99

481 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_tcam_debug.c +1 -1
index 40c99d1564..4ea969e19b 100644
@@ -1804,7 +1804,7 @@ int tfc_wc_show(FILE *fd, struct tfc *tfcp, uint8_t tsid, enum cfa_dir dir)
 	struct wc_frp_context wc_frp;
 	bool is_bs_owner;
 	struct bnxt *bp;
-	bool is_shared;
+	enum cfa_scope_type scope_type;
 	bool valid;
 	int rc = 0;
 
drivers/net/bnxt/tf_core/v3/tfc_util.c +15 -0
index 91ad3ad657..ac6f9cc565 100644
@@ -145,6 +145,21 @@ tfc_ts_region_2_str(enum cfa_region_type region, enum cfa_dir dir)
 	}
 }
 
+const char *
+tfc_scope_type_2_str(enum cfa_scope_type scope_type)
+{
+	switch (scope_type) {
+	case CFA_SCOPE_TYPE_NON_SHARED:
+		return "non_shared";
+	case CFA_SCOPE_TYPE_SHARED_APP:
+		return "shared_app";
+	case CFA_SCOPE_TYPE_GLOBAL:
+		return "global";
+	default:
+		return "Invalid scope type";
+	}
+}
+
 uint32_t
 tfc_getbits(uint32_t *data, int offset, int blen)
 {
drivers/net/bnxt/tf_core/v3/tfc_util.h +11 -0
index 5114517792..f71ade5c59 100644
@@ -87,6 +87,17 @@ const char *tfc_ts_region_2_str(enum cfa_region_type region, enum cfa_dir dir);
  */
 const char *tfc_if_tbl_2_str(enum cfa_resource_subtype_if_tbl if_tbl_stype);
 
+/**
+ * Helper function converting the scope type to text string
+ *
+ * [in] scope_type: table scope type
+ *
+ * Returns:
+ *   Pointer to a char string holding the string for scope type
+ */
+const char *tfc_scope_type_2_str(enum cfa_scope_type scope_type);
+
+
 /**
  * Helper function retrieving field value from the buffer
  *
drivers/net/bnxt/tf_core/v3/tfc_vf2pf_msg.c +2 -1
index cbe243e79c..7550ed4e84 100644
@@ -179,6 +179,7 @@ tfc_vf2pf_mem_alloc_process(struct tfc *tfcp,
 	/* This is not for local use if we are getting a message from the VF */
 	ma_parms.local = false;
 	ma_parms.max_pools = req->max_pools;
+	ma_parms.scope_type = req->scope_type;
 	rc = tfc_tbl_scope_mem_alloc(tfcp, req->hdr.fid, req->tsid, &ma_parms);
 	if (rc == 0) {
 		PMD_DRV_LOG_LINE(ERR, "tsid(%d) PF allocation succeeds",
@@ -222,7 +223,7 @@ tfc_vf2pf_mem_free_process(struct tfc *tfcp,
 	PMD_DRV_LOG_LINE(ERR, "Table scope mem free cfg cmd:");
 	PMD_DRV_LOG_LINE(ERR, "\ttsid: 0x%x", req->tsid);
 
-	rc = tfc_tbl_scope_mem_free(tfcp, req->hdr.fid, req->tsid);
+	rc = tfc_tbl_scope_mem_free(tfcp, req->hdr.fid, req->tsid, 0);
 	if (rc == 0) {
 		PMD_DRV_LOG_LINE(ERR, "tsid(%d) PF free succeeds", req->tsid);
 	} else {
drivers/net/bnxt/tf_core/v3/tfc_vf2pf_msg.h +3 -1
index efa35665f6..5bc592de9b 100644
@@ -73,6 +73,8 @@ struct tfc_vf2pf_tbl_scope_mem_alloc_cfg_cmd {
 	uint8_t act_pool_sz_exp[CFA_DIR_MAX];
 	/** start offset in 32B records of the lkup recs (after buckets) */
 	uint32_t lkup_rec_start_offset[CFA_DIR_MAX];
+	/** scope type non-shared, shared-app or global */
+	enum cfa_scope_type scope_type;
 };
 /**
  * Truflow VF2PF Table Scope Memory allocate/config response
@@ -103,7 +105,7 @@ struct tfc_vf2pf_tbl_scope_mem_free_resp {
 	struct tfc_vf2pf_hdr hdr;
 	/** status of request */
 	enum tfc_vf2pf_status status;
-	/** tsid memory freed */
+	/** table scope identifier */
 	uint8_t tsid;
 };
 
drivers/net/bnxt/tf_core/v3/tfo.c +151 -63

426 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfo.h +23 -16
index e572db5991..93a6a5c064 100644
@@ -50,6 +50,10 @@
  * @ref tfo_sid_set
  *
  * @ref tfo_sid_get
+ *
+ * @ref tfo_tim_get
+ *
+ * @ref tfo_tsid_get
  */
 
 /** Invalid Table Scope ID */
@@ -161,8 +165,8 @@ int tfo_ts_validate(void *tfo, uint8_t ts_tsid, bool *ts_valid);
  * @param[in] ts_tsid
  *   The table scope ID
  *
- * @param[in] ts_is_shared
- *   True if the table scope is shared
+ * @param[in] scope_type
+ *   non-shared, shared-app or global
  *
  * @param[in] ts_app
  *   Application type TF/AFM
@@ -171,12 +175,12 @@ int tfo_ts_validate(void *tfo, uint8_t ts_tsid, bool *ts_valid);
  *   True if the table scope is valid
  *
  * @param[in] ts_max_pools
- *   Maximum number of pools if shared.
+ *   Maximum number of pools
  *
  * @return
  *   0 for SUCCESS, negative error value for FAILURE (errno.h)
  */
-int tfo_ts_set(void *tfo, uint8_t ts_tsid, bool ts_is_shared,
+int tfo_ts_set(void *tfo, uint8_t ts_tsid, enum cfa_scope_type scope_type,
 	       enum cfa_app_type ts_app, bool ts_valid,
 	       uint16_t ts_max_pools);
 
@@ -189,8 +193,8 @@ int tfo_ts_set(void *tfo, uint8_t ts_tsid, bool ts_is_shared,
  * @param[in] ts_tsid
  *   The table scope ID
  *
- * @param[out] ts_is_shared
- *   True if the table scope is shared
+ * @param[out] scope_type
+ *   True if the table scope is sharednon-shared, shared-app, global
  *
  * @param[out] ts_app
  *   Application type TF/AFM
@@ -199,12 +203,12 @@ int tfo_ts_set(void *tfo, uint8_t ts_tsid, bool ts_is_shared,
  *   True if the table scope is valid
  *
  * @param[out] ts_max_pools
- *   Maximum number of pools returned if shared.
+ *   Maximum number of pools.
  *
  * @return
  *   0 for SUCCESS, negative error value for FAILURE (errno.h)
  */
-int tfo_ts_get(void *tfo, uint8_t ts_tsid, bool *ts_is_shared,
+int tfo_ts_get(void *tfo, uint8_t ts_tsid, enum cfa_scope_type *scope_type,
 	       enum cfa_app_type *ts_app, bool *ts_valid,
 	       uint16_t *ts_max_pools);
 
@@ -399,32 +403,35 @@ int tfo_sid_set(void *tfo, uint16_t sid);
 int tfo_sid_get(void *tfo, uint16_t *sid);
 
 /**
- * Set the table scope instance manager.
+ * Get the table scope instance manager.
  *
  * @param[in] tfo
  *   Pointer to TFC object
  *
- * @param[in] tim
- *   Pointer to the table scope instance manager
+ * @param[out] tim
+ *   Pointer to a pointer to the table scope instance manager
+ *
+ * @param[in] ts_tsid
+ *   Table scope id
  *
  * @return
  *   0 for SUCCESS, negative error value for FAILURE (errno.h)
  */
-int tfo_tim_set(void *tfo, void *tim);
+int tfo_tim_get(void *tfo, void **tim, uint8_t ts_tsid);
 
 /**
- * Get the table scope instance manager.
+ * Get the table scope
  *
  * @param[in] tfo
  *   Pointer to TFC object
  *
- * @param[out] tim
- *   Pointer to a pointer to the table scope instance manager
+ * @param[out] tsid
+ *   Pointer to the returned table scope
  *
  * @return
  *   0 for SUCCESS, negative error value for FAILURE (errno.h)
  */
-int tfo_tim_get(void *tfo, void **tim);
+int tfo_tsid_get(void *tfo, uint8_t *tsid);
 
 /**
  * Get the table scope
drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c +46 -24

148 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +2 -1
index 02534d8fe8..c30a43568b 100644
@@ -911,7 +911,8 @@ enum bnxt_ulp_feature_bit {
 	BNXT_ULP_FEATURE_BIT_SOCKET_DIRECT = 0x00000008,
 	BNXT_ULP_FEATURE_BIT_MULTI_INSTANCE = 0x00000010,
 	BNXT_ULP_FEATURE_BIT_SPECIAL_VXLAN = 0x00000020,
-	BNXT_ULP_FEATURE_BIT_HOT_UPGRADE = 0x00000040
+	BNXT_ULP_FEATURE_BIT_HOT_UPGRADE = 0x00000040,
+	BNXT_ULP_FEATURE_BIT_GLOBAL_TBL_SCOPE = 0x00000080
 };
 
 enum bnxt_ulp_flow_dir_bitmask {
Signature · 1 line
2.39.5 (Apple Git-154)
#249 lore raw

PATCH v5 34/57 net/bnxt/tf_ulp: ulp parser support to handle gre key

In reply to Manish Kurup

From: Shahaji Bhosle <[email protected]>

1. Added a new handler to GRE key input from the parser
2. Add a new pattern to match on GRE with KEY id.

---
 drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c |  4 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 45 ++++++++++++++++++-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |  5 +++
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  3 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |  2 +
 5 files changed, 55 insertions(+), 4 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c +2 -2
index 6e1115b985..4a7c7e437c 100644
@@ -373,8 +373,8 @@ struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {
 	.proto_hdr_func          = NULL
 	},
 	[RTE_FLOW_ITEM_TYPE_GRE_KEY] = {
-	.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
-	.proto_hdr_func          = NULL
+	.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,
+	.proto_hdr_func          = ulp_rte_gre_key_hdr_handler
 	},
 	[RTE_FLOW_ITEM_TYPE_GTP_PSC] = {
 	.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +44 -1

70 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +5 -0
index 5f451ba404..92c34394ae 100644
@@ -140,6 +140,11 @@ int32_t
 ulp_rte_geneve_hdr_handler(const struct rte_flow_item *item,
 			      struct ulp_rte_parser_params *params);
 
+/* Function to handle the parsing of RTE Flow item GRE KEY Header. */
+int32_t
+ulp_rte_gre_key_hdr_handler(const struct rte_flow_item *item,
+			    struct ulp_rte_parser_params *params);
+
 /* Function to handle the parsing of RTE Flow item GRE Header. */
 int32_t
 ulp_rte_gre_hdr_handler(const struct rte_flow_item *item,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +2 -1
index c30a43568b..3ce43f4c92 100644
@@ -119,7 +119,8 @@ enum bnxt_ulp_hdr_bit {
 	BNXT_ULP_HDR_BIT_NON_GENERIC         = 0x0000000400000000,
 	BNXT_ULP_HDR_BIT_GENERIC             = 0x0000000800000000,
 	BNXT_ULP_HDR_BIT_T_MPLS              = 0x0000001000000000,
-	BNXT_ULP_HDR_BIT_LAST                = 0x0000002000000000
+	BNXT_ULP_HDR_BIT_T_GRE_OPT           = 0x0000002000000000,
+	BNXT_ULP_HDR_BIT_LAST                = 0x0000004000000000
 };
 
 enum bnxt_ulp_accept_opc {
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +2 -0
index 5b3e82f336..f38ebcea9a 100644
@@ -32,6 +32,7 @@
 #define BNXT_ULP_PROTO_HDR_VXLAN_GPE_NUM 5
 #define BNXT_ULP_PROTO_HDR_GENEVE_NUM 4
 #define BNXT_ULP_PROTO_HDR_GRE_NUM	2
+#define BNXT_ULP_PROTO_HDR_GRE_KEY_NUM	1
 #define BNXT_ULP_PROTO_HDR_ICMP_NUM	5
 #define BNXT_ULP_PROTO_HDR_ECPRI_NUM	2
 #define	BNXT_ULP_PROTO_HDR_IPV6_EXT_NUM	1
@@ -100,6 +101,7 @@ struct ulp_rte_parser_params {
 	uint32_t			act_pattern_id;
 	uint8_t				app_id;
 	uint8_t				tun_idx;
+	uint16_t			gre_cks_rsvd0_ver; /* GRE C, K, S bits and version */
 	uint16_t			class_info_idx;
 	uint64_t			wc_field_bitmap;
 	uint64_t			cf_bitmap;
Signature · 1 line
2.39.5 (Apple Git-154)
#250 lore raw

PATCH v5 35/57 net/bnxt/tf_core: handle out of order MPC completions

In reply to Manish Kurup

From: Peter Spreadborough <[email protected]>

It is possible for MPC completions to be returned in an order different to the corresponding MPC requests. This change adds using the MPC opaque field to uniquely associate a completion with a request and handling of out of order completions to the batch-end processing.

---
 drivers/net/bnxt/bnxt_mpc.c           |  26 +++++-
 drivers/net/bnxt/bnxt_mpc.h           |   7 +-
 drivers/net/bnxt/tf_core/v3/tfc_act.c |  12 +--
 drivers/net/bnxt/tf_core/v3/tfc_em.c  | 126 +++++++++++++++++++++-----
 drivers/net/bnxt/tf_core/v3/tfc_em.h  |   4 +-
 5 files changed, 138 insertions(+), 37 deletions(-)
drivers/net/bnxt/bnxt_mpc.c +21 -5
index 2582b50782..259066fa61 100644
@@ -575,7 +575,9 @@ int bnxt_mpc_open(struct bnxt *bp)
 	return rc;
 }
 
-int bnxt_mpc_cmd_cmpl(struct bnxt_mpc_txq *mpc_queue, struct bnxt_mpc_mbuf *out_msg)
+int bnxt_mpc_cmd_cmpl(struct bnxt_mpc_txq *mpc_queue,
+		      struct bnxt_mpc_mbuf *out_msg,
+		      uint16_t *opaque)
 {
 	struct bnxt_cp_ring_info *cpr = mpc_queue->cp_ring;
 	uint32_t raw_cons = cpr->cp_raw_cons;
@@ -665,12 +667,13 @@ int bnxt_mpc_cmd_cmpl(struct bnxt_mpc_txq *mpc_queue, struct bnxt_mpc_mbuf *out_
 		bnxt_db_mpc_cq(cpr);
 	}
 
+	*opaque = (uint16_t)mpc_cmpl->info2;
 	return nb_mpc_cmds;
 }
 
 static uint16_t bnxt_mpc_xmit(struct bnxt_mpc_mbuf *mpc_cmd,
 			      struct bnxt_mpc_txq *mpc_queue,
-			      uint32_t *opaque)
+			      uint16_t *opaque)
 {
 	struct bnxt_mpc_ring_info *mpr = mpc_queue->mpc_ring;
 	struct bnxt_ring *ring = mpr->mpc_ring_struct;
@@ -715,13 +718,14 @@ static uint16_t bnxt_mpc_xmit(struct bnxt_mpc_mbuf *mpc_cmd,
 int bnxt_mpc_send(struct bnxt *bp,
 		  struct bnxt_mpc_mbuf *in_msg,
 		  struct bnxt_mpc_mbuf *out_msg,
-		  uint32_t *opaque,
+		  uint16_t *opaque,
 		  bool batch)
 {
 	int rc;
 	struct bnxt_mpc_txq *mpc_queue = bp->mpc->mpc_txq[in_msg->chnl_id];
 	int retry = BNXT_MPC_RX_RETRY;
 	uint32_t pi = 0;
+	uint16_t rx_opaque;
 
 	if (out_msg->cmp_type != CMPL_BASE_TYPE_MID_PATH_SHORT &&
 	    out_msg->cmp_type != CMPL_BASE_TYPE_MID_PATH_LONG)
@@ -737,6 +741,8 @@ int bnxt_mpc_send(struct bnxt *bp,
 	 * it can be detected.
 	 */
 	pi = mpc_queue->mpc_ring->raw_prod;
+	*opaque = mpc_queue->seq_num;
+	mpc_queue->seq_num++;
 	rc = bnxt_mpc_xmit(in_msg, mpc_queue, opaque);
 
 	if (unlikely(rc))
@@ -761,10 +767,20 @@ int bnxt_mpc_send(struct bnxt *bp,
 	do {
 		rte_delay_us_block(BNXT_MPC_RX_US_DELAY);
 
-		rc =  bnxt_mpc_cmd_cmpl(mpc_queue, out_msg);
+		rc =  bnxt_mpc_cmd_cmpl(mpc_queue, out_msg, &rx_opaque);
 
-		if (rc == 1)
+		if (rc == 1) {
+			if (rx_opaque != *opaque)
+				PMD_DRV_LOG_LINE(ERR,
+					    "%s: Out of order completion. Opaque Expected:%d Got:%d",
+					    __func__,
+					    *opaque,
+					    rx_opaque);
 			return 0;
+		}
+#ifdef MPC_DEBUG
+		PMD_DRV_LOG_LINE("Received zero or more than one completion:%d", rc);
+#endif
 		retry--;
 	} while (retry);
 
drivers/net/bnxt/bnxt_mpc.h +5 -2
index b089ddd4bb..da3672e493 100644
@@ -93,6 +93,7 @@ struct bnxt_mpc_txq {
 	struct bnxt_cp_ring_info	*cp_ring;
 	const struct rte_memzone *mz;
 	struct bnxt_mpc_mbuf **free;
+	uint16_t	seq_num;
 
 	void (*cmpl_handler_cb)(struct bnxt_mpc_txq *mpc_queue,
 				uint32_t nb_mpc_cmds);
@@ -109,9 +110,11 @@ int bnxt_mpc_close(struct bnxt *bp);
 int bnxt_mpc_send(struct bnxt *bp,
 		  struct bnxt_mpc_mbuf *in_msg,
 		  struct bnxt_mpc_mbuf *out_msg,
-		  uint32_t *opaque,
+		  uint16_t *opaque,
 		  bool batch);
-int bnxt_mpc_cmd_cmpl(struct bnxt_mpc_txq *mpc_queue, struct bnxt_mpc_mbuf *out_msg);
+int bnxt_mpc_cmd_cmpl(struct bnxt_mpc_txq *mpc_queue,
+		      struct bnxt_mpc_mbuf *out_msg,
+		      uint16_t *opaque);
 int bnxt_mpc_poll_cmd_cmpls(struct bnxt_mpc_txq *mpc_queue);
 
 #endif
drivers/net/bnxt/tf_core/v3/tfc_act.c +6 -6
index 3c1c76359b..d93064dbc6 100644
@@ -225,7 +225,7 @@ int tfc_act_set(struct tfc *tfcp,
 	int rc = 0;
 	uint8_t tx_msg[TFC_MPC_MAX_TX_BYTES];
 	uint8_t rx_msg[TFC_MPC_MAX_RX_BYTES];
-	uint32_t msg_count = BNXT_MPC_COMP_MSG_COUNT;
+	uint16_t opaque;
 	uint32_t i;
 	uint32_t buff_len;
 	struct cfa_mpc_data_obj fields_cmd[CFA_BLD_MPC_WRITE_CMD_MAX_FLD];
@@ -311,7 +311,7 @@ int tfc_act_set(struct tfc *tfcp,
 	rc = tfc_mpc_send(tfcp->bp,
 			  &mpc_msg_in,
 			  &mpc_msg_out,
-			  &msg_count,
+			  &opaque,
 			  TFC_MPC_TABLE_WRITE,
 			  batch_info);
 
@@ -377,7 +377,7 @@ static int tfc_act_get_only(struct tfc *tfcp,
 	int rc = 0;
 	uint8_t tx_msg[TFC_MPC_MAX_TX_BYTES] = { 0 };
 	uint8_t rx_msg[TFC_MPC_MAX_RX_BYTES] = { 0 };
-	uint32_t msg_count = BNXT_MPC_COMP_MSG_COUNT;
+	uint16_t opaque;
 	int i;
 	uint32_t buff_len;
 	struct cfa_mpc_data_obj fields_cmd[CFA_BLD_MPC_READ_CMD_MAX_FLD] = { {0} };
@@ -477,7 +477,7 @@ static int tfc_act_get_only(struct tfc *tfcp,
 	rc = tfc_mpc_send(tfcp->bp,
 			  &mpc_msg_in,
 			  &mpc_msg_out,
-			  &msg_count,
+			  &opaque,
 			  TFC_MPC_TABLE_READ,
 			  batch_info);
 
@@ -556,7 +556,7 @@ static int tfc_act_get_clear(struct tfc *tfcp,
 	int rc = 0;
 	uint8_t tx_msg[TFC_MPC_MAX_TX_BYTES] = { 0 };
 	uint8_t rx_msg[TFC_MPC_MAX_RX_BYTES] = { 0 };
-	uint32_t msg_count = BNXT_MPC_COMP_MSG_COUNT;
+	uint16_t opaque;
 	int i;
 	uint32_t buff_len;
 	struct cfa_mpc_data_obj fields_cmd[CFA_BLD_MPC_READ_CLR_CMD_MAX_FLD] = { {0} };
@@ -665,7 +665,7 @@ static int tfc_act_get_clear(struct tfc *tfcp,
 	rc = tfc_mpc_send(tfcp->bp,
 			  &mpc_msg_in,
 			  &mpc_msg_out,
-			  &msg_count,
+			  &opaque,
 			  TFC_MPC_TABLE_READ_CLEAR,
 			  batch_info);
 
drivers/net/bnxt/tf_core/v3/tfc_em.c +103 -23

233 lines not on this page · raw message

drivers/net/bnxt/tf_core/v3/tfc_em.h +3 -1
index 52589ea9c3..659cebe907 100644
@@ -21,6 +21,8 @@ struct tfc_mpc_comp_info_t {
 	struct bnxt_mpc_mbuf out_msg;
 	int type;
 	uint16_t read_words;
+	uint16_t opaque;
+	bool valid;
 };
 
 struct tfc_mpc_batch_info_t {
@@ -249,7 +251,7 @@ int tfc_act_get_clear_response(struct cfa_bld_mpcinfo *mpc_info,
 int tfc_mpc_send(struct bnxt *bp,
 		 struct bnxt_mpc_mbuf *in_msg,
 		 struct bnxt_mpc_mbuf *out_msg,
-		 uint32_t *opaque,
+		 uint16_t *opaque,
 		 int type,
 		 struct tfc_mpc_batch_info_t *batch_info);
 
Signature · 1 line
2.39.5 (Apple Git-154)
#251 lore raw

PATCH v5 36/57 net/bnxt/tf_ulp: socket direct enable

In reply to Manish Kurup

From: Farah Smith <[email protected]>

1. Remove code which requires multi-root to be configured in order for the socket direct feature be enabled. This is not required and was a customer specific implementation.

2. Always enable the global table scope for Thor2 when the socket direct feature is enabled.

3. Remove global table scope feature bit.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c    | 12 +++---------
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c   | 16 ++++------------
 drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h |  5 +++--
 3 files changed, 10 insertions(+), 23 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c +3 -9
index e3eb9107ab..de87ce0349 100644
@@ -420,15 +420,9 @@ ulp_tf_cntxt_app_caps_init(struct bnxt *bp,
 		if (info[i].flags & BNXT_ULP_APP_CAP_BC_MC_SUPPORT)
 			ulp_ctx->cfg_data->ulp_flags |=
 				BNXT_ULP_APP_BC_MC_SUPPORT;
-		if (info[i].flags & BNXT_ULP_APP_CAP_SOCKET_DIRECT) {
-			/* Enable socket direction only if MR is enabled in fw*/
-			if (BNXT_MULTIROOT_EN(bp)) {
-				ulp_ctx->cfg_data->ulp_flags |=
-					BNXT_ULP_APP_SOCKET_DIRECT;
-				BNXT_DRV_DBG(INFO,
-					     "Socket Direct feature is enabled\n");
-			}
-		}
+		if (info[i].flags & BNXT_ULP_APP_CAP_SOCKET_DIRECT)
+			ulp_ctx->cfg_data->ulp_flags |=
+				BNXT_ULP_APP_SOCKET_DIRECT;
 		if (info[i].flags & BNXT_ULP_APP_CAP_HA_DYNAMIC) {
 			/* Read the environment variable to determine hot up */
 			if (!bnxt_pmd_get_hot_up_config()) {
drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c +4 -12
index 65df4ecd79..772dd69035 100644
@@ -553,18 +553,10 @@ ulp_tfc_cntxt_app_caps_init(struct bnxt *bp, uint8_t app_id, uint32_t dev_id)
 		if (info[i].flags & BNXT_ULP_APP_CAP_BC_MC_SUPPORT)
 			ulp_ctx->cfg_data->ulp_flags |=
 				BNXT_ULP_APP_BC_MC_SUPPORT;
-		if (info[i].flags & BNXT_ULP_APP_CAP_SOCKET_DIRECT) {
-			/* Enable socket direction only if MR is enabled in fw*/
-			if (BNXT_MULTIROOT_EN(bp)) {
-				ulp_ctx->cfg_data->ulp_flags |=
-					BNXT_ULP_APP_SOCKET_DIRECT;
-				BNXT_DRV_DBG(DEBUG,
-					    "Socket Direct feature is enabled");
-			} else {
-				BNXT_DRV_DBG(DEBUG,
-					     "No Socket Direct feature - must enable multiroot");
-			}
-		}
+		if (info[i].flags & BNXT_ULP_APP_CAP_SOCKET_DIRECT)
+			ulp_ctx->cfg_data->ulp_flags |=
+				BNXT_ULP_APP_SOCKET_DIRECT;
+
 		/* Update the capability feature bits*/
 		if (bnxt_ulp_cap_feat_process(info[i].feature_bits,
 					      &ulp_ctx->cfg_data->feature_bits))
drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h +3 -2
index c3f3bcd59d..c46340b1a4 100644
@@ -1061,8 +1061,9 @@ bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits)
 	if (bit & BNXT_ULP_FEATURE_BIT_SPECIAL_VXLAN)
 		BNXT_DRV_DBG(ERR, "Special VXLAN Feature is enabled\n");
 	if (bit & BNXT_ULP_FEATURE_BIT_HOT_UPGRADE)
-		BNXT_DRV_DBG(ERR, "Hot Upgrade Feature is enabled\n");
-
+		BNXT_DRV_DBG(ERR, "Hot Upgrade Feature is enabled");
+	if (bit & BNXT_ULP_FEATURE_BIT_SOCKET_DIRECT)
+		BNXT_DRV_DBG(ERR, "Socket Direct Feature is enabled");
 	*out_bits =  bit;
 	return 0;
 }
Signature · 1 line
2.39.5 (Apple Git-154)
#252 lore raw

PATCH v5 37/57 net/bnxt: Correctly account for udp_tunnel_ports

In reply to Manish Kurup

From: Farah Smith <[email protected]>

Do not increment the port count if adding the same value multiple times.

---
 drivers/net/bnxt/bnxt_ethdev.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +0 -3
index 94bec74c1e..54613076b0 100644
@@ -2622,7 +2622,6 @@ bnxt_udp_tunnel_port_add_op(struct rte_eth_dev *eth_dev,
 				PMD_DRV_LOG_LINE(ERR, "Only one port allowed");
 				return -ENOSPC;
 			}
-			bp->vxlan_port_cnt++;
 			return 0;
 		}
 		tunnel_type =
@@ -2636,7 +2635,6 @@ bnxt_udp_tunnel_port_add_op(struct rte_eth_dev *eth_dev,
 				PMD_DRV_LOG_LINE(ERR, "Only one port allowed");
 				return -ENOSPC;
 			}
-			bp->geneve_port_cnt++;
 			return 0;
 		}
 		tunnel_type =
@@ -2650,7 +2648,6 @@ bnxt_udp_tunnel_port_add_op(struct rte_eth_dev *eth_dev,
 				PMD_DRV_LOG_LINE(ERR, "Only one port allowed");
 				return -ENOSPC;
 			}
-			bp->ecpri_port_cnt++;
 			return 0;
 		}
 		tunnel_type =
Signature · 1 line
2.39.5 (Apple Git-154)
#253 lore raw

PATCH v5 38/57 net/bnxt/tf_ulp: add non vfr mode capability

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

For Wh+ platform, the generic template support representor and non representor mode, this flag shall be controlled by the newly added capability flag that is added during the compile time. The flag enables the testpmd forward mode, so testpmd application can forward packets from one port to another port.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c          | 5 ++++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h       | 3 +++
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h | 3 ++-
 3 files changed, 9 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c +4 -1
index de87ce0349..54a5e6968c 100644
@@ -1049,6 +1049,7 @@ ulp_tf_ctx_init(struct bnxt *bp,
 	int32_t			rc = 0;
 	enum bnxt_ulp_device_id devid;
 	enum bnxt_ulp_session_type stype;
+	uint64_t feat_bits;
 	struct tf *tfp;
 
 	/* Initialize the context entries list */
@@ -1101,7 +1102,9 @@ ulp_tf_ctx_init(struct bnxt *bp,
 		goto error_deinit;
 	}
 
-	if (BNXT_TESTPMD_EN(bp)) {
+	feat_bits = bnxt_ulp_feature_bits_get(bp->ulp_ctx);
+	if ((feat_bits & BNXT_ULP_FEATURE_BIT_NON_VFR_MODE) &&
+	    !BNXT_REP_MODE_EN(bp)) {
 		ulp_data->ulp_flags &= ~BNXT_ULP_VF_REP_ENABLED;
 		BNXT_DRV_DBG(ERR, "Enabled Testpmd forward mode\n");
 	}
drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h +3 -0
index c46340b1a4..14ee1e05fb 100644
@@ -1064,6 +1064,9 @@ bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits)
 		BNXT_DRV_DBG(ERR, "Hot Upgrade Feature is enabled");
 	if (bit & BNXT_ULP_FEATURE_BIT_SOCKET_DIRECT)
 		BNXT_DRV_DBG(ERR, "Socket Direct Feature is enabled");
+	if (bit & BNXT_ULP_FEATURE_BIT_NON_VFR_MODE)
+		BNXT_DRV_DBG(ERR, "Non VFR Feature is enabled");
+
 	*out_bits =  bit;
 	return 0;
 }
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +2 -1
index 3ce43f4c92..d63862ffba 100644
@@ -913,7 +913,8 @@ enum bnxt_ulp_feature_bit {
 	BNXT_ULP_FEATURE_BIT_MULTI_INSTANCE = 0x00000010,
 	BNXT_ULP_FEATURE_BIT_SPECIAL_VXLAN = 0x00000020,
 	BNXT_ULP_FEATURE_BIT_HOT_UPGRADE = 0x00000040,
-	BNXT_ULP_FEATURE_BIT_GLOBAL_TBL_SCOPE = 0x00000080
+	BNXT_ULP_FEATURE_BIT_GLOBAL_TBL_SCOPE = 0x00000080,
+	BNXT_ULP_FEATURE_BIT_NON_VFR_MODE = 0x00000100
 };
 
 enum bnxt_ulp_flow_dir_bitmask {
Signature · 1 line
2.39.5 (Apple Git-154)
#254 lore raw

PATCH v5 39/57 net/bnxt: avoid iova range check when external memory is used

In reply to Manish Kurup

From: Sriharsha Basavapatna <[email protected]>

The function checks if the iova is in the valid range. But this check is not relevant to external memory; avoid it when external memory is in use.

---
 drivers/net/bnxt/bnxt_txr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_txr.c +3 -2
index f88e214790..27758898b0 100644
@@ -221,8 +221,9 @@ static int bnxt_invalid_mbuf(struct rte_mbuf *mbuf)
 	if (unlikely(rte_mbuf_check(mbuf, 1, &reason)))
 		return -EINVAL;
 
-	if (unlikely(mbuf->buf_iova < mbuf_size ||
-		     (mbuf->buf_iova != rte_mempool_virt2iova(mbuf) + mbuf_size)))
+	if (unlikely(!(mbuf->ol_flags & RTE_MBUF_F_EXTERNAL) &&
+		     (mbuf->buf_iova < mbuf_size ||
+		      (mbuf->buf_iova != rte_mempool_virt2iova(mbuf) + mbuf_size))))
 		return -EINVAL;
 
 	return 0;
Signature · 1 line
2.39.5 (Apple Git-154)
#255 lore raw

PATCH v5 40/57 net/bnxt: avoid potential segfault in VFR handling

In reply to Manish Kurup

From: Peter Spreadborough <[email protected]>

1. Addresses crashes that were seen when using invalid representor arguments. The crash would occur when unwinding after a bnxt_pci_probe() failure.
2. If a representor port exists and an attempt is made to attach the same port a crash would occur. This change adds a check for an already existing port.

---
 drivers/net/bnxt/bnxt_ethdev.c | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +17 -11
index 54613076b0..4ed2bf2a1a 100644
@@ -6900,16 +6900,9 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
 		return -ENOTSUP;
 	}
 	num_rep = eth_da->nb_representor_ports;
-	if (num_rep > max_vf_reps) {
-		PMD_DRV_LOG_LINE(ERR, "nb_representor_ports = %d > %d MAX VF REPS",
-			    num_rep, max_vf_reps);
-		return -EINVAL;
-	}
-
-	if (num_rep >= RTE_MAX_ETHPORTS) {
-		PMD_DRV_LOG_LINE(ERR,
-			    "nb_representor_ports = %d > %d MAX ETHPORTS",
-			    num_rep, RTE_MAX_ETHPORTS);
+	if (num_rep > max_vf_reps || num_rep > RTE_MAX_ETHPORTS) {
+		PMD_DRV_LOG_LINE(ERR, "nb_representor_ports = %d > %d OR %d MAX VF REPS",
+			    num_rep, max_vf_reps, RTE_MAX_ETHPORTS);
 		return -EINVAL;
 	}
 
@@ -6942,6 +6935,13 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
 		snprintf(name, sizeof(name), "net_%s_representor_%d",
 			 pci_dev->device.name, eth_da->representor_ports[i]);
 
+		if (rte_eth_dev_allocated(name) != NULL) {
+			PMD_DRV_LOG_LINE(ERR,
+					 "Ethernet device with name %s already allocated",
+					 name);
+			return -EEXIST;
+		}
+
 		kvlist = rte_kvargs_parse(dev_args, bnxt_dev_args);
 		if (kvlist) {
 			/*
@@ -7078,7 +7078,13 @@ static int bnxt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	num_rep = eth_da.nb_representor_ports;
 	PMD_DRV_LOG_LINE(DEBUG, "nb_representor_ports = %d",
-		    num_rep);
+			 num_rep);
+	if (num_rep >= RTE_MAX_ETHPORTS) {
+		PMD_DRV_LOG_LINE(ERR,
+				 "nb_representor_ports = %d > %d MAX ETHPORTS",
+				 num_rep, RTE_MAX_ETHPORTS);
+		return -EINVAL;
+	}
 
 	/* We could come here after first level of probe is already invoked
 	 * as part of an application bringup(OVS-DPDK vswitchd), so first check
Signature · 1 line
2.39.5 (Apple Git-154)
#256 lore raw

PATCH v5 41/57 net/bnxt/tf_ulp: change rte_mem_virt2iova to rte_mem_virt2phys

In reply to Manish Kurup

From: Shahaji Bhosle <[email protected]>

Need to support --no-huge mode which allows application to run as unprivileged user and does not have access to hugepage mount point and files within it.

rte_mem_virt2phy() does not have access to physical addresses(PA) without hugepages, so use rte_mem_virt2iova() with vfio-pci kernel driver.

---
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +2 -2
index 4be2703740..c765e123fe 100644
@@ -62,9 +62,9 @@ ulp_fc_mgr_shadow_mem_alloc(struct hw_fc_mem_info *parms, int size)
 
 	rte_mem_lock_page(parms->mem_va);
 
-	parms->mem_pa = (void *)(uintptr_t)rte_mem_virt2phy(parms->mem_va);
+	parms->mem_pa = (void *)(uintptr_t)rte_mem_virt2iova(parms->mem_va);
 	if (parms->mem_pa == (void *)RTE_BAD_IOVA) {
-		BNXT_DRV_DBG(ERR, "Allocate failed mem_pa\n");
+		BNXT_DRV_DBG(ERR, "virt2iova failed for mem_va 0x%p", parms->mem_va);
 		return -ENOMEM;
 	}
 
Signature · 1 line
2.39.5 (Apple Git-154)
#257 lore raw

PATCH v5 42/57 net/bnxt: thor2 truflow memory manager bug

In reply to Manish Kurup

From: Farah Smith <[email protected]>

A performance optimization was made based upon the belief that blocks in the memory manager always had non-full blocks prior to full blocks. But this is not the case. The performance optimization stopped looking for space in the block list as soon as the first full block was found in the list. This fix adds code so that whenever a block is full, it is moved to the end of the list so that the search can stop upon reaching the first full block. Remove current_blk_idx. Adjust max_records based upon max contiguous.

---
 drivers/net/bnxt/hcapi/cfa_v3/mm/cfa_mm.c     | 83 ++++++++++++-------
 .../net/bnxt/hcapi/cfa_v3/mm/cfa_mm_priv.h    |  2 +-
 2 files changed, 56 insertions(+), 29 deletions(-)
drivers/net/bnxt/hcapi/cfa_v3/mm/cfa_mm.c +55 -28
index 05528dd3e4..6e21d513ac 100644
@@ -48,6 +48,10 @@ int cfa_mm_query(struct cfa_mm_query_parms *parms)
 	max_records = parms->max_records;
 	max_contig_records = (uint16_t)parms->max_contig_records;
 
+	/* Align to max_contig_records */
+	max_records = (max_records + (max_contig_records - 1)) &
+		      ~(max_contig_records - 1);
+
 	if (unlikely(!(CFA_CHECK_BOUNDS(max_records, 1, CFA_MM_MAX_RECORDS) &&
 	      IS_POWER_2(max_contig_records) &&
 	      CFA_CHECK_BOUNDS(max_contig_records, 1,
@@ -79,6 +83,10 @@ int cfa_mm_open(void *cmm, struct cfa_mm_open_parms *parms)
 	max_records = parms->max_records;
 	max_contig_records = (uint16_t)parms->max_contig_records;
 
+	/* Align to max_contig_records */
+	max_records = (max_records + (max_contig_records - 1)) &
+		      ~(max_contig_records - 1);
+
 	if (unlikely(!(CFA_CHECK_BOUNDS(max_records, 1, CFA_MM_MAX_RECORDS) &&
 	      IS_POWER_2(max_contig_records) &&
 	      CFA_CHECK_BOUNDS(max_contig_records, 1,
@@ -115,11 +123,11 @@ int cfa_mm_open(void *cmm, struct cfa_mm_open_parms *parms)
 	context->blk_bmap_tbl = (uint8_t *)(context->blk_tbl + num_blocks);
 
 	context->blk_list_tbl[0].first_blk_idx = 0;
-	context->blk_list_tbl[0].current_blk_idx = 0;
+	context->blk_list_tbl[0].last_blk_idx = 0;
 
 	for (i = 1; i < num_lists; i++) {
 		context->blk_list_tbl[i].first_blk_idx = CFA_MM_INVALID32;
-		context->blk_list_tbl[i].current_blk_idx = CFA_MM_INVALID32;
+		context->blk_list_tbl[i].last_blk_idx = CFA_MM_INVALID32;
 	}
 
 	for (i = 0; i < num_blocks; i++) {
@@ -162,6 +170,7 @@ int cfa_mm_close(void *cmm)
 	return 0;
 }
 
+/* Allocate a block idx from the free list */
 static uint32_t cfa_mm_blk_alloc(struct cfa_mm *context)
 {
 	uint32_t blk_idx;
@@ -179,8 +188,6 @@ static uint32_t cfa_mm_blk_alloc(struct cfa_mm *context)
 	free_list->first_blk_idx =
 		context->blk_tbl[free_list->first_blk_idx].next_blk_idx;
 
-	free_list->current_blk_idx = free_list->first_blk_idx;
-
 	if (free_list->first_blk_idx != CFA_MM_INVALID32) {
 		context->blk_tbl[free_list->first_blk_idx].prev_blk_idx =
 			CFA_MM_INVALID32;
@@ -192,6 +199,7 @@ static uint32_t cfa_mm_blk_alloc(struct cfa_mm *context)
 	return blk_idx;
 }
 
+/* Return a block index to the free list */
 static void cfa_mm_blk_free(struct cfa_mm *context, uint32_t blk_idx)
 {
 	struct cfa_mm_blk_list *free_list = context->blk_list_tbl;
@@ -208,16 +216,17 @@ static void cfa_mm_blk_free(struct cfa_mm *context, uint32_t blk_idx)
 	}
 
 	free_list->first_blk_idx = blk_idx;
-	free_list->current_blk_idx = blk_idx;
 }
 
+/* insert at the top of a non-free list */
 static void cfa_mm_blk_insert(struct cfa_mm *context,
 			      struct cfa_mm_blk_list *blk_list,
 			      uint32_t blk_idx)
 {
+	/* there are no entries in the list so init all to this one */
 	if (blk_list->first_blk_idx == CFA_MM_INVALID32) {
 		blk_list->first_blk_idx = blk_idx;
-		blk_list->current_blk_idx = blk_idx;
+		blk_list->last_blk_idx = blk_idx;
 	} else {
 		struct cfa_mm_blk *blk_info = &context->blk_tbl[blk_idx];
 
@@ -226,10 +235,29 @@ static void cfa_mm_blk_insert(struct cfa_mm *context,
 		context->blk_tbl[blk_list->first_blk_idx].prev_blk_idx =
 			blk_idx;
 		blk_list->first_blk_idx = blk_idx;
-		blk_list->current_blk_idx = blk_idx;
 	}
 }
 
+/* insert at the bottom of a non-free list */
+static void cfa_mm_blk_insert_last(struct cfa_mm *context,
+				   struct cfa_mm_blk_list *blk_list,
+				   uint32_t blk_idx)
+{
+	if (blk_list->last_blk_idx == CFA_MM_INVALID32) {
+		blk_list->first_blk_idx = blk_idx;
+		blk_list->last_blk_idx = blk_idx;
+	} else {
+		struct cfa_mm_blk *blk_info = &context->blk_tbl[blk_idx];
+
+		blk_info->prev_blk_idx = blk_list->last_blk_idx;
+		blk_info->next_blk_idx = CFA_MM_INVALID32;
+		context->blk_tbl[blk_list->last_blk_idx].next_blk_idx =
+			blk_idx;
+		blk_list->last_blk_idx = blk_idx;
+	}
+}
+
+/* delete from anywhere in the list */
 static void cfa_mm_blk_delete(struct cfa_mm *context,
 			      struct cfa_mm_blk_list *blk_list,
 			      uint32_t blk_idx)
@@ -239,15 +267,20 @@ static void cfa_mm_blk_delete(struct cfa_mm *context,
 	if (blk_list->first_blk_idx == CFA_MM_INVALID32)
 		return;
 
+	if (blk_list->last_blk_idx == blk_idx) {
+		blk_list->last_blk_idx = blk_info->prev_blk_idx;
+		if (blk_list->last_blk_idx != CFA_MM_INVALID32) {
+			context->blk_tbl[blk_list->last_blk_idx].next_blk_idx =
+				CFA_MM_INVALID32;
+		}
+	}
+
 	if (blk_list->first_blk_idx == blk_idx) {
 		blk_list->first_blk_idx = blk_info->next_blk_idx;
 		if (blk_list->first_blk_idx != CFA_MM_INVALID32) {
 			context->blk_tbl[blk_list->first_blk_idx].prev_blk_idx =
 				CFA_MM_INVALID32;
 		}
-		if (blk_list->current_blk_idx == blk_idx)
-			blk_list->current_blk_idx = blk_list->first_blk_idx;
-
 		return;
 	}
 
@@ -260,20 +293,6 @@ static void cfa_mm_blk_delete(struct cfa_mm *context,
 		context->blk_tbl[blk_info->next_blk_idx].prev_blk_idx =
 			blk_info->prev_blk_idx;
 	}
-
-	if (blk_list->current_blk_idx == blk_idx) {
-		if (blk_info->next_blk_idx != CFA_MM_INVALID32) {
-			blk_list->current_blk_idx = blk_info->next_blk_idx;
-		} else {
-			if (blk_info->prev_blk_idx != CFA_MM_INVALID32) {
-				blk_list->current_blk_idx =
-					blk_info->prev_blk_idx;
-			} else {
-				blk_list->current_blk_idx =
-					blk_list->first_blk_idx;
-			}
-		}
-	}
 }
 
 /* Returns true if the bit in the bitmap is set to 'val' else returns false */
@@ -413,12 +432,19 @@ int cfa_mm_alloc(void *cmm, struct cfa_mm_alloc_parms *parms)
 
 		blk_info->num_contig_records = num_records;
 	} else {
-		blk_idx = blk_list->current_blk_idx;
+		blk_idx = blk_list->first_blk_idx;
 		blk_info = &context->blk_tbl[blk_idx];
 	}
 
 	while (blk_info->num_free_records < num_records) {
-		if (blk_info->next_blk_idx == CFA_MM_INVALID32 || !blk_info->num_free_records) {
+		/*
+		 * All non-full entries precede full entries so
+		 * upon seeing the first full entry, allocate
+		 * new block as this means all following records
+		 * are full.
+		 */
+		if (blk_info->next_blk_idx == CFA_MM_INVALID32 ||
+		    !blk_info->num_free_records) {
 			blk_idx = cfa_mm_blk_alloc(context);
 			if (unlikely(blk_idx == CFA_MM_INVALID32)) {
 				ret = -ENOMEM;
@@ -433,8 +459,6 @@ int cfa_mm_alloc(void *cmm, struct cfa_mm_alloc_parms *parms)
 		} else {
 			blk_idx = blk_info->next_blk_idx;
 			blk_info = &context->blk_tbl[blk_idx];
-
-			blk_list->current_blk_idx = blk_idx;
 		}
 	}
 
@@ -459,6 +483,9 @@ int cfa_mm_alloc(void *cmm, struct cfa_mm_alloc_parms *parms)
 	blk_info->num_free_records -= num_records;
 
 	if (!blk_info->num_free_records) {
+		/* move block to the end of the list if it is full */
+		cfa_mm_blk_delete(context, blk_list, blk_idx);
+		cfa_mm_blk_insert_last(context, blk_list, blk_idx);
 		blk_info->first_free_record = context->records_per_block;
 	} else {
 		cnt = NUM_ALIGN_UNITS(context->records_per_block,
drivers/net/bnxt/hcapi/cfa_v3/mm/cfa_mm_priv.h +1 -1
index 2a646217ec..dbac1c3cf2 100644
@@ -47,7 +47,7 @@ struct cfa_mm_blk_list {
 	/* Index of the first block in the list */
 	uint32_t first_blk_idx;
 	/* Index of the current block having free records */
-	uint32_t current_blk_idx;
+	uint32_t last_blk_idx;
 };
 
 /**
Signature · 1 line
2.39.5 (Apple Git-154)
#258 lore raw

PATCH v5 43/57 net/bnxt: Skip stats collection when rx queue inactive

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

When rx queue is not started and the stats context id is not allocated then skip the stats collection.

---
 drivers/net/bnxt/bnxt_stats.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/bnxt/bnxt_stats.c +5 -0
index 53f5613eb3..3ed1dc8101 100644
@@ -667,6 +667,9 @@ static int bnxt_stats_get_ext(struct rte_eth_dev *eth_dev,
 		if (!rxq->rx_started)
 			continue;
 
+		if (cpr->hw_stats_ctx_id == HWRM_NA_SIGNATURE)
+			continue;
+
 		rc = bnxt_hwrm_ring_stats_ext(bp, cpr->hw_stats_ctx_id, i,
 					      &ring_stats, true);
 		if (unlikely(rc))
@@ -728,6 +731,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 
 		if (!rxq->rx_started)
 			continue;
+		if (cpr->hw_stats_ctx_id == HWRM_NA_SIGNATURE)
+			continue;
 
 		rc = bnxt_hwrm_ring_stats(bp, cpr->hw_stats_ctx_id, i,
 					  &ring_stats, true);
Signature · 1 line
2.39.5 (Apple Git-154)
#259 lore raw

PATCH v5 44/57 net/bnxt: additional rss configuration cleanup

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

If the rss hash type is set to none and the ports are stopped and started again, the check for rss hash type was not allowing the bnxt driver to populate the correct rx rings in the vnic rss list. This causes the subsequent calls to rss configuration fail since the rss list is not configured and have stale data causing the firmware to reject the rss configuration.

The rss hash type of none should not be ignored during configuration, it is a valid configuration and should be applied. When rss hash type is none, the rss context is disabled and there should be no rss algorithm applied to the incoming traffic.

---
 drivers/net/bnxt/bnxt_hwrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_hwrm.c +1 -1
index 00b02821c9..939f35e3da 100644
@@ -6331,7 +6331,7 @@ int bnxt_vnic_rss_configure(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 	if (vnic->fw_vnic_id == INVALID_HW_RING_ID)
 		return 0;
 
-	if (!(vnic->rss_table && vnic->hash_type))
+	if (vnic->rss_table == NULL)
 		return 0;
 
 	if (BNXT_CHIP_P5_P7(bp))
Signature · 1 line
2.39.5 (Apple Git-154)
#260 lore raw

PATCH v5 45/57 net/bnxt: packet drop after port stop and start

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

The packets are getting dropped if some of the queues are configured to stop and if the bnxt driver is reset due to port stop all and port start all then when the bnxt driver comes up, the driver is overwriting the queue configuration to operationally started instead of stopping the queues that was previously stopped. The stopped queues were getting added to the rss context resulting in the packet drops.

Added a fix to address this issue, the rxq structure is not cleared during the stop and start process and retains the context, that flag is used to set the queue state. Thus stopped queues shall not be added to the rss context on recovery from a stop and start. The queues that were configured to be stopped have to explicitly started to see traffic on those queues.

---
 drivers/net/bnxt/bnxt_ethdev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +5 -3
index 4ed2bf2a1a..50bc0f1f9e 100644
@@ -925,11 +925,13 @@ static int bnxt_start_nic(struct bnxt *bp)
 	for (j = 0; j < bp->rx_nr_rings; j++) {
 		struct bnxt_rx_queue *rxq = bp->rx_queues[j];
 
+		__rte_assume(j < RTE_MAX_QUEUES_PER_PORT);
+		/* If not deferred start then change only the state of the */
+		/* queue based on the queue rx_started flag */
 		if (!rxq->rx_deferred_start) {
-			__rte_assume(j < RTE_MAX_QUEUES_PER_PORT);
-			bp->eth_dev->data->rx_queue_state[j] =
+			if (rxq->rx_started)
+				bp->eth_dev->data->rx_queue_state[j] =
 				RTE_ETH_QUEUE_STATE_STARTED;
-			rxq->rx_started = true;
 		}
 	}
 
Signature · 1 line
2.39.5 (Apple Git-154)
#261 lore raw

PATCH v5 46/57 net/bnxt/tf_core: backing store cleanup

In reply to Manish Kurup

From: Peter Spreadborough <[email protected]>

A backing store table allocation failed due to lack of memory and resulted in a crash because the result of the allocation was not checked for validity.

---
 drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c +2 -0
index b229f07596..878f62c115 100644
@@ -505,6 +505,8 @@ static int alloc_link_pbl(struct tfc_ts_mem_cfg *mem_cfg, uint32_t page_size,
 								RTE_MEMZONE_SIZE_HINT_ONLY |
 								RTE_MEMZONE_IOVA_CONTIG,
 								page_size);
+		if (!mem_cfg->ts_mz.mz)
+			return -ENOMEM;
 	}
 	memset(mem_cfg->ts_mz.mz->addr, 0, mem_cfg->ts_mz.mz->len);
 	mem_cfg->ts_mz.page_count = total_pages;
Signature · 1 line
2.39.5 (Apple Git-154)
#262 lore raw

PATCH v5 47/57 net/bnxt: truflow remove RTE devarg processing for mpc=1

In reply to Manish Kurup

From: Sangtani Parag Satishbhai <[email protected]>

Now as the mpc is initialized for P7 platform regardless of mpc=1 devarg, RTE and bnxt argument processing APIs for mpc devarg are redundant. This patch removes such RTE and bnxt APIs. The "mpc=1" devarg is now invalid and should not be used while launching an application.

Before:

     ./dpdk-testpmd -c 0xff -a 0000:0a:00.0,mpc=1,app-id=0
After:
     ./dpdk-testpmd -c 0xff -a 0000:0a:00.0,app-id=0
---
 drivers/net/bnxt/bnxt.h        |  3 ---
 drivers/net/bnxt/bnxt_ethdev.c | 19 ++++---------------
 2 files changed, 4 insertions(+), 18 deletions(-)
drivers/net/bnxt/bnxt.h +0 -3
index 90352d537c..83ae151066 100644
@@ -854,9 +854,6 @@ struct bnxt {
 	((bp)->flags2 & BNXT_FLAGS2_MULTIROOT_EN)
 
 #define	BNXT_FLAGS2_COMPRESSED_RX_CQE		BIT(5)
-#define	BNXT_FLAGS2_USE_MPC			BIT(6)
-#define BNXT_USE_MPC(bp)			\
-	((bp)->flags2 & BNXT_FLAGS2_USE_MPC)
 #define	BNXT_FLAGS2_REP_MODE			BIT(7)
 #define BNXT_REP_MODE_EN(bp)			\
 	((bp)->flags2 & BNXT_FLAGS2_REP_MODE)
drivers/net/bnxt/bnxt_ethdev.c +4 -15
index 50bc0f1f9e..7a2dd08951 100644
@@ -152,11 +152,6 @@ static const struct rte_eth_speed_lanes_capa speed_lanes_capa_tbl[] = {
  */
 #define BNXT_DEVARG_CQE_MODE_INVALID(val)		((val) > 1)
 
-/*
- * mpc = an non-negative 8-bit number
- */
-#define BNXT_DEVARG_MPC_INVALID(val)			((val) > 1)
-
 /*
  * app-id = an non-negative 8-bit number
  */
@@ -207,7 +202,6 @@ static const struct rte_eth_speed_lanes_capa speed_lanes_capa_tbl[] = {
 #define BNXT_DEVARG_REP_FC_F2R_INVALID(rep_fc_f2r)	((rep_fc_f2r) > 1)
 
 int bnxt_cfa_code_dynfield_offset = -1;
-unsigned long mpc;
 
 /*
  * max_num_kflows must be >= 32
@@ -1759,8 +1753,7 @@ static int bnxt_dev_stop(struct rte_eth_dev *eth_dev)
 	/* Process any remaining notifications in default completion queue */
 	bnxt_int_handler(eth_dev);
 
-	if (mpc != 0)
-		bnxt_mpc_close(bp);
+	bnxt_mpc_close(bp);
 
 	bnxt_shutdown_nic(bp);
 	bnxt_hwrm_if_change(bp, false);
@@ -1856,11 +1849,9 @@ int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
 	if (rc)
 		goto error;
 
-	if (mpc != 0) {
-		rc = bnxt_mpc_open(bp);
-		if (rc != 0)
-			PMD_DRV_LOG_LINE(DEBUG, "MPC open failed");
-	}
+	rc = bnxt_mpc_open(bp);
+	if (rc != 0)
+		PMD_DRV_LOG_LINE(DEBUG, "MPC open failed");
 
 	rc = bnxt_alloc_prev_ring_stats(bp);
 	if (rc)
@@ -7208,8 +7199,6 @@ static bool bnxt_enable_ulp(struct bnxt *bp)
 	/* not enabling ulp for cli and no truflow apps */
 	if (BNXT_TRUFLOW_EN(bp) && bp->app_id != 254 &&
 	    bp->app_id != 255) {
-		if (BNXT_CHIP_P7(bp) && !mpc)
-			return false;
 		return true;
 	}
 	return false;
Signature · 1 line
2.39.5 (Apple Git-154)
#263 lore raw

PATCH v5 48/57 net/bnxt: add meson build options for TruFlow

In reply to Manish Kurup

Add meson options for
1. TF template
2. TF feature bits

---
 meson_options.txt | 4 ++++
 1 file changed, 4 insertions(+)
meson_options.txt +4 -0
index e28d24054c..3354ef2b4f 100644
@@ -58,3 +58,7 @@ option('tests', type: 'boolean', value: true, description:
        'build unit tests')
 option('use_hpet', type: 'boolean', value: false, description:
        'use HPET timer in EAL')
+option('bnxt_tf_template', type: 'string', value: 'default', description:
+       'Truflow template selection')
+option('bnxt_tf_feat_bits', type: 'integer', value: 0, description:
+       'Truflow feature bits')
Signature · 1 line
2.39.5 (Apple Git-154)
#264 lore raw

Re: [PATCH v5 48/57] net/bnxt: add meson build options for TruFlow

29/10/2025 17:07, Manish Kurup:

meson_options.txt option('tests', type: 'boolean', value: true, description: · line 64

Quoted 11 lines

Add meson options for
1. TF template
2. TF feature bits

---

meson_options.txt +4 -0
+option('bnxt_tf_template', type: 'string', value: 'default', description:
+       'Truflow template selection')
+option('bnxt_tf_feat_bits', type: 'integer', value: 0, description:
+       'Truflow feature bits')

Ouch, I missed that. This file was not part of my regular checks. It is clearly not the direction taken for DPDK compilation these last years. We tend to simplify the compilation matrix.

Anyway bnxt_tf_feat_bits is not used in the driver compilation.

I copy here an abstract of the use of the other option in another patch:
"
if get_option('bnxt_tf_template').contains('app19')
includes += include_directories('app_19_templates') subdir('app_19_templates')
cflags += '-DBNXT_TF_APP_ID=19'
"

It is not documented, and the subdirectory is missing.

This whole thing looks very strange, so this patch is obiously rejected.

#265 lore raw

PATCH v5 49/57 net/bnxt: truflow HSI struct definition cleanup

In reply to Manish Kurup

Modify struct definitions in HSI to add __rte_packed_end

---
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/net/bnxt/hsi_struct_def_dpdk.h +13 -13
index 866fc5379d..06c61cba8f 100644
@@ -24521,7 +24521,7 @@ struct __rte_packed_begin ts_split_entries {
 	/* Indicates the region is locked in the cache */
 	uint8_t	locked;
 	uint32_t	rsvd2[2];
-} __rte_packed;
+} __rte_packed_end;
 
 /*
  * Common structure to cast crypto key split entries. This casting is
@@ -45077,7 +45077,7 @@ struct __rte_packed_begin hwrm_vnic_plcmodes_cfg_output {
 } __rte_packed_end;
 
 /* hwrm_vnic_plcmodes_cfg_cmd_err (size:64b/8B) */
-struct hwrm_vnic_plcmodes_cfg_cmd_err {
+struct __rte_packed_begin hwrm_vnic_plcmodes_cfg_cmd_err {
 	/*
 	 * command specific error codes that goes to
 	 * the cmd_err field in common HWRM Error Response.
@@ -45092,7 +45092,7 @@ struct hwrm_vnic_plcmodes_cfg_cmd_err {
 	#define HWRM_VNIC_PLCMODES_CFG_CMD_ERR_CODE_LAST \
 		HWRM_VNIC_PLCMODES_CFG_CMD_ERR_CODE_INVALID_HDS_THRESHOLD
 	uint8_t	unused_0[7];
-} __rte_packed;
+} __rte_packed_end;
 
 /***************************
  * hwrm_vnic_plcmodes_qcfg *
@@ -62717,7 +62717,7 @@ struct __rte_packed_begin hwrm_tfc_resc_usage_query_output {
 
 
 /* hwrm_tfc_tcam_pri_update_input (size:256b/32B) */
-struct hwrm_tfc_tcam_pri_update_input {
+struct __rte_packed_begin hwrm_tfc_tcam_pri_update_input {
 	/* The HWRM command request type. */
 	uint16_t	req_type;
 	/*
@@ -62794,10 +62794,10 @@ struct hwrm_tfc_tcam_pri_update_input {
 		HWRM_TFC_TCAM_PRI_UPDATE_INPUT_TRACK_TYPE_TRACK_TYPE_FID
 	/* unused. */
 	uint8_t	unused0[5];
-} __rte_packed;
+} __rte_packed_end;
 
 /* hwrm_tfc_tcam_pri_update_output (size:128b/16B) */
-struct hwrm_tfc_tcam_pri_update_output {
+struct __rte_packed_begin hwrm_tfc_tcam_pri_update_output {
 	/* The specific error status for the command. */
 	uint16_t	error_code;
 	/* The HWRM command request type. */
@@ -62817,7 +62817,7 @@ struct hwrm_tfc_tcam_pri_update_output {
 	 * to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __rte_packed;
+} __rte_packed_end;
 
 /********************************
  * hwrm_tfc_hot_upgrade_process *
@@ -62825,7 +62825,7 @@ struct hwrm_tfc_tcam_pri_update_output {
 
 
 /* hwrm_tfc_hot_upgrade_process_input (size:192b/24B) */
-struct hwrm_tfc_hot_upgrade_process_input {
+struct __rte_packed_begin hwrm_tfc_hot_upgrade_process_input {
 	/* The HWRM command request type. */
 	uint16_t	req_type;
 	/*
@@ -62887,10 +62887,10 @@ struct hwrm_tfc_hot_upgrade_process_input {
 	uint8_t	cur_session_cnt;
 	/* unused. */
 	uint8_t	unused0;
-} __rte_packed;
+} __rte_packed_end;
 
 /* hwrm_tfc_hot_upgrade_process_output (size:128b/16B) */
-struct hwrm_tfc_hot_upgrade_process_output {
+struct __rte_packed_begin hwrm_tfc_hot_upgrade_process_output {
 	/* The specific error status for the command. */
 	uint16_t	error_code;
 	/* The HWRM command request type. */
@@ -62912,7 +62912,7 @@ struct hwrm_tfc_hot_upgrade_process_output {
 	 * to be such that this field is written last.
 	 */
 	uint8_t	valid;
-} __rte_packed;
+} __rte_packed_end;
 
 /******************************
  * hwrm_tunnel_dst_port_query *
@@ -64280,7 +64280,7 @@ struct __rte_packed_begin pcie_ctx_hw_stats {
  * identical up to and including the pcie_recovery_histogram field.
  */
 /* pcie_ctx_hw_stats_v2 (size:4096b/512B) */
-struct pcie_ctx_hw_stats_v2 {
+struct __rte_packed_begin pcie_ctx_hw_stats_v2 {
 	/* Number of physical layer receiver errors */
 	uint64_t	pcie_pl_signal_integrity;
 	/* Number of DLLP CRC errors detected by Data Link Layer */
@@ -64385,7 +64385,7 @@ struct pcie_ctx_hw_stats_v2 {
 	uint64_t	pcie_blocked_packet_count;
 	/* The count of completion packets sent to the PCI-e. */
 	uint64_t	pcie_cmpl_packet_count;
-} __rte_packed;
+} __rte_packed_end;
 
 /****************************
  * hwrm_stat_generic_qstats *
Signature · 1 line
2.39.5 (Apple Git-154)
#266 lore raw

PATCH v5 50/57 net/bnxt/tf_ulp: truflow add pf action handler

In reply to Manish Kurup

From: Shahaji Bhosle <[email protected]>

Update pf action handler callback to use parent PF vnic

---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 42 ++++++++++++++++--------
 1 file changed, 28 insertions(+), 14 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +28 -14
index ceda1ff5ef..82baf722cd 100644
@@ -2946,30 +2946,44 @@ int32_t
 ulp_rte_pf_act_handler(const struct rte_flow_action *action_item __rte_unused,
 		       struct ulp_rte_parser_params *params)
 {
+	struct bnxt *bp;
 	uint32_t port_id;
-	uint32_t ifindex;
-	enum bnxt_ulp_intf_type intf_type;
+	enum bnxt_ulp_direction_type dir;
+	struct ulp_rte_act_prop *act = &params->act_prop;
 
 	/* Get the port id of the current device */
 	port_id = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_INCOMING_IF);
 
-	/* Get the port db ifindex */
-	if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx, port_id,
-					      &ifindex)) {
-		BNXT_DRV_DBG(ERR, "Invalid port id\n");
+	params->port_id = port_id;
+	bp = bnxt_pmd_get_bp(params->port_id);
+	if (bp == NULL) {
+		BNXT_DRV_DBG(ERR, "Invalid bp");
 		return BNXT_TF_RC_ERROR;
 	}
 
-	/* Check the port is PF port */
-	intf_type = ulp_port_db_port_type_get(params->ulp_ctx, ifindex);
-	if (intf_type != BNXT_ULP_INTF_TYPE_PF) {
-		BNXT_DRV_DBG(ERR, "Port is not a PF port\n");
+	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_PORT_TYPE, BNXT_ULP_INTF_TYPE_PF);
+
+	/* Get the direction */
+	dir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);
+	if (dir == BNXT_ULP_DIR_EGRESS) {
+		BNXT_DRV_DBG(ERR, "Invalid direction");
 		return BNXT_TF_RC_ERROR;
+	} else {
+		uint16_t pid_s = bp->parent->vnic;
+		uint32_t pid = pid_s;
+		pid = rte_cpu_to_be_32(pid);
+		memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_VNIC],
+		       &pid, BNXT_ULP_ACT_PROP_SZ_VNIC);
+		/*
+		 * Update appropriate port (A/B) VNIC based on multi-port
+		 * indication.
+		 */
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_MP_VNIC_A, pid_s);
 	}
-	/* Update the action properties */
-	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_PORT_TYPE, intf_type);
-	return ulp_rte_parser_act_port_set(params, ifindex, false,
-					   BNXT_ULP_DIR_INVALID);
+
+	/* Update the action port set bit */
+	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_PORT_IS_SET, 1);
+	return BNXT_TF_RC_SUCCESS;
 }
 
 /* Function to handle the parsing of RTE Flow action VF. */
Signature · 1 line
2.39.5 (Apple Git-154)
#267 lore raw

PATCH v5 51/57 net/bnxt/tf_ulp: add support for unicast only feature

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

Added support for unicast only feature bit in the truflow application. This enables the application to not receive broadcast, multicast or unknown mac addresses to the ports that are participating in the application.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c          | 5 +++++
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c         | 5 +++++
 drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h       | 2 ++
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c        | 3 ---
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h | 3 ++-
 5 files changed, 14 insertions(+), 4 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c +5 -0
index 54a5e6968c..d2d97d9cf0 100644
@@ -475,6 +475,11 @@ ulp_tf_cntxt_app_caps_init(struct bnxt *bp,
 					      &ulp_ctx->cfg_data->feature_bits))
 			return -EINVAL;
 
+		if ((ulp_ctx->cfg_data->feature_bits &
+		     BNXT_ULP_FEATURE_BIT_UNICAST_ONLY))
+			ulp_ctx->cfg_data->ulp_flags |=
+			BNXT_ULP_APP_UNICAST_ONLY;
+
 		bnxt_ulp_cntxt_ptr2_default_class_bits_set(ulp_ctx,
 							   info[i].default_class_bits);
 		bnxt_ulp_cntxt_ptr2_default_act_bits_set(ulp_ctx,
drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c +5 -0
index 772dd69035..ad44ec93ca 100644
@@ -562,6 +562,11 @@ ulp_tfc_cntxt_app_caps_init(struct bnxt *bp, uint8_t app_id, uint32_t dev_id)
 					      &ulp_ctx->cfg_data->feature_bits))
 			return -EINVAL;
 
+		if ((ulp_ctx->cfg_data->feature_bits &
+		     BNXT_ULP_FEATURE_BIT_UNICAST_ONLY))
+			ulp_ctx->cfg_data->ulp_flags |=
+			BNXT_ULP_APP_UNICAST_ONLY;
+
 		bnxt_ulp_default_app_priority_set(ulp_ctx,
 						  info[i].default_priority);
 		bnxt_ulp_max_def_priority_set(ulp_ctx,
drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h +2 -0
index 14ee1e05fb..84d0315399 100644
@@ -1066,6 +1066,8 @@ bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits)
 		BNXT_DRV_DBG(ERR, "Socket Direct Feature is enabled");
 	if (bit & BNXT_ULP_FEATURE_BIT_NON_VFR_MODE)
 		BNXT_DRV_DBG(ERR, "Non VFR Feature is enabled");
+	if (bit & BNXT_ULP_FEATURE_BIT_UNICAST_ONLY)
+		BNXT_DRV_DBG(ERR, "Unicast only Feature is enabled");
 
 	*out_bits =  bit;
 	return 0;
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +0 -3
index 30cd944362..4d96882087 100644
@@ -829,9 +829,6 @@ bnxt_ulp_promisc_mode_set(struct bnxt *bp, uint8_t enable)
 	    !bp->ulp_ctx)
 		return rc;
 
-	if (!BNXT_CHIP_P5(bp))
-		return rc;
-
 	port_id = bp->eth_dev->data->port_id;
 	info = &bp->ulp_ctx->cfg_data->df_rule_info[port_id];
 
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +2 -1
index d63862ffba..4e9b11e437 100644
@@ -914,7 +914,8 @@ enum bnxt_ulp_feature_bit {
 	BNXT_ULP_FEATURE_BIT_SPECIAL_VXLAN = 0x00000020,
 	BNXT_ULP_FEATURE_BIT_HOT_UPGRADE = 0x00000040,
 	BNXT_ULP_FEATURE_BIT_GLOBAL_TBL_SCOPE = 0x00000080,
-	BNXT_ULP_FEATURE_BIT_NON_VFR_MODE = 0x00000100
+	BNXT_ULP_FEATURE_BIT_NON_VFR_MODE = 0x00000100,
+	BNXT_ULP_FEATURE_BIT_UNICAST_ONLY = 0x00000200
 };
 
 enum bnxt_ulp_flow_dir_bitmask {
Signature · 1 line
2.39.5 (Apple Git-154)
#268 lore raw

PATCH v5 52/57 net/bnxt/tf_core: remove excessive debug logging

In reply to Manish Kurup

From: Peter Spreadborough <[email protected]>

This change removes a debug message of questionable usefulness that can spam the terminal if more than 5K flows are created.

---
 drivers/net/bnxt/tf_core/v3/tfc_em.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/net/bnxt/tf_core/v3/tfc_em.c +1 -7
index 47870747e1..3fe4dbe3fe 100644
@@ -1012,13 +1012,7 @@ int tfc_mpc_batch_end(struct tfc *tfcp,
 
 			count--;
 
-			if (j != start_index) {
-				PMD_DRV_LOG_LINE(INFO,
-						 "%s: OOO comp. Opq Exp:%d Got:%d j:%d",
-						 __func__,
-						 batch_info->comp_info[j].opaque,
-						 opaque, j);
-			} else {
+			if (j == start_index) {
 				start_index++;
 
 				while (count &&
Signature · 1 line
2.39.5 (Apple Git-154)
#269 lore raw

PATCH v5 53/57 net/bnxt/tf_core: truflow SR-IOV PF init cleanup

In reply to Manish Kurup

From: Farah Smith <[email protected]>

When running DPDK on PFs with SR-IOV disabled, correct the "invalid max VF check" during table scope creation.

---
 drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c +2 -10
index 878f62c115..c06099af12 100644
@@ -1210,7 +1210,8 @@ int tfc_tbl_scope_mem_alloc(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
 				return rc;
 
 			if (fid > max_vf) {
-				PMD_DRV_LOG_LINE(ERR, "fid out of range %d", fid);
+				PMD_DRV_LOG_LINE(ERR, "%s fid out of range %d",
+						 __func__, fid);
 				return -EINVAL;
 			}
 
@@ -1419,16 +1420,7 @@ int tfc_tbl_scope_mem_free(struct tfc *tfcp, uint16_t fid, uint8_t tsid,
 	}
 	if (scope_type != CFA_SCOPE_TYPE_NON_SHARED && is_pf) {
 		uint16_t pool_cnt;
-		uint16_t max_vf;
 
-		rc = tfc_bp_vf_max(tfcp, &max_vf);
-		if (rc)
-			return rc;
-
-		if (fid > max_vf) {
-			PMD_DRV_LOG_LINE(ERR, "invalid fid 0x%x", fid);
-			return -EINVAL;
-		}
 		rc = tbl_scope_tpm_fid_rem(tfcp, fid, tsid, &pool_cnt);
 		if (rc) {
 			PMD_DRV_LOG_LINE(ERR, "error getting tsid(%d) pools status %s",
Signature · 1 line
2.39.5 (Apple Git-154)
#270 lore raw

PATCH v5 54/57 net/bnxt/tf_ulp: TF functionality additions

In reply to Manish Kurup

1. Correct RTE_ACTION last item

---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +1 -1
index 82baf722cd..26823858b5 100644
@@ -211,7 +211,7 @@ bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[],
 			hdr_info = &ulp_vendor_act_info[action_item->type -
 				BNXT_RTE_FLOW_ACTION_TYPE_END];
 		} else {
-			if (action_item->type > RTE_FLOW_ACTION_TYPE_INDIRECT)
+			if (action_item->type > RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT)
 				goto act_parser_error;
 			/* get the header information from the act info table */
 			hdr_info = &ulp_act_info[action_item->type];
Signature · 1 line
2.39.5 (Apple Git-154)
#271 lore raw

PATCH v5 55/57 net/bnxt/tf_ulp: add feature bit rx miss handling

In reply to Manish Kurup

From: Shahaji Bhosle <[email protected]>

Added a new feature bit to all applications to send the miss packets to parent PF.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h       | 9 ++++++++-
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h | 4 +++-
 2 files changed, 11 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h +8 -1
index 84d0315399..bd160e2db9 100644
@@ -1039,11 +1039,16 @@ bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits)
 	uint64_t bit = 0;
 #endif
 	*out_bits = 0;
+
 	if ((feat_bits | bit) != feat_bits) {
 		BNXT_DRV_DBG(ERR, "Invalid TF feature bit is set %" PRIu64 "\n",
 			     bit);
 		return -EINVAL;
 	}
+
+	if (!bit)
+		return 0;
+
 	if ((bit & BNXT_ULP_FEATURE_BIT_PARENT_DMAC) &&
 	    (bit & BNXT_ULP_FEATURE_BIT_PORT_DMAC)) {
 		BNXT_DRV_DBG(ERR, "Invalid both Port and Parent Mac set\n");
@@ -1068,8 +1073,10 @@ bnxt_ulp_cap_feat_process(uint64_t feat_bits, uint64_t *out_bits)
 		BNXT_DRV_DBG(ERR, "Non VFR Feature is enabled");
 	if (bit & BNXT_ULP_FEATURE_BIT_UNICAST_ONLY)
 		BNXT_DRV_DBG(ERR, "Unicast only Feature is enabled");
-
+	if (bit & BNXT_ULP_FEATURE_BIT_RX_MISS_SEND_TO_PF)
+		BNXT_DRV_DBG(ERR, "Rx miss send to parent PF Feature is enabled");
 	*out_bits =  bit;
+
 	return 0;
 }
 
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +3 -1
index 4e9b11e437..6a2d31cf8d 100644
@@ -915,7 +915,9 @@ enum bnxt_ulp_feature_bit {
 	BNXT_ULP_FEATURE_BIT_HOT_UPGRADE = 0x00000040,
 	BNXT_ULP_FEATURE_BIT_GLOBAL_TBL_SCOPE = 0x00000080,
 	BNXT_ULP_FEATURE_BIT_NON_VFR_MODE = 0x00000100,
-	BNXT_ULP_FEATURE_BIT_UNICAST_ONLY = 0x00000200
+	BNXT_ULP_FEATURE_BIT_UNICAST_ONLY = 0x00000200,
+	BNXT_ULP_FEATURE_BIT_REDIRECT_ONLY = 0x00000400,
+	BNXT_ULP_FEATURE_BIT_RX_MISS_SEND_TO_PF = 0x00000800
 };
 
 enum bnxt_ulp_flow_dir_bitmask {
Signature · 1 line
2.39.5 (Apple Git-154)
#272 lore raw

PATCH v5 56/57 net/bnxt: add support for truflow promiscuous mode

In reply to Manish Kurup

From: Kishore Padmanabha <[email protected]>

The truflow application support promiscuous mode to enable or disable receiving the packets with unknown destination mac addresses.

---
 drivers/net/bnxt/bnxt_ethdev.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +13 -2
index 7a2dd08951..3c618c6e82 100644
@@ -2161,9 +2161,15 @@ static int bnxt_promiscuous_enable_op(struct rte_eth_dev *eth_dev)
 	old_flags = vnic->flags;
 	vnic->flags |= BNXT_VNIC_INFO_PROMISC;
 	rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);
-	if (rc != 0)
+	if (rc != 0) {
 		vnic->flags = old_flags;
-
+		return rc;
+	}
+	rc = bnxt_ulp_promisc_mode_set(bp, 1);
+	if (rc != 0) {
+		vnic->flags = old_flags;
+		rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL);
+	}
 	return rc;
 }
 
@@ -2185,6 +2191,11 @@ static int bnxt_promiscuous_disable_op(struct rte_eth_dev *eth_dev)
 	if (bp->vnic_info == NULL)
 		return 0;
 
+	if (bnxt_ulp_promisc_mode_set(bp, 0)) {
+		PMD_DRV_LOG_LINE(ERR, "Unable to disable promiscuous mode");
+		return -EINVAL;
+	}
+
 	vnic = bnxt_get_default_vnic(bp);
 
 	old_flags = vnic->flags;
Signature · 1 line
2.39.5 (Apple Git-154)
#273 lore raw

PATCH v5 57/57 net/bnxt/tf_ulp: remove Truflow DEBUG code

In reply to Manish Kurup

This commit cleans up TruFlow debug/non-production prints

---
 drivers/net/bnxt/bnxt_hwrm.c               | 23 -------
 drivers/net/bnxt/tf_ulp/bnxt_tf_common.h   |  5 --
 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c |  6 --
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c      |  5 --
 drivers/net/bnxt/tf_ulp/ulp_alloc_tbl.c    |  4 --
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c    |  6 --
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c      |  6 --
 drivers/net/bnxt/tf_ulp/ulp_mapper.c       | 38 ------------
 drivers/net/bnxt/tf_ulp/ulp_mapper_tf.c    | 71 ----------------------
 drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c   | 71 ----------------------
 drivers/net/bnxt/tf_ulp/ulp_matcher.c      |  9 ---
 11 files changed, 244 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +0 -23
index 939f35e3da..4d693da1d5 100644
@@ -2868,29 +2868,6 @@ static uint32_t bnxt_sanitize_rss_type(struct bnxt *bp, uint32_t types)
 	return hwrm_type;
 }
 
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-static int
-bnxt_hwrm_vnic_rss_qcfg_p5(struct bnxt *bp)
-{
-	struct hwrm_vnic_rss_qcfg_output *resp = bp->hwrm_cmd_resp_addr;
-	struct hwrm_vnic_rss_qcfg_input req = {0};
-	int rc;
-
-	HWRM_PREP(&req, HWRM_VNIC_RSS_QCFG, BNXT_USE_CHIMP_MB);
-	/* vnic_id and rss_ctx_idx must be set to INVALID to read the
-	 * global hash mode.
-	 */
-	req.vnic_id = rte_cpu_to_le_16(BNXT_DFLT_VNIC_ID_INVALID);
-	req.rss_ctx_idx = rte_cpu_to_le_16(BNXT_RSS_CTX_IDX_INVALID);
-	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req),
-				    BNXT_USE_CHIMP_MB);
-	HWRM_CHECK_RESULT();
-	HWRM_UNLOCK();
-	PMD_DRV_LOG_LINE(DEBUG, "RSS QCFG: Hash level %d", resp->hash_mode_flags);
-
-	return rc;
-}
-#endif
 
 static int
 bnxt_hwrm_vnic_rss_cfg_p5(struct bnxt *bp, struct bnxt_vnic_info *vnic)
drivers/net/bnxt/tf_ulp/bnxt_tf_common.h +0 -5
index 7fc70a3603..8e487d9a0e 100644
@@ -14,11 +14,6 @@
 #define BNXT_DRV_DBG(lvl, fmt, ...) \
 	RTE_LOG(lvl, BNXT, "%s(): " fmt, __func__, ## __VA_ARGS__)
 
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#define BNXT_DRV_INF(fmt, ...)	RTE_LOG(INFO, fmt, ## __VA_ARGS__)
-#else
-#define BNXT_DRV_INF(fmt, ...)
-#endif
 
 #define BNXT_ULP_EM_FLOWS			8192
 #define BNXT_ULP_1M_FLOWS			1000000
drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c +0 -6
index 5854f13447..bfd5f4b230 100644
@@ -16,9 +16,6 @@
 #include "bnxt_hwrm.h"
 #include "bnxt_tf_common.h"
 #include "bnxt_tf_pmd_shim.h"
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#include "ulp_template_debug_proto.h"
-#endif
 
 
 int
@@ -617,9 +614,6 @@ bnxt_pmd_global_tunnel_set(struct bnxt_ulp_context *ulp_ctx,
 			    port_id, rc);
 		return rc;
 	}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-	ulp_mapper_global_register_tbl_dump(type, udp_port);
-#endif
 	if (udp_port)
 		bnxt_pmd_global_reg_data_to_hndl(port_id, lupar_id,
 						 type, udp_port, handle);
drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c +0 -5
index d2d97d9cf0..38cb5c8b31 100644
@@ -948,11 +948,6 @@ ulp_tf_eem_tbl_scope_init(struct bnxt *bp)
 		return rc;
 	}
 
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-	BNXT_DRV_DBG(DEBUG, "TableScope=0x%0x %d\n",
-		     params.tbl_scope_id,
-		     params.tbl_scope_id);
-#endif
 
 	rc = bnxt_ulp_cntxt_tbl_scope_id_set(bp->ulp_ctx, params.tbl_scope_id);
 	if (rc) {
drivers/net/bnxt/tf_ulp/ulp_alloc_tbl.c +0 -4
index f09d072ef3..ac83e42514 100644
@@ -10,10 +10,6 @@
 #include "ulp_alloc_tbl.h"
 #include "bnxt_ulp_utils.h"
 
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#include "ulp_template_debug_proto.h"
-#include "ulp_tf_debug.h"
-#endif
 
 /* Retrieve the allocator table  initialization parameters for the tbl_idx */
 static const struct bnxt_ulp_allocator_tbl_params*
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +0 -6
index 4d96882087..8ff3c24993 100644
@@ -960,12 +960,6 @@ bnxt_ulp_grp_miss_act_set(struct rte_eth_dev *dev,
 	/* Perform the rte flow post process */
 	bnxt_ulp_rte_parser_post_process(&params);
 
-#ifdef	RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef	RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_PARSER
-	/* Dump the rte flow action */
-	ulp_parser_act_info_dump(&params);
-#endif
-#endif
 
 	ret = ulp_matcher_action_match(&params, &params.act_tmpl);
 	if (unlikely(ret != BNXT_TF_RC_SUCCESS))
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +0 -6
index 46f5a96baf..57f11d02ae 100644
@@ -532,9 +532,6 @@ ulp_flow_db_fid_alloc(struct bnxt_ulp_context *ulp_ctxt,
 	if (flow_type == BNXT_ULP_FDB_TYPE_REGULAR)
 		ulp_flow_db_func_id_set(flow_db, *fid, func_id);
 
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-	BNXT_DRV_DBG(DEBUG, "flow_id = %u:%u allocated\n", flow_type, *fid);
-#endif
 	/* return success */
 	return 0;
 }
@@ -805,9 +802,6 @@ ulp_flow_db_fid_free(struct bnxt_ulp_context *ulp_ctxt,
 	if (flow_type == BNXT_ULP_FDB_TYPE_REGULAR)
 		ulp_flow_db_func_id_set(flow_db, fid, 0);
 
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-	BNXT_DRV_DBG(DEBUG, "flow_id = %u:%u freed\n", flow_type, fid);
-#endif
 	/* all good, return success */
 	return 0;
 }
drivers/net/bnxt/tf_ulp/ulp_mapper.c +0 -38
index 9cda3b355b..0ff952950b 100644
@@ -653,12 +653,6 @@ ulp_mapper_priority_opc_process(struct bnxt_ulp_mapper_parms *parms,
 		rc = -EINVAL;
 		break;
 	}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
-	if (!rc)
-		BNXT_DRV_DBG(DEBUG, "Tcam priority = 0x%x\n", *priority);
-#endif
-#endif
 	return rc;
 }
 
@@ -1504,13 +1498,6 @@ ulp_mapper_key_recipe_alloc(struct bnxt_ulp_context *ulp_ctx,
 			BNXT_DRV_DBG(ERR, "Unable to alloc key recipe\n");
 			return NULL;
 		}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
-	BNXT_DRV_INF("Alloc key recipe [%s]:[%s] = 0x%X\n",
-		     (dir == BNXT_ULP_DIRECTION_INGRESS) ? "rx" : "tx",
-		     ulp_mapper_key_recipe_type_to_str(stype), recipe_id);
-#endif
-#endif
 	} else if (alloc_only) {
 		BNXT_DRV_DBG(ERR, "Recipe ID (%d) already allocated\n",
 			     recipe_id);
@@ -1554,13 +1541,6 @@ ulp_mapper_key_recipe_free(struct bnxt_ulp_context *ulp_ctx,
 	}
 	rte_free(recipes[index]);
 	recipes[index] = NULL;
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
-	BNXT_DRV_INF("Free key recipe [%s]:[%s] = 0x%X\n",
-		     (dir == BNXT_ULP_DIRECTION_INGRESS) ? "rx" : "tx",
-		     ulp_mapper_key_recipe_type_to_str(stype), index);
-#endif
-#endif
 	return 0;
 }
 
@@ -1768,13 +1748,6 @@ ulp_mapper_key_recipe_field_opc_process(struct bnxt_ulp_mapper_parms *parms,
 			}
 		}
 	}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
-	if (*written && is_key)
-		BNXT_DRV_DBG(DEBUG, "%-20s bits = %-3d\n", fld->description,
-			     fld->field_bit_size);
-#endif
-#endif
 	return rc;
 }
 
@@ -3064,11 +3037,6 @@ ulp_mapper_stats_cache_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 			     rc);
 		return rc;
 	}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
-	BNXT_DRV_DBG(DEBUG, "flow id =0x%x\n", parms->flow_id);
-#endif
-#endif
 	return rc;
 }
 
@@ -4039,12 +4007,6 @@ ulp_mapper_func_info_process(struct bnxt_ulp_mapper_parms *parms,
 			     func_info->func_dst_opr);
 		return -EINVAL;
 	}
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG_MAPPER
-	BNXT_DRV_DBG(DEBUG, "write the %" PRIX64 " into func_opc %u\n", res,
-		     func_info->func_dst_opr);
-#endif
-#endif
 
 	return rc;
 }
drivers/net/bnxt/tf_ulp/ulp_mapper_tf.c +0 -71

149 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c +0 -71

143 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_matcher.c +0 -9
index 4b2e185278..f739cdf2a3 100644
@@ -225,12 +225,6 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
 
 error:
 	BNXT_DRV_DBG(DEBUG, "Did not find any matching template\n");
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-	BNXT_DRV_DBG(DEBUG,
-		     "hid:%x,Hdr:%" PRIX64 " Fld:%" PRIX64 " SFl:%" PRIX64 "\n",
-		     class_match_idx, params->hdr_bitmap.bits,
-		     params->fld_bitmap.bits, params->fld_s_bitmap.bits);
-#endif
 	*class_id = 0;
 	return BNXT_TF_RC_ERROR;
 }
@@ -326,9 +320,6 @@ ulp_matcher_action_match(struct ulp_rte_parser_params *params,
 	return BNXT_TF_RC_SUCCESS;
 error:
 	BNXT_DRV_DBG(DEBUG, "Did not find any matching action template\n");
-#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
-	BNXT_DRV_DBG(DEBUG, "Hdr:%" PRIX64 "\n", params->act_bitmap.bits);
-#endif
 	*act_id = 0;
 	return BNXT_TF_RC_ERROR;
 }
Signature · 1 line
2.39.5 (Apple Git-154)
#274 lore raw
In reply to Manish Kurup
Quoted 32 lines · Manish Kurup

Apart from bug fixes, this patchset adds the following functionality:

1. Add the data, defines and enums for applications targeting Wh+, P5, P7 product families.
2. Update HSI files (HWRM API defintions, enums, version number)
3. Dynamic UPAR support for THOR2.
4. Add support to allow multiple instances of applications to exist at the same time.
5. Add hot upgrade support for applications.
6. Add MPLS packet offload support.
7. Improve backing store debug capabilities.
8. Add truflow global table scope support.
9. ULP parser support to handle GRE key.

v1->v2:
1. Fixed typos in commit messages
2. Removed incorrect tabs in meson.build
3. Fixed ENODATA return value for BSD
4. Removed unused function bnxt_mpc_bds_in_hw()
5. Fixed questionable pointer cast warning
6. Ignoring function argument mispelling warnings

v2->v3:
1. Fixed all sprintf format string warnings.
2. Fixed additional pointer size warnings.

v3->v4:
1. Fixed additional pointer size warnings.
2. Split bnxt platform specific app data into multiple commits.

Quoted 6 lines

v4->v5:
1. Overall patch cleanup consisting of many small aesthetic changes (commit logs).
2. Fixed a "macro unused argument" warning.

Please apply.

Patchset merged to dpdk-next-net-brcm repo. Thanks

Quoted 182 lines

Farah Smith (8):
net/bnxt/tf_core: thor2 TF table scope sizing adjustments net/bnxt/tf_core: tcam manager logical id free net/bnxt/tf_core: thor2 hot upgrade ungraceful quit crash net/bnxt/tf_core: truflow global table scope net/bnxt/tf_ulp: socket direct enable
net/bnxt: Correctly account for udp_tunnel_ports net/bnxt: thor2 truflow memory manager bug net/bnxt/tf_core: truflow SR-IOV PF init cleanup

Jay Ding (4):
net/bnxt: bnxt_rep functions cleanup net/bnxt/tf_ulp: add meter stats support for Thor2 net/bnxt/tf_core: cleanup lkup table pool calculations next/bnxt/tf_ulp: meter and mac_addr cache cleanup

Kishore Padmanabha (18):
net/bnxt: enable vector mode processing net/bnxt/tf_ulp: add support for global identifiers net/bnxt/tf_core: add support for multi instance net/bnxt/tf_core: table scope free cleanup net/bnxt/tf_core: VFR cleanup and stats lockup handling net/bnxt/tf_ulp: increase shared pool size to 32 net/bnxt/tf_ulp: add support for tcam priority update net/bnxt/tf_ulp: hot upgrade support net/bnxt/tf_ulp: stats counter memory cleanup net/bnxt: Cleanup max VF calculation for thor2 net/bnxt/tf_ulp: enable support for global index table net/bnxt/tf_ulp: optimize template enums net/bnxt/tf_ulp: add non vfr mode capability net/bnxt: Skip stats collection when rx queue inactive net/bnxt: additional rss configuration cleanup net/bnxt: packet drop after port stop and start net/bnxt/tf_ulp: add support for unicast only feature net/bnxt: add support for truflow promiscuous mode

Manish Kurup (9):
net/bnxt/tf_ulp: add bnxt platform data for 25.11 net/bnxt/tf_ulp: add bnxt app data for 25.11 for Wh+ net/bnxt/tf_ulp: add bnxt app data for 25.11 - Thor net/bnxt/tf_ulp: add bnxt app data for 25.11 - Thor2 net/bnxt/tf_core: dynamic UPAR support for THOR2 net/bnxt: add meson build options for TruFlow net/bnxt: truflow HSI struct definition cleanup net/bnxt/tf_ulp: TF functionality additions net/bnxt/tf_ulp: remove Truflow DEBUG code

Peter Spreadborough (6):
net/bnxt/tf_ulp: ovs-dpdk packet drop observed with thor2 net/bnxt/tf_core: add backing store debug to dpdk net/bnxt/tf_core: handle out of order MPC completions net/bnxt: avoid potential segfault in VFR handling net/bnxt/tf_core: backing store cleanup net/bnxt/tf_core: remove excessive debug logging

Sangtani Parag Satishbhai (3):
net/bnxt/tf_ulp: Cleanup devargs argument parsing code net/bnxt: truflow remove redundant code for mpc init net/bnxt: truflow remove RTE devarg processing for mpc=1

Shahaji Bhosle (4):
net/bnxt/tf_ulp: ulp parser support to handle gre key net/bnxt/tf_ulp: change rte_mem_virt2iova to rte_mem_virt2phys net/bnxt/tf_ulp: truflow add pf action handler net/bnxt/tf_ulp: add feature bit rx miss handling

Shuanglin Wang (2):
net/bnxt/tf_core: Cleanup flow scale option build flags net/bnxt/tf_ulp: support MPLS packets

Smitha Pisupati (1):
net/bnxt/tf_ulp: add support for special vxlan

Sriharsha Basavapatna (2):
net/bnxt: cleanup default rss config
net/bnxt: avoid iova range check when external memory is used

 drivers/net/bnxt/bnxt.h                       |     7 +
 drivers/net/bnxt/bnxt_ethdev.c                |   256 +-
 drivers/net/bnxt/bnxt_hwrm.c                  |    25 +-
 drivers/net/bnxt/bnxt_mpc.c                   |    26 +-
 drivers/net/bnxt/bnxt_mpc.h                   |     7 +-
 drivers/net/bnxt/bnxt_reps.c                  |    37 +-
 drivers/net/bnxt/bnxt_stats.c                 |     5 +
 drivers/net/bnxt/bnxt_txr.c                   |     5 +-
 drivers/net/bnxt/bnxt_vnic.c                  |    21 +-
 .../bnxt/hcapi/cfa_v3/include/cfa_resources.h |    33 +-
 .../net/bnxt/hcapi/cfa_v3/include/cfa_types.h |    10 +
 drivers/net/bnxt/hcapi/cfa_v3/mm/cfa_mm.c     |    83 +-
 .../net/bnxt/hcapi/cfa_v3/mm/cfa_mm_priv.h    |     2 +-
 drivers/net/bnxt/hsi_struct_def_dpdk.h        |  1123 +-
 drivers/net/bnxt/tf_core/cfa_tcam_mgr.c       |    35 +-
 .../net/bnxt/tf_core/cfa_tcam_mgr_device.h    |     6 +-
 drivers/net/bnxt/tf_core/cfa_tcam_mgr_p4.c    |     2 +-
 drivers/net/bnxt/tf_core/cfa_tcam_mgr_p58.c   |     2 +-
 drivers/net/bnxt/tf_core/tf_resources.c       |     2 +-
 drivers/net/bnxt/tf_core/tf_util.c            |     2 +
 drivers/net/bnxt/tf_core/v3/meson.build       |     4 +-
 drivers/net/bnxt/tf_core/v3/tfc.h             |   238 +-
 drivers/net/bnxt/tf_core/v3/tfc_act.c         |    47 +-
 drivers/net/bnxt/tf_core/v3/tfc_cpm.c         |    13 +
 drivers/net/bnxt/tf_core/v3/tfc_debug.h       |    12 +-
 drivers/net/bnxt/tf_core/v3/tfc_em.c          |   143 +-
 drivers/net/bnxt/tf_core/v3/tfc_em.h          |   105 +-
 drivers/net/bnxt/tf_core/v3/tfc_global_id.c   |    45 +-
 drivers/net/bnxt/tf_core/v3/tfc_hot_upgrade.c |   142 +
 drivers/net/bnxt/tf_core/v3/tfc_idx_tbl.c     |    51 +-
 drivers/net/bnxt/tf_core/v3/tfc_mpc_debug.c   |  1411 +
 drivers/net/bnxt/tf_core/v3/tfc_mpc_table.c   |   565 -
 drivers/net/bnxt/tf_core/v3/tfc_msg.c         |   363 +-
 drivers/net/bnxt/tf_core/v3/tfc_msg.h         |    41 +-
 drivers/net/bnxt/tf_core/v3/tfc_resources.c   |    12 +-
 drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c   |   246 +-
 drivers/net/bnxt/tf_core/v3/tfc_tcam.c        |    55 +
 drivers/net/bnxt/tf_core/v3/tfc_tcam_debug.c  |  1875 +
 drivers/net/bnxt/tf_core/v3/tfc_util.c        |    23 +
 drivers/net/bnxt/tf_core/v3/tfc_util.h        |    14 +
 drivers/net/bnxt/tf_core/v3/tfc_vf2pf_msg.c   |     3 +-
 drivers/net/bnxt/tf_core/v3/tfc_vf2pf_msg.h   |     4 +-
 drivers/net/bnxt/tf_core/v3/tfo.c             |   211 +-
 drivers/net/bnxt/tf_core/v3/tfo.h             |    53 +-
 drivers/net/bnxt/tf_ulp/bnxt_tf_common.h      |     5 -
 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c    |     6 -
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |     6 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |    10 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c      |    55 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c         |    27 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c        |   147 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.h        |     5 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_utils.h      |    82 +-
 .../generic_templates/ulp_template_db_act.c   |     6 +-
 .../generic_templates/ulp_template_db_class.c |  8808 ++--
 .../generic_templates/ulp_template_db_defs.h  |    88 +
 .../generic_templates/ulp_template_db_field.h |     5 +-
 .../generic_templates/ulp_template_db_tbl.c   |   267 +-
 .../ulp_template_db_thor2_act.c               |  4637 +-
 .../ulp_template_db_thor2_class.c             | 42439 +++++++++-------
 .../ulp_template_db_thor_act.c                |    14 +-
 .../ulp_template_db_thor_class.c              | 13247 ++---
 .../ulp_template_db_wh_plus_act.c             |     2 +-
 .../ulp_template_db_wh_plus_class.c           |    26 +-
 drivers/net/bnxt/tf_ulp/meson.build           |    56 +-
 drivers/net/bnxt/tf_ulp/ulp_alloc_tbl.c       |     4 -
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       |    38 +-
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c          |    50 +-
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h          |    11 +
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr_tf.c       |     3 +-
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr_tfc.c      |    64 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |    10 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h         |     6 +
 drivers/net/bnxt/tf_ulp/ulp_gen_hash.c        |     2 +-
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c         |    24 +
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h         |    12 +
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |   326 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |    56 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper_tf.c       |    81 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c      |   347 +-
 drivers/net/bnxt/tf_ulp/ulp_matcher.c         |     9 -
 drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c |     8 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |   141 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |    10 +
 drivers/net/bnxt/tf_ulp/ulp_sc_mgr.c          |   137 +-
 drivers/net/bnxt/tf_ulp/ulp_sc_mgr.h          |     4 +-
 drivers/net/bnxt/tf_ulp/ulp_sc_mgr_tfc.c      |     1 -
 .../ulp_template_db_enum.h                    |   333 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |     5 +
 drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.c      |   264 +
 drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.h      |    40 +
 meson_options.txt                             |     4 +
 92 files changed, 48710 insertions(+), 30583 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/v3/tfc_hot_upgrade.c
 create mode 100644 drivers/net/bnxt/tf_core/v3/tfc_mpc_debug.c
 delete mode 100644 drivers/net/bnxt/tf_core/v3/tfc_mpc_table.c
 create mode 100644 drivers/net/bnxt/tf_core/v3/tfc_tcam_debug.c
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_defs.h
 rename drivers/net/bnxt/tf_ulp/{generic_templates => }/ulp_template_db_enum.h (88%)
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_tfc_ha_mgr.h

--
2.39.5 (Apple Git-154)