Skip to contentSkip to conversation

enhancements to host based flow table management

PATCH New Venkat Duvvuru 3 participants 129 messages May 30, 2021 – Jul 8, 2021 Page 3 of 4

Subsystems (3)
lore
Share & tools
lore
#76 lore raw

PATCH v2 14/58 net/bnxt: add shared session support

In reply to Ajit Khaparde

From: Jay Ding <[email protected]>

There are 2 types of sessions - shared and non-shared. For non-shared all the allocated resources are owned and managed by a single session instance. No other applications have access to the resources owned by the non-shared session. For a shared session, resources are shared between 2 applications.

The FW shared session can only be created by one application and shared by other apps. The host session that creates the FW shared session is the creator.

Applications can retrieve the reserved resources through a new API tf_get_session_resc_info.

Each module supports two sessions, one is shared session, the other is non-shared session.

---
 drivers/net/bnxt/hsi_struct_def_dpdk.h    | 250 ++++++++++++++++---
 drivers/net/bnxt/tf_core/bitalloc.c       |  10 +-
 drivers/net/bnxt/tf_core/bitalloc.h       |   3 +-
 drivers/net/bnxt/tf_core/tf_core.c        | 105 ++++++++
 drivers/net/bnxt/tf_core/tf_core.h        | 177 +++++++++++++-
 drivers/net/bnxt/tf_core/tf_device.c      |  76 +++---
 drivers/net/bnxt/tf_core/tf_device.h      |  73 ++++++
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   8 +
 drivers/net/bnxt/tf_core/tf_device_p58.c  |   8 +
 drivers/net/bnxt/tf_core/tf_em.h          |  17 ++
 drivers/net/bnxt/tf_core/tf_em_common.c   |  25 --
 drivers/net/bnxt/tf_core/tf_em_internal.c | 118 +++++----
 drivers/net/bnxt/tf_core/tf_identifier.c  |  89 +++----
 drivers/net/bnxt/tf_core/tf_identifier.h  |  16 ++
 drivers/net/bnxt/tf_core/tf_msg.c         | 223 ++++++++++++++---
 drivers/net/bnxt/tf_core/tf_msg.h         |  47 +++-
 drivers/net/bnxt/tf_core/tf_rm.c          | 277 +++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_rm.h          |  34 +++
 drivers/net/bnxt/tf_core/tf_session.c     |  37 ++-
 drivers/net/bnxt/tf_core/tf_session.h     |  66 ++++++
 drivers/net/bnxt/tf_core/tf_tbl.c         | 104 ++++----
 drivers/net/bnxt/tf_core/tf_tbl.h         |  17 ++
 drivers/net/bnxt/tf_core/tf_tcam.c        | 103 ++++----
 drivers/net/bnxt/tf_core/tf_tcam.h        |  16 ++
 drivers/net/bnxt/tf_core/tfp.c            |   6 +-
 drivers/net/bnxt/tf_core/tfp.h            |   3 +-
 26 files changed, 1557 insertions(+), 351 deletions(-)
drivers/net/bnxt/hsi_struct_def_dpdk.h +219 -31
index aea9305486..1f0b37addf 100644
@@ -699,6 +699,8 @@ struct cmd_nums {
 	/* Experimental */
 	#define HWRM_TF_SESSION_RESC_FLUSH                UINT32_C(0x2cf)
 	/* Experimental */
+	#define HWRM_TF_SESSION_RESC_INFO                 UINT32_C(0x2d0)
+	/* Experimental */
 	#define HWRM_TF_TBL_TYPE_GET                      UINT32_C(0x2da)
 	/* Experimental */
 	#define HWRM_TF_TBL_TYPE_SET                      UINT32_C(0x2db)
@@ -727,6 +729,8 @@ struct cmd_nums {
 	/* Experimental */
 	#define HWRM_TF_EM_HASH_INSERT                    UINT32_C(0x2ec)
 	/* Experimental */
+	#define HWRM_TF_EM_MOVE                           UINT32_C(0x2ed)
+	/* Experimental */
 	#define HWRM_TF_TCAM_SET                          UINT32_C(0x2f8)
 	/* Experimental */
 	#define HWRM_TF_TCAM_GET                          UINT32_C(0x2f9)
@@ -986,8 +990,8 @@ struct hwrm_err_output {
 #define HWRM_VERSION_MINOR 10
 #define HWRM_VERSION_UPDATE 2
 /* non-zero means beta version */
-#define HWRM_VERSION_RSVD 15
-#define HWRM_VERSION_STR "1.10.2.15"
+#define HWRM_VERSION_RSVD 22
+#define HWRM_VERSION_STR "1.10.2.22"
 
 /****************
  * hwrm_ver_get *
@@ -30177,7 +30181,7 @@ struct hwrm_vnic_qcaps_output {
 		UINT32_C(0x20)
 	/*
 	 * When this bit is '1', the capability to
-	 * mirror the the RoCE traffic is supported.
+	 * mirror the RoCE traffic is supported.
 	 * If set to '0', then the capability to mirror the
 	 * RoCE traffic is not supported.
 	 */
@@ -30930,7 +30934,7 @@ struct hwrm_vnic_plcmodes_cfg_input {
 	uint16_t	hds_threshold;
 	/*
 	 * When virtio placement algorithm is enabled, this
-	 * value is used to determine the the maximum number of BDs
+	 * value is used to determine the maximum number of BDs
 	 * that can be used to place an Rx Packet.
 	 * If an incoming packet does not fit in the buffers described
 	 * by the max BDs, the packet will be dropped and an error
@@ -31094,7 +31098,7 @@ struct hwrm_vnic_plcmodes_qcfg_output {
 	uint16_t	hds_threshold;
 	/*
 	 * When virtio placement algorithm is enabled, this
-	 * value is used to determine the the maximum number of BDs
+	 * value is used to determine the maximum number of BDs
 	 * that can be used to place an Rx Packet.
 	 * If an incoming packet does not fit in the buffers described
 	 * by the max BDs, the packet will be dropped and an error
@@ -42143,8 +42147,24 @@ struct hwrm_tf_session_open_output {
 	 * the newly created session.
 	 */
 	uint32_t	fw_session_client_id;
-	/* unused. */
-	uint32_t	unused0;
+	uint32_t	flags;
+	/* Indicates if the shared session has been created. */
+	#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION \
+		UINT32_C(0x1)
+	/*
+	 * If this bit set to 0, then it indicates the shared session
+	 * has been created by another session.
+	 */
+	#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_NOT_CREATOR \
+		UINT32_C(0x0)
+	/*
+	 * If this bit is set to 1, then it indicates the shared session
+	 * is created by this session.
+	 */
+	#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR \
+		UINT32_C(0x1)
+	#define HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_LAST \
+		HWRM_TF_SESSION_OPEN_OUTPUT_FLAGS_SHARED_SESSION_CREATOR
 	/* unused. */
 	uint8_t	unused1[3];
 	/*
@@ -42948,6 +42968,105 @@ struct hwrm_tf_session_resc_flush_output {
 	uint8_t	valid;
 } __rte_packed;
 
+/*****************************
+ * hwrm_tf_session_resc_info *
+ *****************************/
+
+
+/* hwrm_tf_session_resc_info_input (size:320b/40B) */
+struct hwrm_tf_session_resc_info_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;
+	/* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent. */
+	uint32_t	fw_session_id;
+	/* Control flags. */
+	uint16_t	flags;
+	/* Indicates the flow direction. */
+	#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR     UINT32_C(0x1)
+	/* If this bit set to 0, then it indicates rx flow. */
+	#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
+	/* If this bit is set to 1, then it indicates tx flow. */
+	#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
+	#define HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_LAST \
+		HWRM_TF_SESSION_RESC_INFO_INPUT_FLAGS_DIR_TX
+	/*
+	 * Defines the array size of the provided req_addr and
+	 * resv_addr array buffers. Should be set to the number of
+	 * request entries.
+	 */
+	uint16_t	req_size;
+	/*
+	 * This is the DMA address for the request input data array
+	 * buffer. Array is of tf_rm_resc_req_entry type. Size of the
+	 * array buffer is provided by the 'req_size' field in this
+	 * message.
+	 */
+	uint64_t	req_addr;
+	/*
+	 * This is the DMA address for the resc output data array
+	 * buffer. Array is of tf_rm_resc_entry type. Size of the array
+	 * buffer is provided by the 'req_size' field in this
+	 * message.
+	 */
+	uint64_t	resc_addr;
+} __rte_packed;
+
+/* hwrm_tf_session_resc_info_output (size:128b/16B) */
+struct hwrm_tf_session_resc_info_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;
+	/*
+	 * Size of the returned tf_rm_resc_entry data array. The value
+	 * cannot exceed the req_size defined by the input msg. The data
+	 * array is returned using the resv_addr specified DMA
+	 * address also provided by the input msg.
+	 */
+	uint16_t	size;
+	/* unused. */
+	uint8_t	unused0[5];
+	/*
+	 * 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;
+
 /* TruFlow RM capability of a resource. */
 /* tf_rm_resc_req_entry (size:64b/8B) */
 struct tf_rm_resc_req_entry {
@@ -44434,6 +44553,79 @@ struct hwrm_tf_em_delete_output {
 	uint16_t	unused0[3];
 } __rte_packed;
 
+/*******************
+ * hwrm_tf_em_move *
+ *******************/
+
+
+/* hwrm_tf_em_move_input (size:320b/40B) */
+struct hwrm_tf_em_move_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;
+	/* Session Id. */
+	uint32_t	fw_session_id;
+	/* Control flags. */
+	uint16_t	flags;
+	/* Indicates the flow direction. */
+	#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR     UINT32_C(0x1)
+	/* If this bit set to 0, then it indicates rx flow. */
+	#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_RX    UINT32_C(0x0)
+	/* If this bit is set to 1, then it indicates tx flow. */
+	#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX    UINT32_C(0x1)
+	#define HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_LAST \
+		HWRM_TF_EM_MOVE_INPUT_FLAGS_DIR_TX
+	/* Number of EM entry blocks */
+	uint16_t	num_blocks;
+	/* New index for entry */
+	uint32_t	new_index;
+	/* Unused */
+	uint32_t	unused0;
+	/* EM internal flow handle. */
+	uint64_t	flow_handle;
+} __rte_packed;
+
+/* hwrm_tf_em_move_output (size:128b/16B) */
+struct hwrm_tf_em_move_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;
+	/* Index of old entry. */
+	uint16_t	em_index;
+	/* unused. */
+	uint16_t	unused0[3];
+} __rte_packed;
+
 /********************
  * hwrm_tf_tcam_set *
  ********************/
@@ -46989,8 +47181,8 @@ struct hwrm_nvm_write_input {
 	 */
 	uint64_t	host_src_addr;
 	/*
-	 * The Directory Entry Type (valid values are defined in the bnxnvm
-	 * directory_type enum defined in the file bnxnvm_defs.h).
+	 * The Directory Entry Type (valid values are defined in the
+	 * bnxnvm_directory_type enum defined in the file bnxnvm_defs.h).
 	 */
 	uint16_t	dir_type;
 	/*
@@ -47003,10 +47195,10 @@ struct hwrm_nvm_write_input {
 	/* Directory Entry Attribute flags (see BNX_DIR_ATTR_* in the file bnxnvm_defs.h). */
 	uint16_t	dir_attr;
 	/*
-	 * Length of data to write, in bytes. May be less than or equal to the allocated
-	 * size for the directory entry.
-	 * The data length stored in the directory entry will be updated to reflect
-	 * this value once the write is complete.
+	 * Length of data to write, in bytes.May be
+	 * less than or equal to the allocated size for the directory entry.
+	 * The data length stored in the directory entry will be updated to
+	 * reflect this value once the write is complete.
 	 */
 	uint32_t	dir_data_length;
 	/* Option. */
@@ -47019,15 +47211,15 @@ struct hwrm_nvm_write_input {
 	#define HWRM_NVM_WRITE_INPUT_FLAGS_KEEP_ORIG_ACTIVE_IMG \
 		UINT32_C(0x1)
 	/*
-	 * The requested length of the allocated NVM for the item, in bytes. This
-	 * value may be greater than or equal to the specified data length (dir_data_length).
+	 * The requested length of the allocated NVM for the item, in bytes.
+	 * This value may be greater than or equal to the specified data length (dir_data_length).
 	 * If this value is less than the specified data length, it will be ignored.
-	 * The response will contain the actual allocated item length, which may be
-	 * greater than the requested item length.
+	 * The response will contain the actual allocated item length, which may
+	 * be greater than the requested item length.
 	 * The purpose for allocating more than the required number of bytes for
 	 * an item's data is to pre-allocate extra storage (padding) to accommodate
-	 * the potential future growth of an item (e.g. upgraded firmware with a
-	 * size increase, log growth, expanded configuration data).
+	 * the potential future growth of an item (e.g. upgraded firmware with
+	 * a size increase, log growth, expanded configuration data).
 	 */
 	uint32_t	dir_item_length;
 	uint32_t	unused_0;
@@ -47045,10 +47237,9 @@ struct hwrm_nvm_write_output {
 	uint16_t	resp_len;
 	/*
 	 * Length of the allocated NVM for the item, in bytes. The value may be
-	 * greater than or equal to the specified data length or the requested
-	 * item length.
-	 * The actual item length used when creating a new directory entry will be
-	 * a multiple of an NVM block size.
+	 * greater than or equal to the specified data length or the requested item length.
+	 * The actual item length used when creating a new directory entry will
+	 * be a multiple of an NVM block size.
 	 */
 	uint32_t	dir_item_length;
 	/* The directory index of the created or modified item. */
@@ -47538,14 +47729,11 @@ struct hwrm_nvm_mod_dir_entry_input {
 	 */
 	uint16_t	dir_ordinal;
 	/*
-	 * The Directory Entry Extension flags (see BNX_DIR_EXT_* for extension
-	 * flag definitions).
+	 * The Directory Entry Extension flags (see BNX_DIR_EXT_* for
+	 * extension flag definitions).
 	 */
 	uint16_t	dir_ext;
-	/*
-	 * Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag
-	 * definitions).
-	 */
+	/* Directory Entry Attribute flags (see BNX_DIR_ATTR_* for attribute flag definitions). */
 	uint16_t	dir_attr;
 	/*
 	 * If valid, then this field updates the checksum
@@ -48406,8 +48594,8 @@ struct hwrm_fw_reset_input {
 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_HOST \
 		UINT32_C(0x4)
 	/*
-	 * AP processor complex (in multi-host environment). Use host_idx to
-	 * control which core is reset
+	 * AP processor complex (in multi-host environment).
+	 * Use host_idx to control which core is reset
 	 */
 	#define HWRM_FW_RESET_INPUT_EMBEDDED_PROC_TYPE_AP \
 		UINT32_C(0x5)
drivers/net/bnxt/tf_core/bitalloc.c +6 -4
index af1397071b..e253cfc3a6 100644
@@ -65,7 +65,7 @@ ba_ffs(bitalloc_word_t v)
 }
 
 int
-ba_init(struct bitalloc *pool, int size)
+ba_init(struct bitalloc *pool, int size, bool free)
 {
 	bitalloc_word_t *mem = (bitalloc_word_t *)pool;
 	int       i;
@@ -101,9 +101,11 @@ ba_init(struct bitalloc *pool, int size)
 		pool->storage[offset++] = words[--lev];
 	}
 
-	/* Free the entire pool */
-	for (i = 0; i < size; i++)
-		ba_free(pool, i);
+	/* Free the entire pool if it is required*/
+	if (free) {
+		for (i = 0; i < size; i++)
+			ba_free(pool, i);
+	}
 
 	return 0;
 }
drivers/net/bnxt/tf_core/bitalloc.h +2 -1
index 7244b86e95..e3b389e68d 100644
@@ -7,6 +7,7 @@
 #define _BITALLOC_H_
 
 #include <stdint.h>
+#include <stdbool.h>
 
 /* Bitalloc works on uint32_t as its word size */
 typedef uint32_t bitalloc_word_t;
@@ -64,7 +65,7 @@ struct bitalloc {
  * Returns 0 on success, -1 on failure.  Size is arbitrary up to
  * BITALLOC_MAX_SIZE
  */
-int ba_init(struct bitalloc *pool, int size);
+int ba_init(struct bitalloc *pool, int size, bool free);
 
 /**
  * Returns -1 on failure, or index of allocated entry
drivers/net/bnxt/tf_core/tf_core.c +105 -0

120 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_core.h +166 -11

208 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device.c +46 -30

106 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device.h +73 -0

97 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device_p4.c +8 -0
index 8797afa100..e74ba6cd8f 100644
@@ -206,6 +206,7 @@ const struct tf_dev_ops tf_dev_ops_p4_init = {
 	.tf_dev_alloc_ident = NULL,
 	.tf_dev_free_ident = NULL,
 	.tf_dev_search_ident = NULL,
+	.tf_dev_get_ident_resc_info = NULL,
 	.tf_dev_get_tbl_info = NULL,
 	.tf_dev_alloc_ext_tbl = NULL,
 	.tf_dev_alloc_tbl = NULL,
@@ -216,15 +217,18 @@ const struct tf_dev_ops tf_dev_ops_p4_init = {
 	.tf_dev_set_ext_tbl = NULL,
 	.tf_dev_get_tbl = NULL,
 	.tf_dev_get_bulk_tbl = NULL,
+	.tf_dev_get_tbl_resc_info = NULL,
 	.tf_dev_alloc_tcam = NULL,
 	.tf_dev_free_tcam = NULL,
 	.tf_dev_alloc_search_tcam = NULL,
 	.tf_dev_set_tcam = NULL,
 	.tf_dev_get_tcam = NULL,
+	.tf_dev_get_tcam_resc_info = NULL,
 	.tf_dev_insert_int_em_entry = NULL,
 	.tf_dev_delete_int_em_entry = NULL,
 	.tf_dev_insert_ext_em_entry = NULL,
 	.tf_dev_delete_ext_em_entry = NULL,
+	.tf_dev_get_em_resc_info = NULL,
 	.tf_dev_alloc_tbl_scope = NULL,
 	.tf_dev_map_tbl_scope = NULL,
 	.tf_dev_map_parif = NULL,
@@ -247,6 +251,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_alloc_ident = tf_ident_alloc,
 	.tf_dev_free_ident = tf_ident_free,
 	.tf_dev_search_ident = tf_ident_search,
+	.tf_dev_get_ident_resc_info = tf_ident_get_resc_info,
 	.tf_dev_get_tbl_info = NULL,
 	.tf_dev_alloc_tbl = tf_tbl_alloc,
 	.tf_dev_alloc_ext_tbl = tf_tbl_ext_alloc,
@@ -257,15 +262,18 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_set_ext_tbl = tf_tbl_ext_common_set,
 	.tf_dev_get_tbl = tf_tbl_get,
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
+	.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
 	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
 	.tf_dev_get_tcam = NULL,
+	.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
 	.tf_dev_insert_int_em_entry = tf_em_insert_int_entry,
 	.tf_dev_delete_int_em_entry = tf_em_delete_int_entry,
 	.tf_dev_insert_ext_em_entry = tf_em_insert_ext_entry,
 	.tf_dev_delete_ext_em_entry = tf_em_delete_ext_entry,
+	.tf_dev_get_em_resc_info = tf_em_get_resc_info,
 	.tf_dev_alloc_tbl_scope = tf_em_ext_common_alloc,
 	.tf_dev_map_tbl_scope = tf_em_ext_map_tbl_scope,
 	.tf_dev_map_parif = tf_dev_p4_map_parif,
drivers/net/bnxt/tf_core/tf_device_p58.c +8 -0
index b44648d216..32d621e7da 100644
@@ -227,6 +227,7 @@ const struct tf_dev_ops tf_dev_ops_p58_init = {
 	.tf_dev_alloc_ident = NULL,
 	.tf_dev_free_ident = NULL,
 	.tf_dev_search_ident = NULL,
+	.tf_dev_get_ident_resc_info = NULL,
 	.tf_dev_get_tbl_info = NULL,
 	.tf_dev_alloc_ext_tbl = NULL,
 	.tf_dev_alloc_tbl = NULL,
@@ -237,15 +238,18 @@ const struct tf_dev_ops tf_dev_ops_p58_init = {
 	.tf_dev_set_ext_tbl = NULL,
 	.tf_dev_get_tbl = NULL,
 	.tf_dev_get_bulk_tbl = NULL,
+	.tf_dev_get_tbl_resc_info = NULL,
 	.tf_dev_alloc_tcam = NULL,
 	.tf_dev_free_tcam = NULL,
 	.tf_dev_alloc_search_tcam = NULL,
 	.tf_dev_set_tcam = NULL,
 	.tf_dev_get_tcam = NULL,
+	.tf_dev_get_tcam_resc_info = NULL,
 	.tf_dev_insert_int_em_entry = NULL,
 	.tf_dev_delete_int_em_entry = NULL,
 	.tf_dev_insert_ext_em_entry = NULL,
 	.tf_dev_delete_ext_em_entry = NULL,
+	.tf_dev_get_em_resc_info = NULL,
 	.tf_dev_alloc_tbl_scope = NULL,
 	.tf_dev_map_tbl_scope = NULL,
 	.tf_dev_map_parif = NULL,
@@ -268,6 +272,7 @@ const struct tf_dev_ops tf_dev_ops_p58 = {
 	.tf_dev_alloc_ident = tf_ident_alloc,
 	.tf_dev_free_ident = tf_ident_free,
 	.tf_dev_search_ident = tf_ident_search,
+	.tf_dev_get_ident_resc_info = tf_ident_get_resc_info,
 	.tf_dev_get_tbl_info = tf_dev_p58_get_sram_tbl_info,
 	.tf_dev_alloc_tbl = tf_tbl_alloc,
 	.tf_dev_alloc_ext_tbl = tf_tbl_ext_alloc,
@@ -278,15 +283,18 @@ const struct tf_dev_ops tf_dev_ops_p58 = {
 	.tf_dev_set_ext_tbl = tf_tbl_ext_common_set,
 	.tf_dev_get_tbl = tf_tbl_get,
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
+	.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
 	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
 	.tf_dev_get_tcam = tf_tcam_get,
+	.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
 	.tf_dev_insert_int_em_entry = tf_em_hash_insert_int_entry,
 	.tf_dev_delete_int_em_entry = tf_em_hash_delete_int_entry,
 	.tf_dev_insert_ext_em_entry = NULL,
 	.tf_dev_delete_ext_em_entry = NULL,
+	.tf_dev_get_em_resc_info = tf_em_get_resc_info,
 	.tf_dev_alloc_tbl_scope = NULL,
 	.tf_dev_map_tbl_scope = NULL,
 	.tf_dev_map_parif = NULL,
drivers/net/bnxt/tf_core/tf_em.h +17 -0
index 19ad7f12be..60d90e28de 100644
@@ -530,4 +530,21 @@ tf_em_ext_system_bind(struct tf *tfp,
 		      struct tf_em_cfg_parms *parms);
 
 int offload_system_mmap(struct tf_tbl_scope_cb *tbl_scope_cb);
+
+/**
+ * Retrieves the allocated resource info
+ *
+ * [in] tfp
+ *   Pointer to TF handle, used for HCAPI communication
+ *
+ * [in] parms
+ *   Pointer to parameters
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int
+tf_em_get_resc_info(struct tf *tfp,
+		    struct tf_em_resource_info *em);
 #endif /* _TF_EM_H_ */
drivers/net/bnxt/tf_core/tf_em_common.c +0 -25
index 4dc3c86b57..ed8f6db58c 100644
@@ -26,11 +26,6 @@
 /* Number of pointers per page_size */
 #define MAX_PAGE_PTRS(page_size)  ((page_size) / sizeof(void *))
 
-/**
- * Init flag, set on bind and cleared on unbind
- */
-static uint8_t init;
-
 /**
  * Host or system
  */
@@ -924,18 +919,11 @@ tf_em_ext_common_bind(struct tf *tfp,
 	int rc;
 	int i;
 	struct tf_rm_create_db_parms db_cfg = { 0 };
-	uint8_t db_exists = 0;
 	struct em_ext_db *ext_db;
 	struct tfp_calloc_parms cparms;
 
 	TF_CHECK_PARMS2(tfp, parms);
 
-	if (init) {
-		TFP_DRV_LOG(ERR,
-			    "EM Ext DB already initialized\n");
-		return -EINVAL;
-	}
-
 	cparms.nitems = 1;
 	cparms.size = sizeof(struct em_ext_db);
 	cparms.alignment = 0;
@@ -974,12 +962,8 @@ tf_em_ext_common_bind(struct tf *tfp,
 
 			return rc;
 		}
-		db_exists = 1;
 	}
 
-	if (db_exists)
-		init = 1;
-
 	mem_type = parms->mem_type;
 
 	return 0;
@@ -1001,13 +985,6 @@ tf_em_ext_common_unbind(struct tf *tfp)
 
 	TF_CHECK_PARMS1(tfp);
 
-	/* Bail if nothing has been initialized */
-	if (!init) {
-		TFP_DRV_LOG(INFO,
-			    "No EM Ext DBs created\n");
-		return 0;
-	}
-
 	rc = tf_session_get_session_internal(tfp, &tfs);
 	if (rc) {
 		TFP_DRV_LOG(ERR, "Failed to get tf_session, rc:%s\n",
@@ -1064,8 +1041,6 @@ tf_em_ext_common_unbind(struct tf *tfp)
 	tfp_free(ext_db);
 	tf_session_set_em_ext_db(tfp, NULL);
 
-	init = 0;
-
 	return 0;
 }
 
drivers/net/bnxt/tf_core/tf_em_internal.c +74 -44

171 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_identifier.c +47 -42

149 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_identifier.h +16 -0
index 54cecbfd4c..55c093802e 100644
@@ -201,4 +201,20 @@ int tf_ident_free(struct tf *tfp,
 int tf_ident_search(struct tf *tfp,
 		    struct tf_ident_search_parms *parms);
 
+/**
+ * Retrieves the allocated resource info
+ *
+ * [in] tfp
+ *   Pointer to TF handle, used for HCAPI communication
+ *
+ * [in] parms
+ *   Pointer to parameters
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int tf_ident_get_resc_info(struct tf *tfp,
+			   struct tf_identifier_resource_info *parms);
+
 #endif /* _TF_IDENTIFIER_H_ */
drivers/net/bnxt/tf_core/tf_msg.c +192 -31

448 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_msg.h +43 -4

77 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_rm.c +276 -1

295 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_rm.h +34 -0
index 6eb6865dac..8b984112e8 100644
@@ -425,6 +425,24 @@ struct tf_rm_check_indexes_in_range_parms {
 int tf_rm_create_db(struct tf *tfp,
 		    struct tf_rm_create_db_parms *parms);
 
+/**
+ * Creates and fills a Resource Manager (RM) DB with requested
+ * elements. The DB is indexed per the parms structure. It only retrieve
+ * allocated resource information for a exist session.
+ *
+ * [in] tfp
+ *   Pointer to TF handle, used for HCAPI communication
+ *
+ * [in] parms
+ *   Pointer to create parameters
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int tf_rm_create_db_no_reservation(struct tf *tfp,
+		    struct tf_rm_create_db_parms *parms);
+
 /**
  * Closes the Resource Manager (RM) DB and frees all allocated
  * resources per the associated database.
@@ -498,6 +516,22 @@ int tf_rm_is_allocated(struct tf_rm_is_allocated_parms *parms);
  */
 int tf_rm_get_info(struct tf_rm_get_alloc_info_parms *parms);
 
+/**
+ * Retrieves all elements allocation information from the Resource
+ * Manager (RM) DB.
+ *
+ * [in] parms
+ *   Pointer to get info parameters
+ *
+ * [in] size
+ *   number of the elements for the specific module
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int tf_rm_get_all_info(struct tf_rm_get_alloc_info_parms *parms, int size);
+
 /**
  * Performs a lookup in the Resource Manager DB and retrieves the
  * requested HCAPI RM type.
drivers/net/bnxt/tf_core/tf_session.c +31 -6
index f591fbe3f5..391d8786ab 100644
@@ -11,6 +11,7 @@
 #include "tf_common.h"
 #include "tf_msg.h"
 #include "tfp.h"
+#include "bnxt.h"
 
 struct tf_session_client_create_parms {
 	/**
@@ -57,6 +58,7 @@ tf_session_create(struct tf *tfp,
 	uint8_t fw_session_client_id;
 	union tf_session_id *session_id;
 	struct tf_dev_info dev;
+	bool shared_session_creator;
 
 	TF_CHECK_PARMS2(tfp, parms);
 
@@ -64,11 +66,12 @@ tf_session_create(struct tf *tfp,
 			&dev);
 
 	/* Open FW session and get a new session_id */
-	rc = tf_msg_session_open(tfp,
+	rc = tf_msg_session_open(parms->open_cfg->bp,
 				 parms->open_cfg->ctrl_chan_name,
 				 &fw_session_id,
 				 &fw_session_client_id,
-				 &dev);
+				 &dev,
+				 &shared_session_creator);
 	if (rc) {
 		/* Log error */
 		if (rc == -EEXIST)
@@ -137,6 +140,7 @@ tf_session_create(struct tf *tfp,
 	session_id->id = session->session_id.id;
 
 	session->shadow_copy = parms->open_cfg->shadow_copy;
+	session->bp = parms->open_cfg->bp;
 
 	/* Init session client list */
 	ll_init(&session->client_ll);
@@ -175,12 +179,20 @@ tf_session_create(struct tf *tfp,
 
 	/* Init session em_ext_db */
 	session->em_ext_db_handle = NULL;
+	if (!strcmp(parms->open_cfg->ctrl_chan_name, "tf_share"))
+		session->shared_session = true;
+
+	if (session->shared_session && shared_session_creator) {
+		session->shared_session_creator = true;
+		parms->open_cfg->shared_session_creator = true;
+	}
 
 	rc = tf_dev_bind(tfp,
 			 parms->open_cfg->device_type,
 			 session->shadow_copy,
 			 &parms->open_cfg->resources,
 			 &session->dev);
+
 	/* Logging handled by dev_bind */
 	if (rc)
 		goto cleanup;
@@ -857,16 +869,29 @@ tf_session_get_db(struct tf *tfp,
 
 	switch (type) {
 	case TF_MODULE_TYPE_IDENTIFIER:
-		*db_handle = tfs->id_db_handle;
+		if (tfs->id_db_handle)
+			*db_handle = tfs->id_db_handle;
+		else
+			rc = -EINVAL;
 		break;
 	case TF_MODULE_TYPE_TABLE:
-		*db_handle = tfs->tbl_db_handle;
+		if (tfs->tbl_db_handle)
+			*db_handle = tfs->tbl_db_handle;
+		else
+			rc = -EINVAL;
+
 		break;
 	case TF_MODULE_TYPE_TCAM:
-		*db_handle = tfs->tcam_db_handle;
+		if (tfs->tcam_db_handle)
+			*db_handle = tfs->tcam_db_handle;
+		else
+			rc = -EINVAL;
 		break;
 	case TF_MODULE_TYPE_EM:
-		*db_handle = tfs->em_db_handle;
+		if (tfs->em_db_handle)
+			*db_handle = tfs->em_db_handle;
+		else
+			rc = -EINVAL;
 		break;
 	default:
 		rc = -EINVAL;
drivers/net/bnxt/tf_core/tf_session.h +66 -0

82 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tbl.c +47 -57

176 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tbl.h +17 -0
index 83b72d1b3f..aba46fd161 100644
@@ -396,4 +396,21 @@ int tf_tbl_get(struct tf *tfp,
 int tf_tbl_bulk_get(struct tf *tfp,
 		    struct tf_tbl_get_bulk_parms *parms);
 
+/**
+ * Retrieves the allocated resource info
+ *
+ * [in] tfp
+ *   Pointer to TF handle, used for HCAPI communication
+ *
+ * [in] parms
+ *   Pointer to Table resource info parameters
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int
+tf_tbl_get_resc_info(struct tf *tfp,
+		     struct tf_tbl_resource_info *tbl);
+
 #endif /* TF_TBL_TYPE_H */
drivers/net/bnxt/tf_core/tf_tcam.c +44 -59

184 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.h +16 -0
index acab223532..bed17af6ae 100644
@@ -386,4 +386,20 @@ int tf_tcam_set(struct tf *tfp,
 int tf_tcam_get(struct tf *tfp,
 		struct tf_tcam_get_parms *parms);
 
+/**
+ * Retrieves the allocated resource info
+ *
+ * [in] tfp
+ *   Pointer to TF handle, used for HCAPI communication
+ *
+ * [in] parms
+ *   Pointer to parameters
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int tf_tcam_get_resc_info(struct tf *tfp,
+			  struct tf_tcam_resource_info *parms);
+
 #endif /* _TF_TCAM_H */
drivers/net/bnxt/tf_core/tfp.c +2 -4
index 37c49b587d..4d9b37f749 100644
@@ -28,7 +28,7 @@
  * Returns success or failure code.
  */
 int
-tfp_send_msg_direct(struct tf *tfp,
+tfp_send_msg_direct(struct bnxt *bp,
 		    struct tfp_send_msg_parms *parms)
 {
 	int      rc = 0;
@@ -40,9 +40,7 @@ tfp_send_msg_direct(struct tf *tfp,
 	if (parms->mailbox == TF_CHIMP_MB)
 		use_kong_mb = 0;
 
-	rc = bnxt_hwrm_tf_message_direct(container_of(tfp,
-					       struct bnxt,
-					       tfp),
+	rc = bnxt_hwrm_tf_message_direct(bp,
 					 use_kong_mb,
 					 parms->tf_type,
 					 parms->req_data,
drivers/net/bnxt/tf_core/tfp.h +2 -1
index bcc56b0a54..58f34bbcab 100644
@@ -15,6 +15,7 @@
 #include <rte_spinlock.h>
 #include <rte_log.h>
 #include <rte_byteorder.h>
+#include <bnxt.h>
 
 /**
  * DPDK/Driver specific log level for the BNXT Eth driver.
@@ -130,7 +131,7 @@ struct tfp_calloc_parms {
  *   -1             - Global error like not supported
  *   -EINVAL        - Parameter Error
  */
-int tfp_send_msg_direct(struct tf *tfp,
+int tfp_send_msg_direct(struct bnxt *bp,
 			struct tfp_send_msg_parms *parms);
 
 /**
Signature · 1 line
2.21.1 (Apple Git-122.3)
#77 lore raw

PATCH v2 15/58 net/bnxt: add dpool allocator for EM allocation

In reply to Ajit Khaparde

From: Peter Spreadborough <[email protected]>

The dpool allocator supports variable size entries and also supports defragmentation of the allocation space. EM will by default use the fixed size stack allocator. The dynamic allocator may be selected at build time. The dpool allocator supports variable size entries and also supports defragmentation of the allocation space.

---
 drivers/net/bnxt/tf_core/dpool.c              | 374 ++++++++++++++++++
 drivers/net/bnxt/tf_core/dpool.h              | 309 +++++++++++++++
 drivers/net/bnxt/tf_core/meson.build          |   1 +
 drivers/net/bnxt/tf_core/tf_core.h            |  42 ++
 drivers/net/bnxt/tf_core/tf_device.h          |  34 ++
 drivers/net/bnxt/tf_core/tf_device_p58.c      |   5 +
 drivers/net/bnxt/tf_core/tf_em.h              |  26 ++
 .../net/bnxt/tf_core/tf_em_hash_internal.c    | 102 ++++-
 drivers/net/bnxt/tf_core/tf_em_internal.c     | 215 ++++++++--
 drivers/net/bnxt/tf_core/tf_msg.c             |  69 ++++
 drivers/net/bnxt/tf_core/tf_msg.h             |  15 +
 drivers/net/bnxt/tf_core/tf_session.h         |   5 +
 12 files changed, 1157 insertions(+), 40 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/dpool.c
 create mode 100644 drivers/net/bnxt/tf_core/dpool.h
drivers/net/bnxt/tf_core/dpool.c new file +374 -0
new file mode 100644
index 0000000000..0dae42b1bb
@@ -0,0 +1,374 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019-2021 Broadcom
+ * All rights reserved.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <errno.h>
+
+#include <rte_malloc.h>
+
+#include "tfp.h"
+#include "dpool.h"
+
+int dpool_init(struct dpool *dpool,
+	       uint32_t start_index,
+	       uint32_t size,
+	       uint8_t max_alloc_size,
+	       void *user_data,
+	       int (*move_callback)(void *, uint64_t, uint32_t))
+{
+	uint32_t i;
+	int rc;
+	struct tfp_calloc_parms parms;
+
+	parms.nitems = size;
+	parms.size = sizeof(struct dpool_entry);
+	parms.alignment = 0;
+
+	rc = tfp_calloc(&parms);
+
+	if (rc)
+		return rc;
+
+	dpool->entry = parms.mem_va;
+	dpool->start_index = start_index;
+	dpool->size = size;
+	dpool->max_alloc_size = max_alloc_size;
+	dpool->user_data = user_data;
+	dpool->move_callback = move_callback;
+	/*
+	 * Init entries
+	 */
+	for (i = 0; i < size; i++) {
+		dpool->entry[i].flags = 0;
+		dpool->entry[i].index = start_index;
+		dpool->entry[i].entry_data = 0UL;
+		start_index++;
+	}
+
+	return 0;
+}
+
+static int dpool_move(struct dpool *dpool,
+		      uint32_t dst_index,
+		      uint32_t src_index)
+{
+	uint32_t size;
+	uint32_t i;
+	if (DP_IS_FREE(dpool->entry[dst_index].flags)) {
+		size = DP_FLAGS_SIZE(dpool->entry[src_index].flags);
+
+		dpool->entry[dst_index].flags = dpool->entry[src_index].flags;
+		dpool->entry[dst_index].entry_data = dpool->entry[src_index].entry_data;
+
+		if (dpool->move_callback != NULL) {
+			dpool->move_callback(dpool->user_data,
+					     dpool->entry[src_index].entry_data,
+					     dst_index + dpool->start_index);
+		}
+
+		dpool->entry[src_index].flags = 0;
+		dpool->entry[src_index].entry_data = 0UL;
+
+		for (i = 1; i < size; i++) {
+			dpool->entry[dst_index + i].flags = size;
+			dpool->entry[src_index + i].flags = 0;
+		}
+	} else {
+		return -1;
+	}
+
+	return 0;
+}
+
+
+int dpool_defrag(struct dpool *dpool,
+		 uint32_t entry_size,
+		 uint8_t defrag)
+{
+	struct dpool_free_list *free_list;
+	struct dpool_adj_list *adj_list;
+	uint32_t count;
+	uint32_t index;
+	uint32_t used;
+	uint32_t i;
+	uint32_t size;
+	uint32_t largest_free_index = 0;
+	uint32_t largest_free_size;
+	uint32_t max;
+	uint32_t max_index;
+	uint32_t max_size = 0;
+	int rc;
+
+	free_list = rte_zmalloc("dpool_free_list",
+				sizeof(struct dpool_free_list), 0);
+	if (free_list == NULL) {
+		TFP_DRV_LOG(ERR, "dpool free list allocation failed\n");
+		return -ENOMEM;
+	}
+
+	adj_list = rte_zmalloc("dpool_adjacent_list",
+				sizeof(struct dpool_adj_list), 0);
+	if (adj_list == NULL) {
+		TFP_DRV_LOG(ERR, "dpool adjacent list allocation failed\n");
+		return -ENOMEM;
+	}
+
+	while (1) {
+		/*
+		 * Create list of free entries
+		 */
+		free_list->size = 0;
+		largest_free_size = 0;
+		largest_free_index = 0;
+		count = 0;
+
+		for (i = 0; i < dpool->size; i++) {
+			if (DP_IS_FREE(dpool->entry[i].flags)) {
+				if (count == 0)
+					index = i;
+				count++;
+			} else if (count > 0) {
+				free_list->entry[free_list->size].index = index;
+				free_list->entry[free_list->size].size = count;
+
+				if (count > largest_free_size) {
+					largest_free_index = free_list->size;
+					largest_free_size = count;
+				}
+
+				free_list->size++;
+				count = 0;
+			}
+		}
+
+		if (free_list->size == 0)
+			largest_free_size = count;
+
+		/*
+		 * If using defrag to fit and there's a large enough
+		 * space then we are done.
+		 */
+		if (defrag == DP_DEFRAG_TO_FIT &&
+		    largest_free_size >= entry_size)
+			goto done;
+
+		/*
+		 * Create list of entries adjacent to free entries
+		 */
+		count = 0;
+		adj_list->size = 0;
+		used = 0;
+
+		for (i = 0; i < dpool->size; ) {
+			if (DP_IS_USED(dpool->entry[i].flags)) {
+				used++;
+
+				if (count > 0) {
+					adj_list->entry[adj_list->size].index = i;
+					adj_list->entry[adj_list->size].size =
+						DP_FLAGS_SIZE(dpool->entry[i].flags);
+					adj_list->entry[adj_list->size].left = count;
+
+					if (adj_list->size > 0 && used == 1)
+						adj_list->entry[adj_list->size - 1].right = count;
+
+					adj_list->size++;
+				}
+
+				count = 0;
+				i += DP_FLAGS_SIZE(dpool->entry[i].flags);
+			} else {
+				used = 0;
+				count++;
+				i++;
+			}
+		}
+
+		/*
+		 * Using the size of the largest free space available
+		 * select the adjacency list entry of that size with
+		 * the largest left + right + size count. If there
+		 * are no entries of that size then decrement the size
+		 * and try again.
+		 */
+		max = 0;
+		max_index = 0;
+		max_size = 0;
+
+		for (size = largest_free_size; size > 0; size--) {
+			for (i = 0; i < adj_list->size; i++) {
+				if (adj_list->entry[i].size == size &&
+				    ((size +
+				      adj_list->entry[i].left +
+				      adj_list->entry[i].right) > max)) {
+					max = size +
+						adj_list->entry[i].left +
+						adj_list->entry[i].right;
+					max_size = size;
+					max_index = adj_list->entry[i].index;
+				}
+			}
+
+			if (max)
+				break;
+		}
+
+		/*
+		 * If the max entry is smaller than the largest_free_size
+		 * find the first entry in the free list that it cn fit in to.
+		 */
+		if (max_size < largest_free_size) {
+			for (i = 0; i < free_list->size; i++) {
+				if (free_list->entry[i].size >= max_size) {
+					largest_free_index = i;
+					break;
+				}
+			}
+		}
+
+		/*
+		 * If we have a contender then move it to the new spot.
+		 */
+		if (max) {
+			rc = dpool_move(dpool,
+					free_list->entry[largest_free_index].index,
+					max_index);
+			if (rc) {
+				rte_free(free_list);
+				rte_free(adj_list);
+				return rc;
+			}
+		} else {
+			break;
+		}
+	}
+
+done:
+	rte_free(free_list);
+	rte_free(adj_list);
+	return largest_free_size;
+}
+
+
+uint32_t dpool_alloc(struct dpool *dpool,
+		     uint32_t size,
+		     uint8_t defrag)
+{
+	uint32_t i;
+	uint32_t j;
+	uint32_t count = 0;
+	uint32_t first_entry_index;
+	int rc;
+
+	if (size > dpool->max_alloc_size || size == 0)
+		return DP_INVALID_INDEX;
+
+	/*
+	 * Defrag requires EM move support.
+	 */
+	if (defrag != DP_DEFRAG_NONE &&
+	    dpool->move_callback == NULL)
+		return DP_INVALID_INDEX;
+
+	while (1) {
+		/*
+		 * find <size> consecutive free entries
+		 */
+		for (i = 0; i < dpool->size; i++) {
+			if (DP_IS_FREE(dpool->entry[i].flags)) {
+				if (count == 0)
+					first_entry_index = i;
+
+				count++;
+
+				if (count == size) {
+					for (j = 0; j < size; j++) {
+						dpool->entry[j + first_entry_index].flags = size;
+						if (j == 0)
+							dpool->entry[j + first_entry_index].flags |=
+								DP_FLAGS_START;
+					}
+
+					dpool->entry[i].entry_data = 0UL;
+					return (first_entry_index + dpool->start_index);
+				}
+			} else {
+				count = 0;
+			}
+		}
+
+		/*
+		 * If defragging then do it to it
+		 */
+		if (defrag != DP_DEFRAG_NONE) {
+			rc = dpool_defrag(dpool, size, defrag);
+
+			if (rc < 0)
+				return DP_INVALID_INDEX;
+		} else {
+			break;
+		}
+
+		/*
+		 * If the defrag created enough space then try the
+		 * alloc again else quit.
+		 */
+		if ((uint32_t)rc < size)
+			break;
+	}
+
+	return DP_INVALID_INDEX;
+}
+
+int dpool_free(struct dpool *dpool,
+	       uint32_t index)
+{
+	uint32_t i;
+	int start = (index - dpool->start_index);
+	uint32_t size;
+
+	if (start < 0)
+		return -1;
+
+	if (DP_IS_START(dpool->entry[start].flags)) {
+		size = DP_FLAGS_SIZE(dpool->entry[start].flags);
+		if (size > dpool->max_alloc_size || size == 0)
+			return -1;
+
+		for (i = start; i < (start + size); i++)
+			dpool->entry[i].flags = 0;
+
+		return 0;
+	}
+
+	return -1;
+}
+
+void dpool_free_all(struct dpool *dpool)
+{
+	uint32_t i;
+
+	for (i = 0; i < dpool->size; i++)
+		dpool_free(dpool, dpool->entry[i].index);
+}
+
+int dpool_set_entry_data(struct dpool *dpool,
+			 uint32_t index,
+			 uint64_t entry_data)
+{
+	int start = (index - dpool->start_index);
+
+	if (start < 0)
+		return -1;
+
+	if (DP_IS_START(dpool->entry[start].flags)) {
+		dpool->entry[start].entry_data = entry_data;
+		return 0;
+	}
+
+	return -1;
+}
drivers/net/bnxt/tf_core/dpool.h new file +309 -0

309 lines not on this page · raw message

drivers/net/bnxt/tf_core/meson.build +1 -0
index 2c02214d83..3a91f04bc0 100644
@@ -10,6 +10,7 @@ sources += files(
         'tf_core.c',
         'bitalloc.c',
         'tf_msg.c',
+	'dpool.c',
         'rand.c',
         'stack.c',
         'tf_em_common.c',
drivers/net/bnxt/tf_core/tf_core.h +42 -0

48 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device.h +34 -0
index 16c2fe0f64..31806bb289 100644
@@ -611,6 +611,22 @@ struct tf_dev_ops {
 	int (*tf_dev_delete_int_em_entry)(struct tf *tfp,
 					  struct tf_delete_em_entry_parms *parms);
 
+	/**
+	 * Move EM hash entry API
+	 *
+	 * [in] tfp
+	 *   Pointer to TF handle
+	 *
+	 * [in] parms
+	 *   Pointer to E/EM move parameters
+	 *
+	 *    returns:
+	 *    0       - Success
+	 *    -EINVAL - Error
+	 */
+	int (*tf_dev_move_int_em_entry)(struct tf *tfp,
+					struct tf_move_em_entry_parms *parms);
+
 	/**
 	 * Insert EEM hash entry API
 	 *
@@ -661,6 +677,24 @@ struct tf_dev_ops {
 	int (*tf_dev_get_em_resc_info)(struct tf *tfp,
 				       struct tf_em_resource_info *parms);
 
+	/**
+	 * Move EEM hash entry API
+	 *
+	 *   Pointer to E/EM move parameters
+	 *
+	 * [in] tfp
+	 *   Pointer to TF handle
+	 *
+	 * [in] parms
+	 *   Pointer to em info
+	 *
+	 *    returns:
+	 *    0       - Success
+	 *    -EINVAL - Error
+	 */
+	int (*tf_dev_move_ext_em_entry)(struct tf *tfp,
+					struct tf_move_em_entry_parms *parms);
+
 	/**
 	 * Allocate EEM table scope
 	 *
drivers/net/bnxt/tf_core/tf_device_p58.c +5 -0
index 32d621e7da..50facce155 100644
@@ -292,6 +292,11 @@ const struct tf_dev_ops tf_dev_ops_p58 = {
 	.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
 	.tf_dev_insert_int_em_entry = tf_em_hash_insert_int_entry,
 	.tf_dev_delete_int_em_entry = tf_em_hash_delete_int_entry,
+#if (TF_EM_ALLOC == 1)
+	.tf_dev_move_int_em_entry = tf_em_move_int_entry,
+#else
+	.tf_dev_move_int_em_entry = NULL,
+#endif
 	.tf_dev_insert_ext_em_entry = NULL,
 	.tf_dev_delete_ext_em_entry = NULL,
 	.tf_dev_get_em_resc_info = tf_em_get_resc_info,
drivers/net/bnxt/tf_core/tf_em.h +26 -0
index 60d90e28de..9d168c3c7f 100644
@@ -13,6 +13,16 @@
 
 #include "hcapi_cfa_defs.h"
 
+/**
+ * TF_EM_ALLOC
+ *
+ * 0: Use stack allocator with fixed sized entries
+ *    (default).
+ * 1: Use dpool allocator with variable size
+ *    entries.
+ */
+#define TF_EM_ALLOC 0
+
 #define TF_EM_MIN_ENTRIES     (1 << 15) /* 32K */
 #define TF_EM_MAX_ENTRIES     (1 << 27) /* 128M */
 
@@ -243,6 +253,22 @@ int tf_em_hash_insert_int_entry(struct tf *tfp,
 int tf_em_hash_delete_int_entry(struct tf *tfp,
 				struct tf_delete_em_entry_parms *parms);
 
+/**
+ * Move record from internal EM table
+ *
+ * [in] tfp
+ *   Pointer to TruFlow handle
+ *
+ * [in] parms
+ *   Pointer to input parameters
+ *
+ * Returns:
+ *   0       - Success
+ *   -EINVAL - Parameter error
+ */
+int tf_em_move_int_entry(struct tf *tfp,
+			 struct tf_move_em_entry_parms *parms);
+
 /**
  * Insert record in to external EEM table
  *
drivers/net/bnxt/tf_core/tf_em_hash_internal.c +89 -13

154 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_em_internal.c +188 -27

311 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_msg.c +69 -0

75 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_msg.h +15 -0
index 5ecaf9e7e7..e8662fef0e 100644
@@ -315,6 +315,21 @@ tf_msg_hash_insert_em_internal_entry(struct tf *tfp,
 int tf_msg_delete_em_entry(struct tf *tfp,
 			   struct tf_delete_em_entry_parms *em_parms);
 
+/**
+ * Sends EM internal move request to Firmware
+ *
+ * [in] tfp
+ *   Pointer to TF handle
+ *
+ * [in] em_parms
+ *   Pointer to em move parameters
+ *
+ * Returns:
+ *   0 on Success else internal Truflow error
+ */
+int tf_msg_move_em_entry(struct tf *tfp,
+			 struct tf_move_em_entry_parms *em_parms);
+
 /**
  * Sends Ext EM mem allocation request to Firmware
  *
drivers/net/bnxt/tf_core/tf_session.h +5 -0
index 0b8f63c374..e2cebd20a1 100644
@@ -159,6 +159,11 @@ struct tf_session {
 	 * the pointer to the parent bp struct
 	 */
 	void *bp;
+
+	/**
+	 * EM allocator for session
+	 */
+	void *em_pool[TF_DIR_MAX];
 };
 
 /**
Signature · 1 line
2.21.1 (Apple Git-122.3)
#78 lore raw

PATCH v2 16/58 net/bnxt: update shared session functionality

In reply to Ajit Khaparde

From: Jay Ding <[email protected]>

- Distinguish the shared session on host side using PCI address
- One session could be shared by multiple interfaces.

---
 drivers/net/bnxt/tf_core/tf_core.c        |  9 ---
 drivers/net/bnxt/tf_core/tf_core.h        |  4 ++
 drivers/net/bnxt/tf_core/tf_device.c      | 28 +++++----
 drivers/net/bnxt/tf_core/tf_device_p58.c  |  7 ++-
 drivers/net/bnxt/tf_core/tf_em_internal.c | 23 ++++----
 drivers/net/bnxt/tf_core/tf_identifier.c  | 15 ++---
 drivers/net/bnxt/tf_core/tf_msg.c         | 69 +++++++++++++----------
 drivers/net/bnxt/tf_core/tf_session.c     | 13 ++++-
 drivers/net/bnxt/tf_core/tf_session.h     |  9 +--
 drivers/net/bnxt/tf_core/tf_tbl.c         | 57 ++++++++++++++++---
 drivers/net/bnxt/tf_core/tf_tcam.c        | 15 ++---
 drivers/net/bnxt/tf_core/tfp.c            |  4 +-
 12 files changed, 153 insertions(+), 100 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +0 -9
index 69f5c10293..945e54bfdd 100644
@@ -27,8 +27,6 @@ tf_open_session(struct tf *tfp,
 	int rc;
 	unsigned int domain, bus, slot, device;
 	struct tf_session_open_session_parms oparms;
-	int name_len;
-	char *name;
 
 	TF_CHECK_PARMS2(tfp, parms);
 
@@ -71,13 +69,6 @@ tf_open_session(struct tf *tfp,
 		}
 	}
 
-	name_len = strlen(parms->ctrl_chan_name);
-	name = &parms->ctrl_chan_name[name_len - strlen("tf_shared")];
-	if (!strncmp(name, "tf_shared", strlen("tf_shared"))) {
-		memset(parms->ctrl_chan_name, 0, strlen(parms->ctrl_chan_name));
-		strcpy(parms->ctrl_chan_name, "tf_share");
-	}
-
 	parms->session_id.internal.domain = domain;
 	parms->session_id.internal.bus = bus;
 	parms->session_id.internal.device = device;
drivers/net/bnxt/tf_core/tf_core.h +4 -0
index 08a083077c..3d14dc5391 100644
@@ -458,6 +458,10 @@ struct tf_session_info {
  */
 struct tf {
 	struct tf_session_info *session;
+	/**
+	 * the pointer to the parent bp struct
+	 */
+	void *bp;
 };
 
 /**
drivers/net/bnxt/tf_core/tf_device.c +16 -12
index fed4156200..97ae73fa5a 100644
@@ -44,7 +44,11 @@ tf_dev_reservation_check(uint16_t count,
 		rm_num = (uint16_t *)reservations + i * count;
 		for (j = 0; j < count; j++) {
 			if ((cfg[j].cfg_type == TF_RM_ELEM_CFG_HCAPI ||
-			     cfg[j].cfg_type == TF_RM_ELEM_CFG_HCAPI_BA) &&
+			     cfg[j].cfg_type == TF_RM_ELEM_CFG_HCAPI_BA ||
+			     cfg[j].cfg_type ==
+				TF_RM_ELEM_CFG_HCAPI_BA_PARENT ||
+			     cfg[j].cfg_type ==
+				TF_RM_ELEM_CFG_HCAPI_BA_CHILD) &&
 			     rm_num[j] > 0)
 				cnt++;
 		}
@@ -263,49 +267,49 @@ tf_dev_unbind_p4(struct tf *tfp)
 	 */
 	rc = tf_tcam_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, TCAM\n");
 		fail = true;
 	}
 
 	rc = tf_ident_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, Identifier\n");
 		fail = true;
 	}
 
 	rc = tf_tbl_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, Table Type\n");
 		fail = true;
 	}
 
 	rc = tf_em_ext_common_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, EEM\n");
 		fail = true;
 	}
 
 	rc = tf_em_int_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, EM\n");
 		fail = true;
 	}
 
 	rc = tf_if_tbl_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, IF Table Type\n");
 		fail = true;
 	}
 
 	rc = tf_global_cfg_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, Global Cfg Type\n");
 		fail = true;
 	}
@@ -515,28 +519,28 @@ tf_dev_unbind_p58(struct tf *tfp)
 	 */
 	rc = tf_tcam_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, TCAM\n");
 		fail = true;
 	}
 
 	rc = tf_ident_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, Identifier\n");
 		fail = true;
 	}
 
 	rc = tf_tbl_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, Table Type\n");
 		fail = true;
 	}
 
 	rc = tf_em_int_unbind(tfp);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
+		TFP_DRV_LOG(INFO,
 			    "Device unbind failed, EM\n");
 		fail = true;
 	}
drivers/net/bnxt/tf_core/tf_device_p58.c +5 -2
index 50facce155..a5b055bac7 100644
@@ -190,8 +190,11 @@ static int tf_dev_p58_get_sram_tbl_info(struct tf *tfp __rte_unused,
 	parms.hcapi_type = &hcapi_type;
 
 	rc = tf_rm_get_hcapi_type(&parms);
-	if (rc)
-		return rc;
+	if (rc) {
+		*base = 0;
+		*shift = 0;
+		return 0;
+	}
 
 	switch (hcapi_type) {
 	case CFA_RESOURCE_TYPE_P58_SRAM_BANK_0:
drivers/net/bnxt/tf_core/tf_em_internal.c +11 -12
index eec15b89bc..3b1e4e385d 100644
@@ -509,21 +509,21 @@ tf_em_int_unbind(struct tf *tfp)
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_EM, &em_db_ptr);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "Failed to get em_ext_db from session, rc:%s\n",
+		TFP_DRV_LOG(INFO,
+			    "Em_db is not initialized, rc:%s\n",
 			    strerror(-rc));
-		return rc;
+		return 0;
 	}
 	em_db = (struct em_rm_db *)em_db_ptr;
 
 	for (i = 0; i < TF_DIR_MAX; i++) {
+		if (em_db->em_db[i] == NULL)
+			continue;
 		fparms.dir = i;
 		fparms.rm_db = em_db->em_db[i];
-		if (em_db->em_db[i] != NULL) {
-			rc = tf_rm_free_db(tfp, &fparms);
-			if (rc)
-				return rc;
-		}
+		rc = tf_rm_free_db(tfp, &fparms);
+		if (rc)
+			return rc;
 
 		em_db->em_db[i] = NULL;
 	}
@@ -546,10 +546,9 @@ tf_em_get_resc_info(struct tf *tfp,
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_EM, &em_db_ptr);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "Failed to get em_ext_db from session, rc:%s\n",
-			    strerror(-rc));
-		return rc;
+		TFP_DRV_LOG(INFO,
+			    "No resource allocated for em from session\n");
+		return 0;
 	}
 	em_db = (struct em_rm_db *)em_db_ptr;
 
drivers/net/bnxt/tf_core/tf_identifier.c +8 -7
index 4063f3ba17..ebb975562d 100644
@@ -119,14 +119,16 @@ tf_ident_unbind(struct tf *tfp)
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_IDENTIFIER, &ident_db_ptr);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "Failed to get ident_db from session, rc:%s\n",
+		TFP_DRV_LOG(INFO,
+			    "Ident_db is not initialized, rc:%s\n",
 			    strerror(-rc));
-		return rc;
+		return 0;
 	}
 	ident_db = (struct ident_rm_db *)ident_db_ptr;
 
 	for (i = 0; i < TF_DIR_MAX; i++) {
+		if (ident_db->ident_db[i] == NULL)
+			continue;
 		fparms.rm_db = ident_db->ident_db[i];
 		fparms.dir = i;
 		rc = tf_rm_free_db(tfp, &fparms);
@@ -372,10 +374,9 @@ tf_ident_get_resc_info(struct tf *tfp,
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_IDENTIFIER, &ident_db_ptr);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "Failed to get ident_db from session, rc:%s\n",
-			    strerror(-rc));
-		return rc;
+		TFP_DRV_LOG(INFO,
+			    "No resource allocated for ident from session\n");
+		return 0;
 	}
 	ident_db = (struct ident_rm_db *)ident_db_ptr;
 
drivers/net/bnxt/tf_core/tf_msg.c +38 -31

257 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_session.c +10 -3
index 391d8786ab..93876d8e5d 100644
@@ -59,6 +59,8 @@ tf_session_create(struct tf *tfp,
 	union tf_session_id *session_id;
 	struct tf_dev_info dev;
 	bool shared_session_creator;
+	int name_len;
+	char *name;
 
 	TF_CHECK_PARMS2(tfp, parms);
 
@@ -140,7 +142,6 @@ tf_session_create(struct tf *tfp,
 	session_id->id = session->session_id.id;
 
 	session->shadow_copy = parms->open_cfg->shadow_copy;
-	session->bp = parms->open_cfg->bp;
 
 	/* Init session client list */
 	ll_init(&session->client_ll);
@@ -179,7 +180,12 @@ tf_session_create(struct tf *tfp,
 
 	/* Init session em_ext_db */
 	session->em_ext_db_handle = NULL;
-	if (!strcmp(parms->open_cfg->ctrl_chan_name, "tf_share"))
+
+	/* Populate the request */
+	name_len = strnlen(parms->open_cfg->ctrl_chan_name,
+			   TF_SESSION_NAME_MAX);
+	name = &parms->open_cfg->ctrl_chan_name[name_len - strlen("tf_shared")];
+	if (!strncmp(name, "tf_shared", strlen("tf_shared")))
 		session->shared_session = true;
 
 	if (session->shared_session && shared_session_creator) {
@@ -404,8 +410,9 @@ tf_session_open_session(struct tf *tfp,
 	int rc;
 	struct tf_session_client_create_parms scparms;
 
-	TF_CHECK_PARMS2(tfp, parms);
+	TF_CHECK_PARMS3(tfp, parms, parms->open_cfg->bp);
 
+	tfp->bp = parms->open_cfg->bp;
 	/* Decide if we're creating a new session or session client */
 	if (tfp->session == NULL) {
 		rc = tf_session_create(tfp, parms);
drivers/net/bnxt/tf_core/tf_session.h +2 -7
index e2cebd20a1..034a2213a4 100644
@@ -155,11 +155,6 @@ struct tf_session {
 	 */
 	void *em_db_handle;
 
-	/**
-	 * the pointer to the parent bp struct
-	 */
-	void *bp;
-
 	/**
 	 * EM allocator for session
 	 */
@@ -567,8 +562,8 @@ tf_session_is_shared_session_creator(struct tf_session *tfs)
  *   - the pointer to the parent bnxt struct
  */
 static inline struct bnxt*
-tf_session_get_bp(struct tf_session *tfs)
+tf_session_get_bp(struct tf *tfp)
 {
-	return tfs->bp;
+	return tfp->bp;
 }
 #endif /* _TF_SESSION_H_ */
drivers/net/bnxt/tf_core/tf_tbl.c +49 -8

93 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.c +8 -7
index 70dc539f15..0f05af87f1 100644
@@ -220,14 +220,16 @@ tf_tcam_unbind(struct tf *tfp)
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_TCAM, &tcam_db_ptr);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "Failed to get em_ext_db from session, rc:%s\n",
+		TFP_DRV_LOG(INFO,
+			    "Tcam_db is not initialized, rc:%s\n",
 			    strerror(-rc));
-		return rc;
+		return 0;
 	}
 	tcam_db = (struct tcam_rm_db *)tcam_db_ptr;
 
 	for (i = 0; i < TF_DIR_MAX; i++) {
+		if (tcam_db->tcam_db[i] == NULL)
+			continue;
 		memset(&fparms, 0, sizeof(fparms));
 		fparms.dir = i;
 		fparms.rm_db = tcam_db->tcam_db[i];
@@ -816,10 +818,9 @@ tf_tcam_get_resc_info(struct tf *tfp,
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_TCAM, &tcam_db_ptr);
 	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "Failed to get em_ext_db from session, rc:%s\n",
-			    strerror(-rc));
-		return rc;
+		TFP_DRV_LOG(INFO,
+			    "No resource allocated for tcam from session\n");
+		return 0;
 	}
 	tcam_db = (struct tcam_rm_db *)tcam_db_ptr;
 
drivers/net/bnxt/tf_core/tfp.c +2 -2
index 4d9b37f749..a4b0934610 100644
@@ -134,7 +134,7 @@ tfp_get_fid(struct tf *tfp, uint16_t *fw_fid)
 	if (tfp == NULL || fw_fid == NULL)
 		return -EINVAL;
 
-	bp = container_of(tfp, struct bnxt, tfp);
+	bp = (struct bnxt *)tfp->bp;
 	if (bp == NULL)
 		return -EINVAL;
 
@@ -151,7 +151,7 @@ tfp_get_pf(struct tf *tfp, uint16_t *pf)
 	if (tfp == NULL || pf == NULL)
 		return -EINVAL;
 
-	bp = container_of(tfp, struct bnxt, tfp);
+	bp = (struct bnxt *)tfp->bp;
 	if (BNXT_VF(bp) && bp->parent) {
 		*pf = bp->parent->fid - 1;
 		return 0;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#79 lore raw

PATCH v2 17/58 net/bnxt: modify resource reservation strategy

In reply to Ajit Khaparde

From: Jay Ding <[email protected]>

Allow an application to only reserve resources for one direction.

---
 drivers/net/bnxt/tf_core/tf_core.c        |  4 --
 drivers/net/bnxt/tf_core/tf_em_common.c   | 61 +++++++++++------------
 drivers/net/bnxt/tf_core/tf_em_internal.c | 13 +++--
 drivers/net/bnxt/tf_core/tf_identifier.c  | 15 +++---
 drivers/net/bnxt/tf_core/tf_tbl.c         | 12 +++--
 drivers/net/bnxt/tf_core/tf_tcam.c        | 14 ++++--
 6 files changed, 65 insertions(+), 54 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +0 -4
index 945e54bfdd..de2a93646f 100644
@@ -1636,7 +1636,6 @@ int tf_get_session_info(struct tf *tfp,
 		TFP_DRV_LOG(ERR,
 			    "Ident get resc info failed, rc:%s\n",
 			    strerror(-rc));
-		return rc;
 	}
 
 	if (dev->ops->tf_dev_get_tbl_resc_info == NULL) {
@@ -1652,7 +1651,6 @@ int tf_get_session_info(struct tf *tfp,
 		TFP_DRV_LOG(ERR,
 			    "Tbl get resc info failed, rc:%s\n",
 			    strerror(-rc));
-		return rc;
 	}
 
 	if (dev->ops->tf_dev_get_tcam_resc_info == NULL) {
@@ -1668,7 +1666,6 @@ int tf_get_session_info(struct tf *tfp,
 		TFP_DRV_LOG(ERR,
 			    "TCAM get resc info failed, rc:%s\n",
 			    strerror(-rc));
-		return rc;
 	}
 
 	if (dev->ops->tf_dev_get_em_resc_info == NULL) {
@@ -1684,7 +1681,6 @@ int tf_get_session_info(struct tf *tfp,
 		TFP_DRV_LOG(ERR,
 			    "EM get resc info failed, rc:%s\n",
 			    strerror(-rc));
-		return rc;
 	}
 
 	return 0;
drivers/net/bnxt/tf_core/tf_em_common.c +30 -31

91 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_em_internal.c +9 -4
index 3b1e4e385d..93de513989 100644
@@ -349,6 +349,7 @@ tf_em_int_bind(struct tf *tfp,
 	       struct tf_em_cfg_parms *parms)
 {
 	int rc;
+	int db_rc[TF_DIR_MAX] = { 0 };
 	int i;
 	struct tf_rm_create_db_parms db_cfg = { 0 };
 	struct tf_rm_get_alloc_info_parms iparms;
@@ -408,18 +409,22 @@ tf_em_int_bind(struct tf *tfp,
 		db_cfg.rm_db = (void *)&em_db->em_db[i];
 		if (tf_session_is_shared_session(tfs) &&
 			(!tf_session_is_shared_session_creator(tfs)))
-			rc = tf_rm_create_db_no_reservation(tfp, &db_cfg);
+			db_rc[i] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
 		else
-			rc = tf_rm_create_db(tfp, &db_cfg);
-		if (rc) {
+			db_rc[i] = tf_rm_create_db(tfp, &db_cfg);
+		if (db_rc[i]) {
 			TFP_DRV_LOG(ERR,
 				    "%s: EM Int DB creation failed\n",
 				    tf_dir_2_str(i));
 
-			return rc;
 		}
 	}
 
+	/* No db created */
+	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+		return db_rc[TF_DIR_RX];
+
+
 	if (!tf_session_is_shared_session(tfs)) {
 		for (i = 0; i < TF_DIR_MAX; i++) {
 			iparms.rm_db = em_db->em_db[i];
drivers/net/bnxt/tf_core/tf_identifier.c +9 -6
index ebb975562d..3cc87de4ef 100644
@@ -30,6 +30,7 @@ tf_ident_bind(struct tf *tfp,
 	      struct tf_ident_cfg_parms *parms)
 {
 	int rc;
+	int db_rc[TF_DIR_MAX] = { 0 };
 	int i;
 	struct tf_rm_create_db_parms db_cfg = { 0 };
 	struct tf_shadow_ident_cfg_parms shadow_cfg = { 0 };
@@ -70,15 +71,13 @@ tf_ident_bind(struct tf *tfp,
 		db_cfg.alloc_cnt = parms->resources->ident_cnt[i].cnt;
 		if (tf_session_is_shared_session(tfs) &&
 			(!tf_session_is_shared_session_creator(tfs)))
-			rc = tf_rm_create_db_no_reservation(tfp, &db_cfg);
+			db_rc[i] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
 		else
-			rc = tf_rm_create_db(tfp, &db_cfg);
-		if (rc) {
-			TFP_DRV_LOG(ERR,
+			db_rc[i] = tf_rm_create_db(tfp, &db_cfg);
+		if (db_rc[i]) {
+			TFP_DRV_LOG(INFO,
 				    "%s: Identifier DB creation failed\n",
 				    tf_dir_2_str(i));
-
-			return rc;
 		}
 
 		if (parms->shadow_copy) {
@@ -99,6 +98,10 @@ tf_ident_bind(struct tf *tfp,
 		}
 	}
 
+	/* No db created */
+	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+		return db_rc[TF_DIR_RX];
+
 	TFP_DRV_LOG(INFO,
 		    "Identifier - initialized\n");
 
drivers/net/bnxt/tf_core/tf_tbl.c +8 -4
index ca1aef8ebf..192115183b 100644
@@ -41,6 +41,7 @@ tf_tbl_bind(struct tf *tfp,
 	    struct tf_tbl_cfg_parms *parms)
 {
 	int rc, d, i;
+	int db_rc[TF_DIR_MAX] = { 0 };
 	struct tf_rm_create_db_parms db_cfg = { 0 };
 	struct tbl_rm_db *tbl_db;
 	struct tfp_calloc_parms cparms;
@@ -79,18 +80,21 @@ tf_tbl_bind(struct tf *tfp,
 		db_cfg.rm_db = (void *)&tbl_db->tbl_db[d];
 		if (tf_session_is_shared_session(tfs) &&
 			(!tf_session_is_shared_session_creator(tfs)))
-			rc = tf_rm_create_db_no_reservation(tfp, &db_cfg);
+			db_rc[d] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
 		else
-			rc = tf_rm_create_db(tfp, &db_cfg);
-		if (rc) {
+			db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
+		if (db_rc[d]) {
 			TFP_DRV_LOG(ERR,
 				    "%s: Table DB creation failed\n",
 				    tf_dir_2_str(d));
 
-			return rc;
 		}
 	}
 
+	/* No db created */
+	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+		return db_rc[TF_DIR_RX];
+
 	TFP_DRV_LOG(INFO,
 		    "Table Type - initialized\n");
 
drivers/net/bnxt/tf_core/tf_tcam.c +9 -5
index 0f05af87f1..ce959e3923 100644
@@ -33,6 +33,7 @@ tf_tcam_bind(struct tf *tfp,
 	     struct tf_tcam_cfg_parms *parms)
 {
 	int rc;
+	int db_rc[TF_DIR_MAX] = { 0 };
 	int i, d;
 	struct tf_rm_alloc_info info;
 	struct tf_rm_free_db_parms fparms;
@@ -109,17 +110,20 @@ tf_tcam_bind(struct tf *tfp,
 		db_cfg.rm_db = (void *)&tcam_db->tcam_db[d];
 		if (tf_session_is_shared_session(tfs) &&
 			(!tf_session_is_shared_session_creator(tfs)))
-			rc = tf_rm_create_db_no_reservation(tfp, &db_cfg);
+			db_rc[d] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
 		else
-			rc = tf_rm_create_db(tfp, &db_cfg);
-		if (rc) {
-			TFP_DRV_LOG(ERR,
+			db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
+		if (db_rc[d]) {
+			TFP_DRV_LOG(INFO,
 				    "%s: TCAM DB creation failed\n",
 				    tf_dir_2_str(d));
-			return rc;
 		}
 	}
 
+	/* No db created */
+	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+		return db_rc[TF_DIR_RX];
+
 	/* check if reserved resource for WC is multiple of num_slices */
 	for (d = 0; d < TF_DIR_MAX; d++) {
 		memset(&info, 0, sizeof(info));
Signature · 1 line
2.21.1 (Apple Git-122.3)
#80 lore raw

PATCH v2 18/58 net/bnxt: shared TCAM region support

In reply to Ajit Khaparde

From: Farah Smith <[email protected]>

- switch to single slice management on Wh+
- Support of shared session WC_TCAM_HIGH and WC_TCAM_LOW regions
- Enable/disable using TF_TCAM_SHARED flag in tf_core.h
- Fix empty session module DBs in the case that none are allocated for a given module type

---
 drivers/net/bnxt/tf_core/meson.build      |  25 +-
 drivers/net/bnxt/tf_core/tf_core.h        |  45 +-
 drivers/net/bnxt/tf_core/tf_device.c      |  72 ++-
 drivers/net/bnxt/tf_core/tf_device.h      |   4 +-
 drivers/net/bnxt/tf_core/tf_device_p4.c   |  17 +-
 drivers/net/bnxt/tf_core/tf_device_p58.c  |  13 +-
 drivers/net/bnxt/tf_core/tf_identifier.c  |   2 +-
 drivers/net/bnxt/tf_core/tf_tbl.c         |   5 +-
 drivers/net/bnxt/tf_core/tf_tcam.c        |   5 +-
 drivers/net/bnxt/tf_core/tf_tcam_shared.c | 744 ++++++++++++++++++++++
 drivers/net/bnxt/tf_core/tf_tcam_shared.h | 127 ++++
 drivers/net/bnxt/tf_core/tf_util.c        |   6 +
 12 files changed, 1014 insertions(+), 51 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/tf_tcam_shared.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_tcam_shared.h
drivers/net/bnxt/tf_core/meson.build +13 -12
index 3a91f04bc0..f28e77ec2e 100644
@@ -10,26 +10,27 @@ sources += files(
         'tf_core.c',
         'bitalloc.c',
         'tf_msg.c',
-	'dpool.c',
+        'll.c',
+        'dpool.c',
         'rand.c',
         'stack.c',
-        'tf_em_common.c',
-        'tf_em_internal.c',
         'tf_rm.c',
         'tf_tbl.c',
+        'tf_em_common.c',
+        'tf_em_host.c',
+        'tf_em_internal.c',
+        'tf_em_hash_internal.c',
         'tfp.c',
-        'tf_session.c',
+        'tf_util.c',
         'tf_device.c',
         'tf_device_p4.c',
-        'tf_device_p58.c',
+        'tf_global_cfg.c',
         'tf_identifier.c',
+        'tf_if_tbl.c',
+        'tf_session.c',
         'tf_shadow_tcam.c',
         'tf_tcam.c',
-        'tf_util.c',
-        'tf_if_tbl.c',
-        'll.c',
-        'tf_global_cfg.c',
-        'tf_em_host.c',
-        'tf_em_hash_internal.c',
+        'tf_tcam_shared.c',
         'tf_shadow_identifier.c',
-        'tf_hash.c')
+        'tf_hash.c',
+        'tf_device_p58.c')
drivers/net/bnxt/tf_core/tf_core.h +41 -4

81 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device.c +49 -23

120 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device.h +3 -1
index 31806bb289..ea4dcfb8e2 100644
@@ -10,6 +10,9 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
+#ifdef TF_TCAM_SHARED
+#include "tf_tcam_shared.h"
+#endif
 #include "tf_if_tbl.h"
 #include "tf_global_cfg.h"
 
@@ -136,7 +139,6 @@ struct tf_dev_ops {
 				       uint16_t resource_id,
 				       const char **resource_str);
 
-
 	/**
 	 * Retrieves the WC TCAM slice information that the device
 	 * supports.
drivers/net/bnxt/tf_core/tf_device_p4.c +14 -3
index e74ba6cd8f..0d3c35ae3b 100644
@@ -10,6 +10,9 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
+#ifdef TF_TCAM_SHARED
+#include "tf_tcam_shared.h"
+#endif /* TF_TCAM_SHARED */
 #include "tf_em.h"
 #include "tf_if_tbl.h"
 #include "tfp.h"
@@ -137,7 +140,8 @@ tf_dev_p4_get_tcam_slice_info(struct tf *tfp __rte_unused,
 			      uint16_t key_sz,
 			      uint16_t *num_slices_per_row)
 {
-#define CFA_P4_WC_TCAM_SLICES_PER_ROW 2
+/* Single slice support */
+#define CFA_P4_WC_TCAM_SLICES_PER_ROW 1
 #define CFA_P4_WC_TCAM_SLICE_SIZE     12
 
 	if (type == TF_TCAM_TBL_TYPE_WC_TCAM) {
@@ -263,11 +267,18 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_get_tbl = tf_tbl_get,
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
 	.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
+#ifdef TF_TCAM_SHARED
+	.tf_dev_alloc_tcam = tf_tcam_shared_alloc,
+	.tf_dev_free_tcam = tf_tcam_shared_free,
+	.tf_dev_set_tcam = tf_tcam_shared_set,
+	.tf_dev_get_tcam = tf_tcam_shared_get,
+#else /* !TF_TCAM_SHARED */
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
-	.tf_dev_get_tcam = NULL,
+	.tf_dev_get_tcam = tf_tcam_get,
+#endif
+	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
 	.tf_dev_insert_int_em_entry = tf_em_insert_int_entry,
 	.tf_dev_delete_int_em_entry = tf_em_delete_int_entry,
drivers/net/bnxt/tf_core/tf_device_p58.c +11 -2
index a5b055bac7..5bf52379a7 100644
@@ -10,6 +10,9 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
+#ifdef TF_TCAM_SHARED
+#include "tf_tcam_shared.h"
+#endif /* TF_TCAM_SHARED */
 #include "tf_em.h"
 #include "tf_if_tbl.h"
 #include "tfp.h"
@@ -148,7 +151,6 @@ static int tf_dev_p58_word_align(uint16_t size)
 	return ((((size) + 63) >> 6) * 8);
 }
 
-
 #define TF_DEV_P58_BANK_SZ_64B 2048
 /**
  * Get SRAM table information.
@@ -287,11 +289,18 @@ const struct tf_dev_ops tf_dev_ops_p58 = {
 	.tf_dev_get_tbl = tf_tbl_get,
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
 	.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
+#ifdef TF_TCAM_SHARED
+	.tf_dev_alloc_tcam = tf_tcam_shared_alloc,
+	.tf_dev_free_tcam = tf_tcam_shared_free,
+	.tf_dev_set_tcam = tf_tcam_set,
+	.tf_dev_get_tcam = tf_tcam_get,
+#else /* !TF_TCAM_SHARED */
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
 	.tf_dev_get_tcam = tf_tcam_get,
+#endif
+	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
 	.tf_dev_insert_int_em_entry = tf_em_hash_insert_int_entry,
 	.tf_dev_delete_int_em_entry = tf_em_hash_delete_int_entry,
drivers/net/bnxt/tf_core/tf_identifier.c +1 -1
index 3cc87de4ef..3575c3e1a0 100644
@@ -76,7 +76,7 @@ tf_ident_bind(struct tf *tfp,
 			db_rc[i] = tf_rm_create_db(tfp, &db_cfg);
 		if (db_rc[i]) {
 			TFP_DRV_LOG(INFO,
-				    "%s: Identifier DB creation failed\n",
+				    "%s: No Identifier DB required\n",
 				    tf_dir_2_str(i));
 		}
 
drivers/net/bnxt/tf_core/tf_tbl.c +1 -4
index 192115183b..295204ac87 100644
@@ -85,7 +85,7 @@ tf_tbl_bind(struct tf *tfp,
 			db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
 		if (db_rc[d]) {
 			TFP_DRV_LOG(ERR,
-				    "%s: Table DB creation failed\n",
+				    "%s: No Table DB creation required\n",
 				    tf_dir_2_str(d));
 
 		}
@@ -656,7 +656,6 @@ tf_tbl_get_resc_info(struct tf *tfp,
 	}
 	tbl_db = (struct tbl_rm_db *)tbl_db_ptr;
 
-
 	/* check if reserved resource for WC is multiple of num_slices */
 	for (d = 0; d < TF_DIR_MAX; d++) {
 		ainfo.rm_db = tbl_db->tbl_db[d];
@@ -693,7 +692,5 @@ tf_tbl_get_resc_info(struct tf *tfp,
 		}
 	}
 
-
-
 	return 0;
 }
drivers/net/bnxt/tf_core/tf_tcam.c +4 -1
index ce959e3923..5c018f7003 100644
@@ -115,7 +115,7 @@ tf_tcam_bind(struct tf *tfp,
 			db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
 		if (db_rc[d]) {
 			TFP_DRV_LOG(INFO,
-				    "%s: TCAM DB creation failed\n",
+				    "%s: no TCAM DB required\n",
 				    tf_dir_2_str(d));
 		}
 	}
@@ -126,6 +126,9 @@ tf_tcam_bind(struct tf *tfp,
 
 	/* check if reserved resource for WC is multiple of num_slices */
 	for (d = 0; d < TF_DIR_MAX; d++) {
+		if (!tcam_db->tcam_db[d])
+			continue;
+
 		memset(&info, 0, sizeof(info));
 		ainfo.rm_db = tcam_db->tcam_db[d];
 		ainfo.subtype = TF_TCAM_TBL_TYPE_WC_TCAM;
drivers/net/bnxt/tf_core/tf_tcam_shared.c new file +744 -0

744 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam_shared.h new file +127 -0

127 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_util.c +6 -0
index 25f5c152d2..e712816209 100644
@@ -59,6 +59,12 @@ tf_tcam_tbl_2_str(enum tf_tcam_tbl_type tcam_type)
 		return "sp_tcam";
 	case TF_TCAM_TBL_TYPE_CT_RULE_TCAM:
 		return "ct_rule_tcam";
+#ifdef TF_TCAM_SHARED
+	case TF_TCAM_TBL_TYPE_WC_TCAM_HIGH:
+		return "wc_tcam_hi";
+	case TF_TCAM_TBL_TYPE_WC_TCAM_LOW:
+		return "wc_tcam_lo";
+#endif
 	default:
 		return "Invalid tcam table type";
 	}
Signature · 1 line
2.21.1 (Apple Git-122.3)
#81 lore raw

Re: [dpdk-dev] [PATCH v2 18/58] net/bnxt: shared TCAM region support

Please make the title start with an imperative verb. One more nit below.

13/06/2021 02:06, Ajit Khaparde:

Quoted 13 lines

From: Farah Smith <[email protected]>

- switch to single slice management on Wh+
- Support of shared session WC_TCAM_HIGH and WC_TCAM_LOW regions
- Enable/disable using TF_TCAM_SHARED flag in tf_core.h
- Fix empty session module DBs in the case that none are allocated for a given module type

[...]

Quoted 12 lines

+++ b/drivers/net/bnxt/tf_core/tf_tcam_shared.c

drivers/net/bnxt/tf_core/tf_tcam_shared.c new file +10 -0
@@ -0,0 +1,744 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019-2021 Broadcom
+ * All rights reserved.
+ */
+
+#include <string.h>
+#include <rte_common.h>
+
+#include "tf_tcam_shared.h"
+#include "tf_tcam.h"

drivers/net/bnxt/tf_core/tf_tcam_shared.c line 20

Quoted 10 lines
drivers/net/bnxt/tf_core/tf_tcam_shared.c new file +10 -0
+#include "tf_common.h"
+#include "tf_util.h"
+#include "tf_rm.h"
+#include "tf_device.h"
+#include "tfp.h"
+#include "tf_session.h"
+#include "tf_msg.h"
+#include "bitalloc.h"
+#include "tf_core.h"
+#include "tf_rm.h"

tf_rm.h is already included.

#82 lore raw

PATCH v3 1/1 net/bnxt: shared TCAM region support

From: Farah Smith <[email protected]>

- switch to single slice management on Wh+
- Support of shared session WC_TCAM_HIGH and WC_TCAM_LOW regions
- Enable/disable using TF_TCAM_SHARED flag in tf_core.h
- Fix empty session module DBs in the case that none are allocated for a given module type

---
v1->v2: rebased to latest code base.
v2->v3: addressed review comments.

---
 drivers/net/bnxt/tf_core/meson.build      |  25 +-
 drivers/net/bnxt/tf_core/tf_core.h        |  45 +-
 drivers/net/bnxt/tf_core/tf_device.c      |  72 ++-
 drivers/net/bnxt/tf_core/tf_device.h      |   4 +-
 drivers/net/bnxt/tf_core/tf_device_p4.c   |  17 +-
 drivers/net/bnxt/tf_core/tf_device_p58.c  |  13 +-
 drivers/net/bnxt/tf_core/tf_identifier.c  |   2 +-
 drivers/net/bnxt/tf_core/tf_tbl.c         |   5 +-
 drivers/net/bnxt/tf_core/tf_tcam.c        |   5 +-
 drivers/net/bnxt/tf_core/tf_tcam_shared.c | 743 ++++++++++++++++++++++
 drivers/net/bnxt/tf_core/tf_tcam_shared.h | 127 ++++
 drivers/net/bnxt/tf_core/tf_util.c        |   6 +
 12 files changed, 1013 insertions(+), 51 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/tf_tcam_shared.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_tcam_shared.h
drivers/net/bnxt/tf_core/meson.build +13 -12
index 3a91f04bc0..f28e77ec2e 100644
@@ -10,26 +10,27 @@ sources += files(
         'tf_core.c',
         'bitalloc.c',
         'tf_msg.c',
-	'dpool.c',
+        'll.c',
+        'dpool.c',
         'rand.c',
         'stack.c',
-        'tf_em_common.c',
-        'tf_em_internal.c',
         'tf_rm.c',
         'tf_tbl.c',
+        'tf_em_common.c',
+        'tf_em_host.c',
+        'tf_em_internal.c',
+        'tf_em_hash_internal.c',
         'tfp.c',
-        'tf_session.c',
+        'tf_util.c',
         'tf_device.c',
         'tf_device_p4.c',
-        'tf_device_p58.c',
+        'tf_global_cfg.c',
         'tf_identifier.c',
+        'tf_if_tbl.c',
+        'tf_session.c',
         'tf_shadow_tcam.c',
         'tf_tcam.c',
-        'tf_util.c',
-        'tf_if_tbl.c',
-        'll.c',
-        'tf_global_cfg.c',
-        'tf_em_host.c',
-        'tf_em_hash_internal.c',
+        'tf_tcam_shared.c',
         'tf_shadow_identifier.c',
-        'tf_hash.c')
+        'tf_hash.c',
+        'tf_device_p58.c')
drivers/net/bnxt/tf_core/tf_core.h +41 -4

81 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device.c +49 -23

120 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device.h +3 -1
index 31806bb289..ea4dcfb8e2 100644
@@ -10,6 +10,9 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
+#ifdef TF_TCAM_SHARED
+#include "tf_tcam_shared.h"
+#endif
 #include "tf_if_tbl.h"
 #include "tf_global_cfg.h"
 
@@ -136,7 +139,6 @@ struct tf_dev_ops {
 				       uint16_t resource_id,
 				       const char **resource_str);
 
-
 	/**
 	 * Retrieves the WC TCAM slice information that the device
 	 * supports.
drivers/net/bnxt/tf_core/tf_device_p4.c +14 -3
index e74ba6cd8f..0d3c35ae3b 100644
@@ -10,6 +10,9 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
+#ifdef TF_TCAM_SHARED
+#include "tf_tcam_shared.h"
+#endif /* TF_TCAM_SHARED */
 #include "tf_em.h"
 #include "tf_if_tbl.h"
 #include "tfp.h"
@@ -137,7 +140,8 @@ tf_dev_p4_get_tcam_slice_info(struct tf *tfp __rte_unused,
 			      uint16_t key_sz,
 			      uint16_t *num_slices_per_row)
 {
-#define CFA_P4_WC_TCAM_SLICES_PER_ROW 2
+/* Single slice support */
+#define CFA_P4_WC_TCAM_SLICES_PER_ROW 1
 #define CFA_P4_WC_TCAM_SLICE_SIZE     12
 
 	if (type == TF_TCAM_TBL_TYPE_WC_TCAM) {
@@ -263,11 +267,18 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_get_tbl = tf_tbl_get,
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
 	.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
+#ifdef TF_TCAM_SHARED
+	.tf_dev_alloc_tcam = tf_tcam_shared_alloc,
+	.tf_dev_free_tcam = tf_tcam_shared_free,
+	.tf_dev_set_tcam = tf_tcam_shared_set,
+	.tf_dev_get_tcam = tf_tcam_shared_get,
+#else /* !TF_TCAM_SHARED */
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
-	.tf_dev_get_tcam = NULL,
+	.tf_dev_get_tcam = tf_tcam_get,
+#endif
+	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
 	.tf_dev_insert_int_em_entry = tf_em_insert_int_entry,
 	.tf_dev_delete_int_em_entry = tf_em_delete_int_entry,
drivers/net/bnxt/tf_core/tf_device_p58.c +11 -2
index a5b055bac7..5bf52379a7 100644
@@ -10,6 +10,9 @@
 #include "tf_identifier.h"
 #include "tf_tbl.h"
 #include "tf_tcam.h"
+#ifdef TF_TCAM_SHARED
+#include "tf_tcam_shared.h"
+#endif /* TF_TCAM_SHARED */
 #include "tf_em.h"
 #include "tf_if_tbl.h"
 #include "tfp.h"
@@ -148,7 +151,6 @@ static int tf_dev_p58_word_align(uint16_t size)
 	return ((((size) + 63) >> 6) * 8);
 }
 
-
 #define TF_DEV_P58_BANK_SZ_64B 2048
 /**
  * Get SRAM table information.
@@ -287,11 +289,18 @@ const struct tf_dev_ops tf_dev_ops_p58 = {
 	.tf_dev_get_tbl = tf_tbl_get,
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
 	.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
+#ifdef TF_TCAM_SHARED
+	.tf_dev_alloc_tcam = tf_tcam_shared_alloc,
+	.tf_dev_free_tcam = tf_tcam_shared_free,
+	.tf_dev_set_tcam = tf_tcam_set,
+	.tf_dev_get_tcam = tf_tcam_get,
+#else /* !TF_TCAM_SHARED */
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
 	.tf_dev_get_tcam = tf_tcam_get,
+#endif
+	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_get_tcam_resc_info = tf_tcam_get_resc_info,
 	.tf_dev_insert_int_em_entry = tf_em_hash_insert_int_entry,
 	.tf_dev_delete_int_em_entry = tf_em_hash_delete_int_entry,
drivers/net/bnxt/tf_core/tf_identifier.c +1 -1
index 3cc87de4ef..3575c3e1a0 100644
@@ -76,7 +76,7 @@ tf_ident_bind(struct tf *tfp,
 			db_rc[i] = tf_rm_create_db(tfp, &db_cfg);
 		if (db_rc[i]) {
 			TFP_DRV_LOG(INFO,
-				    "%s: Identifier DB creation failed\n",
+				    "%s: No Identifier DB required\n",
 				    tf_dir_2_str(i));
 		}
 
drivers/net/bnxt/tf_core/tf_tbl.c +1 -4
index 192115183b..295204ac87 100644
@@ -85,7 +85,7 @@ tf_tbl_bind(struct tf *tfp,
 			db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
 		if (db_rc[d]) {
 			TFP_DRV_LOG(ERR,
-				    "%s: Table DB creation failed\n",
+				    "%s: No Table DB creation required\n",
 				    tf_dir_2_str(d));
 
 		}
@@ -656,7 +656,6 @@ tf_tbl_get_resc_info(struct tf *tfp,
 	}
 	tbl_db = (struct tbl_rm_db *)tbl_db_ptr;
 
-
 	/* check if reserved resource for WC is multiple of num_slices */
 	for (d = 0; d < TF_DIR_MAX; d++) {
 		ainfo.rm_db = tbl_db->tbl_db[d];
@@ -693,7 +692,5 @@ tf_tbl_get_resc_info(struct tf *tfp,
 		}
 	}
 
-
-
 	return 0;
 }
drivers/net/bnxt/tf_core/tf_tcam.c +4 -1
index ce959e3923..5c018f7003 100644
@@ -115,7 +115,7 @@ tf_tcam_bind(struct tf *tfp,
 			db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
 		if (db_rc[d]) {
 			TFP_DRV_LOG(INFO,
-				    "%s: TCAM DB creation failed\n",
+				    "%s: no TCAM DB required\n",
 				    tf_dir_2_str(d));
 		}
 	}
@@ -126,6 +126,9 @@ tf_tcam_bind(struct tf *tfp,
 
 	/* check if reserved resource for WC is multiple of num_slices */
 	for (d = 0; d < TF_DIR_MAX; d++) {
+		if (!tcam_db->tcam_db[d])
+			continue;
+
 		memset(&info, 0, sizeof(info));
 		ainfo.rm_db = tcam_db->tcam_db[d];
 		ainfo.subtype = TF_TCAM_TBL_TYPE_WC_TCAM;
drivers/net/bnxt/tf_core/tf_tcam_shared.c new file +743 -0

743 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam_shared.h new file +127 -0

127 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_util.c +6 -0
index 25f5c152d2..e712816209 100644
@@ -59,6 +59,12 @@ tf_tcam_tbl_2_str(enum tf_tcam_tbl_type tcam_type)
 		return "sp_tcam";
 	case TF_TCAM_TBL_TYPE_CT_RULE_TCAM:
 		return "ct_rule_tcam";
+#ifdef TF_TCAM_SHARED
+	case TF_TCAM_TBL_TYPE_WC_TCAM_HIGH:
+		return "wc_tcam_hi";
+	case TF_TCAM_TBL_TYPE_WC_TCAM_LOW:
+		return "wc_tcam_lo";
+#endif
 	default:
 		return "Invalid tcam table type";
 	}
Signature · 1 line
2.21.1 (Apple Git-122.3)
#83 lore raw

Re: [dpdk-dev] [PATCH v2 18/58] net/bnxt: shared TCAM region support

In reply to Thomas Monjalon
Quoted 2 lines · Thomas Monjalon

Please make the title start with an imperative verb.

During the merge, modified the title to:
add shared TCAM region support.

Quoted 33 lines

One more nit below.

13/06/2021 02:06, Ajit Khaparde:

Quoted 13 lines

From: Farah Smith <[email protected]>

- switch to single slice management on Wh+
- Support of shared session WC_TCAM_HIGH and WC_TCAM_LOW regions
- Enable/disable using TF_TCAM_SHARED flag in tf_core.h
- Fix empty session module DBs in the case that none are allocated for a given module type

[...]

Quoted 16 lines

+++ b/drivers/net/bnxt/tf_core/tf_tcam_shared.c

drivers/net/bnxt/tf_core/tf_tcam_shared.c new file +14 -0
@@ -0,0 +1,744 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019-2021 Broadcom
+ * All rights reserved.
+ */
+
+#include <string.h>
+#include <rte_common.h>
+
+#include "tf_tcam_shared.h"
+#include "tf_tcam.h"
+#include "tf_common.h"
+#include "tf_util.h"
+#include "tf_rm.h"
+#include "tf_device.h"
Quoted 9 lines

drivers/net/bnxt/tf_core/tf_tcam_shared.c line 20

Quoted 6 lines
drivers/net/bnxt/tf_core/tf_tcam_shared.c new file +6 -0
+#include "tfp.h"
+#include "tf_session.h"
+#include "tf_msg.h"
+#include "bitalloc.h"
+#include "tf_core.h"
+#include "tf_rm.h"

tf_rm.h is already included.

Removed.

Updated patch merged in dpdk-next-net-brcm. Thanks

#84 lore raw

PATCH v2 19/58 net/bnxt: cleanup logs in session handling paths

In reply to Ajit Khaparde

From: Farah Smith <[email protected]>

Cleanup some of the log messages in the session open and close paths.

---
 drivers/net/bnxt/tf_core/tf_device.c      | 90 ++++++++++++-----------
 drivers/net/bnxt/tf_core/tf_em_internal.c | 13 +---
 drivers/net/bnxt/tf_core/tf_identifier.c  | 15 +---
 drivers/net/bnxt/tf_core/tf_if_tbl.c      | 18 +----
 drivers/net/bnxt/tf_core/tf_session.c     | 18 +++--
 drivers/net/bnxt/tf_core/tf_tbl.c         | 18 ++---
 drivers/net/bnxt/tf_core/tf_tcam.c        | 12 +--
 7 files changed, 77 insertions(+), 107 deletions(-)
drivers/net/bnxt/tf_core/tf_device.c +49 -41
index 55cf55886a..498e668b16 100644
@@ -216,20 +216,20 @@ tf_dev_bind_p4(struct tf *tfp,
 		return -ENOMEM;
 	}
 
-	if (!tf_session_is_shared_session(tfs)) {
-		/*
-		 * IF_TBL
-		 */
-		if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
-		if_tbl_cfg.cfg = tf_if_tbl_p4;
-		if_tbl_cfg.shadow_copy = shadow_copy;
-		rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
-		if (rc) {
-			TFP_DRV_LOG(ERR,
-				    "IF Table initialization failure\n");
-			goto fail;
-		}
+	/*
+	 * IF_TBL
+	 */
+	if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
+	if_tbl_cfg.cfg = tf_if_tbl_p4;
+	if_tbl_cfg.shadow_copy = shadow_copy;
+	rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "IF Table initialization failure\n");
+		goto fail;
+	}
 
+	if (!tf_session_is_shared_session(tfs)) {
 		/*
 		 * GLOBAL_CFG
 		 */
@@ -271,6 +271,12 @@ tf_dev_unbind_p4(struct tf *tfp)
 {
 	int rc = 0;
 	bool fail = false;
+	struct tf_session *tfs;
+
+	/* Retrieve the session information */
+	rc = tf_session_get_session_internal(tfp, &tfs);
+	if (rc)
+		return rc;
 
 	/* Unbind all the support modules. As this is only done on
 	 * close we only report errors as everything has to be cleaned
@@ -318,18 +324,20 @@ tf_dev_unbind_p4(struct tf *tfp)
 		fail = true;
 	}
 
-	rc = tf_if_tbl_unbind(tfp);
-	if (rc) {
-		TFP_DRV_LOG(INFO,
-			    "Device unbind failed, IF Table Type\n");
-		fail = true;
-	}
+	if (!tf_session_is_shared_session(tfs)) {
+		rc = tf_if_tbl_unbind(tfp);
+		if (rc) {
+			TFP_DRV_LOG(INFO,
+				    "Device unbind failed, IF Table Type\n");
+			fail = true;
+		}
 
-	rc = tf_global_cfg_unbind(tfp);
-	if (rc) {
-		TFP_DRV_LOG(INFO,
-			    "Device unbind failed, Global Cfg Type\n");
-		fail = true;
+		rc = tf_global_cfg_unbind(tfp);
+		if (rc) {
+			TFP_DRV_LOG(INFO,
+				    "Device unbind failed, Global Cfg Type\n");
+			fail = true;
+		}
 	}
 
 	if (fail)
@@ -472,17 +480,17 @@ tf_dev_bind_p58(struct tf *tfp,
 	/*
 	 * IF_TBL
 	 */
-	if (!tf_session_is_shared_session(tfs)) {
-		if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
-		if_tbl_cfg.cfg = tf_if_tbl_p58;
-		if_tbl_cfg.shadow_copy = shadow_copy;
-		rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
-		if (rc) {
-			TFP_DRV_LOG(ERR,
-				    "IF Table initialization failure\n");
-			goto fail;
-		}
+	if_tbl_cfg.num_elements = TF_IF_TBL_TYPE_MAX;
+	if_tbl_cfg.cfg = tf_if_tbl_p58;
+	if_tbl_cfg.shadow_copy = shadow_copy;
+	rc = tf_if_tbl_bind(tfp, &if_tbl_cfg);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "IF Table initialization failure\n");
+		goto fail;
+	}
 
+	if (!tf_session_is_shared_session(tfs)) {
 		/*
 		 * GLOBAL_CFG
 		 */
@@ -571,14 +579,14 @@ tf_dev_unbind_p58(struct tf *tfp)
 		fail = true;
 	}
 
-	if (!tf_session_is_shared_session(tfs)) {
-		rc = tf_if_tbl_unbind(tfp);
-		if (rc) {
-			TFP_DRV_LOG(ERR,
-				    "Device unbind failed, IF Table Type\n");
-			fail = true;
-		}
+	rc = tf_if_tbl_unbind(tfp);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "Device unbind failed, IF Table Type\n");
+		fail = true;
+	}
 
+	if (!tf_session_is_shared_session(tfs)) {
 		rc = tf_global_cfg_unbind(tfp);
 		if (rc) {
 			TFP_DRV_LOG(ERR,
drivers/net/bnxt/tf_core/tf_em_internal.c +3 -10
index 93de513989..28ffbd5876 100644
@@ -412,17 +412,13 @@ tf_em_int_bind(struct tf *tfp,
 			db_rc[i] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
 		else
 			db_rc[i] = tf_rm_create_db(tfp, &db_cfg);
-		if (db_rc[i]) {
-			TFP_DRV_LOG(ERR,
-				    "%s: EM Int DB creation failed\n",
-				    tf_dir_2_str(i));
-
-		}
 	}
 
 	/* No db created */
-	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX]) {
+		TFP_DRV_LOG(ERR, "EM Int DB creation failed\n");
 		return db_rc[TF_DIR_RX];
+	}
 
 
 	if (!tf_session_is_shared_session(tfs)) {
@@ -514,9 +510,6 @@ tf_em_int_unbind(struct tf *tfp)
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_EM, &em_db_ptr);
 	if (rc) {
-		TFP_DRV_LOG(INFO,
-			    "Em_db is not initialized, rc:%s\n",
-			    strerror(-rc));
 		return 0;
 	}
 	em_db = (struct em_rm_db *)em_db_ptr;
drivers/net/bnxt/tf_core/tf_identifier.c +4 -11
index 3575c3e1a0..9f27a41fcf 100644
@@ -74,11 +74,6 @@ tf_ident_bind(struct tf *tfp,
 			db_rc[i] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
 		else
 			db_rc[i] = tf_rm_create_db(tfp, &db_cfg);
-		if (db_rc[i]) {
-			TFP_DRV_LOG(INFO,
-				    "%s: No Identifier DB required\n",
-				    tf_dir_2_str(i));
-		}
 
 		if (parms->shadow_copy) {
 			shadow_cfg.alloc_cnt =
@@ -99,8 +94,10 @@ tf_ident_bind(struct tf *tfp,
 	}
 
 	/* No db created */
-	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX]) {
+		TFP_DRV_LOG(ERR, "No Identifier DB created\n");
 		return db_rc[TF_DIR_RX];
+	}
 
 	TFP_DRV_LOG(INFO,
 		    "Identifier - initialized\n");
@@ -121,12 +118,8 @@ tf_ident_unbind(struct tf *tfp)
 	TF_CHECK_PARMS1(tfp);
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_IDENTIFIER, &ident_db_ptr);
-	if (rc) {
-		TFP_DRV_LOG(INFO,
-			    "Ident_db is not initialized, rc:%s\n",
-			    strerror(-rc));
+	if (rc)
 		return 0;
-	}
 	ident_db = (struct ident_rm_db *)ident_db_ptr;
 
 	for (i = 0; i < TF_DIR_MAX; i++) {
drivers/net/bnxt/tf_core/tf_if_tbl.c +2 -16
index f58fa79b63..762dac0473 100644
@@ -16,24 +16,16 @@ struct tf;
 
 /**
  * IF Table DBs.
+ * TODO: Store this data in session db
  */
 static void *if_tbl_db[TF_DIR_MAX];
 
-/**
- * IF Table Shadow DBs
- */
-/* static void *shadow_if_tbl_db[TF_DIR_MAX]; */
-
 /**
  * Init flag, set on bind and cleared on unbind
+ * TODO: Store this data in session db
  */
 static uint8_t init;
 
-/**
- * Shadow init flag, set on bind and cleared on unbind
- */
-/* static uint8_t shadow_init; */
-
 /**
  * Convert if_tbl_type to hwrm type.
  *
@@ -70,12 +62,6 @@ tf_if_tbl_bind(struct tf *tfp __rte_unused,
 {
 	TF_CHECK_PARMS2(tfp, parms);
 
-	if (init) {
-		TFP_DRV_LOG(ERR,
-			    "IF TBL DB already initialized\n");
-		return -EINVAL;
-	}
-
 	if_tbl_db[TF_DIR_RX] = parms->cfg;
 	if_tbl_db[TF_DIR_TX] = parms->cfg;
 
drivers/net/bnxt/tf_core/tf_session.c +10 -8
index 93876d8e5d..e6ab518121 100644
@@ -425,9 +425,11 @@ tf_session_open_session(struct tf *tfp,
 		}
 
 		TFP_DRV_LOG(INFO,
-		       "Session created, session_client_id:%d, session_id:%d\n",
+		       "Session created, session_client_id:%d,"
+		       "session_id:0x%08x, fw_session_id:%d\n",
 		       parms->open_cfg->session_client_id.id,
-		       parms->open_cfg->session_id.id);
+		       parms->open_cfg->session_id.id,
+		       parms->open_cfg->session_id.internal.fw_session_id);
 	} else {
 		scparms.ctrl_chan_name = parms->open_cfg->ctrl_chan_name;
 		scparms.session_client_id = &parms->open_cfg->session_client_id;
@@ -438,16 +440,16 @@ tf_session_open_session(struct tf *tfp,
 		rc = tf_session_client_create(tfp, &scparms);
 		if (rc) {
 			TFP_DRV_LOG(ERR,
-			      "Failed to create client on session %d, rc:%s\n",
+			      "Failed to create client on session 0x%x, rc:%s\n",
 			      parms->open_cfg->session_id.id,
 			      strerror(-rc));
 			return rc;
 		}
 
 		TFP_DRV_LOG(INFO,
-			    "Session Client:%d created on session:%d\n",
-			    parms->open_cfg->session_client_id.id,
-			    parms->open_cfg->session_id.id);
+			"Session Client:%d registered on session:0x%8x\n",
+			scparms.session_client_id->internal.fw_session_client_id,
+			tfp->session->session_id.id);
 	}
 
 	return 0;
@@ -541,7 +543,7 @@ tf_session_close_session(struct tf *tfp,
 			    client->session_client_id.id);
 
 		TFP_DRV_LOG(INFO,
-			    "session_id:%d, ref_count:%d\n",
+			    "session_id:0x%08x, ref_count:%d\n",
 			    tfs->session_id.id,
 			    tfs->ref_count);
 
@@ -587,7 +589,7 @@ tf_session_close_session(struct tf *tfp,
 	tfs->ref_count--;
 
 	TFP_DRV_LOG(INFO,
-		    "Closed session, session_id:%d, ref_count:%d\n",
+		    "Closed session, session_id:0x%08x, ref_count:%d\n",
 		    tfs->session_id.id,
 		    tfs->ref_count);
 
drivers/net/bnxt/tf_core/tf_tbl.c +6 -12
index 295204ac87..6842291adf 100644
@@ -83,17 +83,15 @@ tf_tbl_bind(struct tf *tfp,
 			db_rc[d] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
 		else
 			db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
-		if (db_rc[d]) {
-			TFP_DRV_LOG(ERR,
-				    "%s: No Table DB creation required\n",
-				    tf_dir_2_str(d));
-
-		}
 	}
 
 	/* No db created */
-	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX]) {
+		TFP_DRV_LOG(ERR,
+			    "%s: No Table DB created\n",
+			    tf_dir_2_str(d));
 		return db_rc[TF_DIR_RX];
+	}
 
 	TFP_DRV_LOG(INFO,
 		    "Table Type - initialized\n");
@@ -112,12 +110,8 @@ tf_tbl_unbind(struct tf *tfp)
 	TF_CHECK_PARMS1(tfp);
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_TABLE, &tbl_db_ptr);
-	if (rc) {
-		TFP_DRV_LOG(INFO,
-			    "Tbl_db is not initialized, rc:%s\n",
-			    strerror(-rc));
+	if (rc)
 		return 0;
-	}
 	tbl_db = (struct tbl_rm_db *)tbl_db_ptr;
 
 	for (i = 0; i < TF_DIR_MAX; i++) {
drivers/net/bnxt/tf_core/tf_tcam.c +3 -9
index 5c018f7003..7878f8727a 100644
@@ -113,16 +113,13 @@ tf_tcam_bind(struct tf *tfp,
 			db_rc[d] = tf_rm_create_db_no_reservation(tfp, &db_cfg);
 		else
 			db_rc[d] = tf_rm_create_db(tfp, &db_cfg);
-		if (db_rc[d]) {
-			TFP_DRV_LOG(INFO,
-				    "%s: no TCAM DB required\n",
-				    tf_dir_2_str(d));
-		}
 	}
 
 	/* No db created */
-	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX])
+	if (db_rc[TF_DIR_RX] && db_rc[TF_DIR_TX]) {
+		TFP_DRV_LOG(ERR, "No TCAM DB created\n");
 		return db_rc[TF_DIR_RX];
+	}
 
 	/* check if reserved resource for WC is multiple of num_slices */
 	for (d = 0; d < TF_DIR_MAX; d++) {
@@ -227,9 +224,6 @@ tf_tcam_unbind(struct tf *tfp)
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_TCAM, &tcam_db_ptr);
 	if (rc) {
-		TFP_DRV_LOG(INFO,
-			    "Tcam_db is not initialized, rc:%s\n",
-			    strerror(-rc));
 		return 0;
 	}
 	tcam_db = (struct tcam_rm_db *)tcam_db_ptr;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#85 lore raw

PATCH v2 20/58 net/bnxt: add WC TCAM management support

In reply to Ajit Khaparde

From: Farah Smith <[email protected]>

- Add new API to move WC TCAM regions from the hi pool to the low pool.
- Enable shared TCAM get/set functions on Thor.

---
 drivers/net/bnxt/tf_core/tf_core.c        |  53 +++
 drivers/net/bnxt/tf_core/tf_core.h        |  39 ++
 drivers/net/bnxt/tf_core/tf_device.h      |  18 +
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   1 +
 drivers/net/bnxt/tf_core/tf_device_p58.c  |   5 +-
 drivers/net/bnxt/tf_core/tf_session.c     |  41 ++
 drivers/net/bnxt/tf_core/tf_session.h     |  48 +++
 drivers/net/bnxt/tf_core/tf_tcam.c        |   2 +-
 drivers/net/bnxt/tf_core/tf_tcam_shared.c | 468 ++++++++++++++++++++--
 drivers/net/bnxt/tf_core/tf_tcam_shared.h |  35 ++
 10 files changed, 673 insertions(+), 37 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +53 -0
index de2a93646f..73dbee2940 100644
@@ -917,6 +917,59 @@ tf_free_tcam_entry(struct tf *tfp,
 	return 0;
 }
 
+#ifdef TF_TCAM_SHARED
+int
+tf_move_tcam_shared_entries(struct tf *tfp,
+			    struct tf_move_tcam_shared_entries_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+
+	TF_CHECK_PARMS2(tfp, parms);
+
+	/* Retrieve the session information */
+	rc = tf_session_get_session(tfp, &tfs);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: Failed to lookup session, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Retrieve the device information */
+	rc = tf_session_get_device(tfs, &dev);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: Failed to lookup device, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	if (dev->ops->tf_dev_move_tcam == NULL) {
+		rc = -EOPNOTSUPP;
+		TFP_DRV_LOG(ERR,
+			    "%s: Operation not supported, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	rc = dev->ops->tf_dev_move_tcam(tfp, parms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: TCAM shared entries move failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	return 0;
+}
+#endif /* TF_TCAM_SHARED */
+
 int
 tf_alloc_tbl_entry(struct tf *tfp,
 		   struct tf_alloc_tbl_entry_parms *parms)
drivers/net/bnxt/tf_core/tf_core.h +39 -0
index 39a498122b..95cde2e8eb 100644
@@ -1242,6 +1242,10 @@ int tf_free_tbl_scope(struct tf *tfp,
  * @ref tf_get_tcam_entry
  *
  * @ref tf_free_tcam_entry
+ *
+#ifdef TF_TCAM_SHARED
+ * @ref tf_move_tcam_shared_entries
+#endif
  */
 
 /**
@@ -1543,6 +1547,41 @@ struct tf_free_tcam_entry_parms {
 int tf_free_tcam_entry(struct tf *tfp,
 		       struct tf_free_tcam_entry_parms *parms);
 
+#ifdef TF_TCAM_SHARED
+/**
+ * tf_move_tcam_shared_entries parameter definition
+ */
+struct tf_move_tcam_shared_entries_parms {
+	/**
+	 * [in] receive or transmit direction
+	 */
+	enum tf_dir dir;
+	/**
+	 * [in] TCAM table type
+	 */
+	enum tf_tcam_tbl_type tcam_tbl_type;
+};
+
+/**
+ * Move TCAM entries
+ *
+ * This API only affects the following TCAM pools within a shared session:
+ *
+ * TF_TCAM_TBL_TYPE_WC_TCAM_HIGH
+ * TF_TCAM_TBL_TYPE_WC_TCAM_LOW
+ *
+ * When called, all allocated entries from the high pool will be moved to
+ * the low pool.  Then the allocated entries in the high pool will be
+ * cleared and freed.
+ *
+ * This API is not supported on a non-shared session.
+ *
+ * Returns success or failure code.
+ */
+int tf_move_tcam_shared_entries(struct tf *tfp,
+				struct tf_move_tcam_shared_entries_parms *parms);
+
+#endif /* TF_TCAM_SHARED */
 /**
  * @page table Table Access
  *
drivers/net/bnxt/tf_core/tf_device.h +18 -0
index ea4dcfb8e2..48ab17d56b 100644
@@ -563,6 +563,24 @@ struct tf_dev_ops {
 	int (*tf_dev_get_tcam)(struct tf *tfp,
 			       struct tf_tcam_get_parms *parms);
 
+#ifdef TF_TCAM_SHARED
+	/**
+	 * Move TCAM shared entries
+	 *
+	 * [in] tfp
+	 *   Pointer to TF handle
+	 *
+	 * [in] parms
+	 *   Pointer to parameters
+	 *
+	 *    returns:
+	 *    0       - Success
+	 *    -EINVAL - Error
+	 */
+	int (*tf_dev_move_tcam)(struct tf *tfp,
+				struct tf_move_tcam_shared_entries_parms *parms);
+#endif /* TF_TCAM_SHARED */
+
 	/**
 	 * Retrieves the tcam resource info.
 	 *
drivers/net/bnxt/tf_core/tf_device_p4.c +1 -0
index 0d3c35ae3b..67ef765236 100644
@@ -272,6 +272,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_free_tcam = tf_tcam_shared_free,
 	.tf_dev_set_tcam = tf_tcam_shared_set,
 	.tf_dev_get_tcam = tf_tcam_shared_get,
+	.tf_dev_move_tcam = tf_tcam_shared_move_p4,
 #else /* !TF_TCAM_SHARED */
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
drivers/net/bnxt/tf_core/tf_device_p58.c +3 -2
index 5bf52379a7..fd2703129f 100644
@@ -292,8 +292,9 @@ const struct tf_dev_ops tf_dev_ops_p58 = {
 #ifdef TF_TCAM_SHARED
 	.tf_dev_alloc_tcam = tf_tcam_shared_alloc,
 	.tf_dev_free_tcam = tf_tcam_shared_free,
-	.tf_dev_set_tcam = tf_tcam_set,
-	.tf_dev_get_tcam = tf_tcam_get,
+	.tf_dev_set_tcam = tf_tcam_shared_set,
+	.tf_dev_get_tcam = tf_tcam_shared_get,
+	.tf_dev_move_tcam = tf_tcam_shared_move_p58,
 #else /* !TF_TCAM_SHARED */
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
drivers/net/bnxt/tf_core/tf_session.c +41 -0

44 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_session.h +48 -0

64 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.c +1 -1
index 7878f8727a..d7e12e00ef 100644
@@ -299,7 +299,7 @@ tf_tcam_alloc(struct tf *tfp,
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_TCAM, &tcam_db_ptr);
 	if (rc) {
 		TFP_DRV_LOG(ERR,
-			    "Failed to get em_ext_db from session, rc:%s\n",
+			    "Failed to get tcam_db from session, rc:%s\n",
 			    strerror(-rc));
 		return rc;
 	}
drivers/net/bnxt/tf_core/tf_tcam_shared.c +434 -34

639 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam_shared.h +35 -0
index fad6e23b4c..5588125470 100644
@@ -124,4 +124,39 @@ int tf_tcam_shared_set(struct tf *tfp,
 int tf_tcam_shared_get(struct tf *tfp,
 		       struct tf_tcam_get_parms *parms);
 
+
+/**
+ * Moves entries from the WC_TCAM_HI to the WC_TCAM_LO shared pools
+ * for the P4 device.
+ *
+ * [in] tfp
+ *   Pointer to the truflow handle
+ *
+ * [in] parms
+ *   Pointer to parameters
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int tf_tcam_shared_move_p4(struct tf *tfp,
+			   struct tf_move_tcam_shared_entries_parms *parms);
+
+/**
+ * Moves entries from the WC_TCAM_HI to the WC_TCAM_LO shared pools
+ * for the P58 device.
+ *
+ * [in] tfp
+ *   Pointer to the truflow handle
+ *
+ * [in] parms
+ *   Pointer to parameters
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int tf_tcam_shared_move_p58(struct tf *tfp,
+			    struct tf_move_tcam_shared_entries_parms *parms);
+
 #endif /* _TF_TCAM_SHARED_H */
Signature · 1 line
2.21.1 (Apple Git-122.3)
#86 lore raw

PATCH v2 21/58 net/bnxt: add API to get shared table increments

In reply to Ajit Khaparde

From: Farah Smith <[email protected]>

Add TRUFLOW API to get the shared table increment value for a given TRUFLOW table type.
The API is being added for Wh+ and Thor devices.

---
 drivers/net/bnxt/tf_core/tf_core.c        | 52 +++++++++++++++++++++++
 drivers/net/bnxt/tf_core/tf_core.h        | 34 ++++++++++++++-
 drivers/net/bnxt/tf_core/tf_device.h      | 17 ++++++++
 drivers/net/bnxt/tf_core/tf_device_p4.c   | 25 +++++++++++
 drivers/net/bnxt/tf_core/tf_device_p58.c  | 44 +++++++++++++++++++
 drivers/net/bnxt/tf_core/tf_tcam_shared.c | 22 +++++++---
 6 files changed, 188 insertions(+), 6 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +52 -0
index 73dbee2940..0fbbd40252 100644
@@ -1415,6 +1415,58 @@ tf_bulk_get_tbl_entry(struct tf *tfp,
 	return rc;
 }
 
+int tf_get_shared_tbl_increment(struct tf *tfp,
+				struct tf_get_shared_tbl_increment_parms *parms)
+{
+	int rc = 0;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+
+	TF_CHECK_PARMS2(tfp, parms);
+
+	/* Retrieve the session information */
+	rc = tf_session_get_session(tfp, &tfs);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: Failed to lookup session, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Retrieve the device information */
+	rc = tf_session_get_device(tfs, &dev);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: Failed to lookup device, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Internal table type processing */
+
+	if (dev->ops->tf_dev_get_shared_tbl_increment == NULL) {
+		rc = -EOPNOTSUPP;
+		TFP_DRV_LOG(ERR,
+			    "%s: Operation not supported, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return -EOPNOTSUPP;
+	}
+
+	rc = dev->ops->tf_dev_get_shared_tbl_increment(tfp, parms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: Get table increment not supported, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	return rc;
+}
+
 int
 tf_alloc_tbl_scope(struct tf *tfp,
 		   struct tf_alloc_tbl_scope_parms *parms)
drivers/net/bnxt/tf_core/tf_core.h +33 -1
index 95cde2e8eb..44c30fa904 100644
@@ -848,7 +848,6 @@ struct tf_get_session_info_parms {
  */
 int tf_get_session_info(struct tf *tfp,
 			struct tf_get_session_info_parms *parms);
-
 /**
  * Experimental
  *
@@ -1594,6 +1593,8 @@ int tf_move_tcam_shared_entries(struct tf *tfp,
  * @ref tf_get_tbl_entry
  *
  * @ref tf_bulk_get_tbl_entry
+ *
+ * @ref tf_get_shared_tbl_increment
  */
 
 /**
@@ -1844,6 +1845,37 @@ struct tf_set_tbl_entry_parms {
 int tf_set_tbl_entry(struct tf *tfp,
 		     struct tf_set_tbl_entry_parms *parms);
 
+/**
+ * tf_get_shared_tbl_increment parameter definition
+ */
+struct tf_get_shared_tbl_increment_parms {
+	/**
+	 * [in] Receive or transmit direction
+	 */
+	enum tf_dir dir;
+	/**
+	 * [in] Type of object to set
+	 */
+	enum tf_tbl_type type;
+	/**
+	 * [out] Value to increment by for resource type
+	 */
+	uint32_t increment_cnt;
+};
+
+/**
+ * tf_get_shared_tbl_increment
+ *
+ * This API is currently only required for use in the shared
+ * session for Thor (p58) actions.  An increment count is returned per
+ * type to indicate how much to increment the start by for each
+ * entry (see tf_resource_info)
+ *
+ * Returns success or failure code.
+ */
+int tf_get_shared_tbl_increment(struct tf *tfp,
+				struct tf_get_shared_tbl_increment_parms *parms);
+
 /**
  * tf_get_tbl_entry parameter definition
  */
drivers/net/bnxt/tf_core/tf_device.h +17 -0
index 48ab17d56b..1893f630e7 100644
@@ -446,6 +446,23 @@ struct tf_dev_ops {
 	int (*tf_dev_get_bulk_tbl)(struct tf *tfp,
 				   struct tf_tbl_get_bulk_parms *parms);
 
+	/**
+	 * Gets the increment value to add to the shared session resource
+	 * start offset by for each count in the "stride"
+	 *
+	 * [in] tfp
+	 *   Pointer to TF handle
+	 *
+	 * [in] parms
+	 *   Pointer to get shared tbl increment parameters
+	 *
+	 * Returns
+	 *   - (0) if successful.
+	 *   - (-EINVAL) on failure.
+	 */
+	int (*tf_dev_get_shared_tbl_increment)(struct tf *tfp,
+				struct tf_get_shared_tbl_increment_parms *parms);
+
 	/**
 	 * Retrieves the table resource info.
 	 *
drivers/net/bnxt/tf_core/tf_device_p4.c +25 -0
index 67ef765236..239784897d 100644
@@ -190,6 +190,26 @@ tf_dev_p4_map_parif(struct tf *tfp __rte_unused,
 	return 0;
 }
 
+/**
+ * Device specific function that retrieves the increment
+ * required for certain table types in a shared session
+ *
+ * [in] tfp
+ *  tf handle
+ *
+ * [in/out] parms
+ *   pointer to parms structure
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+static int tf_dev_p4_get_shared_tbl_increment(struct tf *tfp __rte_unused,
+				struct tf_get_shared_tbl_increment_parms *parms)
+{
+	parms->increment_cnt = 1;
+	return 0;
+}
 static int tf_dev_p4_get_mailbox(void)
 {
 	return TF_KONG_MB;
@@ -221,12 +241,16 @@ const struct tf_dev_ops tf_dev_ops_p4_init = {
 	.tf_dev_set_ext_tbl = NULL,
 	.tf_dev_get_tbl = NULL,
 	.tf_dev_get_bulk_tbl = NULL,
+	.tf_dev_get_shared_tbl_increment = tf_dev_p4_get_shared_tbl_increment,
 	.tf_dev_get_tbl_resc_info = NULL,
 	.tf_dev_alloc_tcam = NULL,
 	.tf_dev_free_tcam = NULL,
 	.tf_dev_alloc_search_tcam = NULL,
 	.tf_dev_set_tcam = NULL,
 	.tf_dev_get_tcam = NULL,
+#ifdef TF_TCAM_SHARED
+	.tf_dev_move_tcam = NULL,
+#endif /* TF_TCAM_SHARED */
 	.tf_dev_get_tcam_resc_info = NULL,
 	.tf_dev_insert_int_em_entry = NULL,
 	.tf_dev_delete_int_em_entry = NULL,
@@ -266,6 +290,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_set_ext_tbl = tf_tbl_ext_common_set,
 	.tf_dev_get_tbl = tf_tbl_get,
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
+	.tf_dev_get_shared_tbl_increment = tf_dev_p4_get_shared_tbl_increment,
 	.tf_dev_get_tbl_resc_info = tf_tbl_get_resc_info,
 #ifdef TF_TCAM_SHARED
 	.tf_dev_alloc_tcam = tf_tcam_shared_alloc,
drivers/net/bnxt/tf_core/tf_device_p58.c +44 -0

62 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam_shared.c +17 -5
index 0e8cb78f8d..f0727cea80 100644
@@ -858,6 +858,10 @@ union tf_tmp_key {
 	uint8_t bytes[(TF_TMP_MAX_KEY_BITLEN + 7) / 8];
 };
 
+/** p58 has an enable bit, p4 does not
+ */
+#define TF_TCAM_SHARED_ENTRY_ENABLE 0x8
+
 /** Move a WC TCAM entry from the high offset to the same low offset
  */
 static int
@@ -869,7 +873,8 @@ tf_tcam_shared_move_entry(struct tf *tfp,
 			  int dphy_idx,
 			  int key_sz_bytes,
 			  int remap_sz_bytes,
-			  uint16_t num_slices)
+			  uint16_t num_slices,
+			  bool set_enable_bit)
 {
 	int rc = 0;
 	struct tf_tcam_get_parms gparms;
@@ -911,6 +916,9 @@ tf_tcam_shared_move_entry(struct tf *tfp,
 		return rc;
 	}
 
+	if (set_enable_bit)
+		tcam_key_obj.bytes[0] |= TF_TCAM_SHARED_ENTRY_ENABLE;
+
 	/* Override HI/LO type with parent WC TCAM type */
 	sparms.hcapi_type = hcapi_type;
 	sparms.dir = dir;
@@ -960,7 +968,8 @@ static
 int tf_tcam_shared_move(struct tf *tfp,
 			struct tf_move_tcam_shared_entries_parms *parms,
 			int key_sz_bytes,
-			int remap_sz_bytes)
+			int remap_sz_bytes,
+			bool set_enable_bit)
 {
 	int rc;
 	struct tf_session *tfs;
@@ -1084,7 +1093,8 @@ int tf_tcam_shared_move(struct tf *tfp,
 							       lo_start + log_idx,
 							       key_sz_bytes,
 							       remap_sz_bytes,
-							       num_slices);
+							       num_slices,
+							       set_enable_bit);
 				if (rc) {
 					TFP_DRV_LOG(ERR,
 						    "Cannot allocate %s index %d\n",
@@ -1125,7 +1135,8 @@ int tf_tcam_shared_move_p4(struct tf *tfp,
 	rc = tf_tcam_shared_move(tfp,
 				 parms,
 				 TF_TCAM_SHARED_KEY_SLICE_SZ_BYTES_P4,
-				 TF_TCAM_SHARED_REMAP_SZ_BYTES_P4);
+				 TF_TCAM_SHARED_REMAP_SZ_BYTES_P4,
+				 false); /* no enable bit */
 	return rc;
 }
 
@@ -1139,6 +1150,7 @@ int tf_tcam_shared_move_p58(struct tf *tfp,
 	rc = tf_tcam_shared_move(tfp,
 				 parms,
 				 TF_TCAM_SHARED_KEY_SLICE_SZ_BYTES_P58,
-				 TF_TCAM_SHARED_REMAP_SZ_BYTES_P58);
+				 TF_TCAM_SHARED_REMAP_SZ_BYTES_P58,
+				 true); /* set enable bit */
 	return rc;
 }
Signature · 1 line
2.21.1 (Apple Git-122.3)
#87 lore raw

PATCH v2 22/58 net/bnxt: refactor host session failure cleanup

In reply to Ajit Khaparde

From: Jay Ding <[email protected]>

- Close FW session if session open fails after Fw session open.
- Additional WC TCAM debug info to help in future debug
- Reduce key/mask buffer sizes for performance
- When a 64b counter is freed, clear the entry

---
 drivers/net/bnxt/tf_core/tf_em_internal.c | 15 +++---
 drivers/net/bnxt/tf_core/tf_identifier.c  | 14 ++++--
 drivers/net/bnxt/tf_core/tf_msg.c         | 24 ++-------
 drivers/net/bnxt/tf_core/tf_msg.h         |  9 +++-
 drivers/net/bnxt/tf_core/tf_rm.c          | 59 +++--------------------
 drivers/net/bnxt/tf_core/tf_session.c     | 32 ++++++++++--
 drivers/net/bnxt/tf_core/tf_tbl.c         | 51 ++++++++++++++++++--
 drivers/net/bnxt/tf_core/tf_tcam.c        | 14 ++++--
 drivers/net/bnxt/tf_core/tf_tcam_shared.c | 41 ++++++++--------
 9 files changed, 138 insertions(+), 121 deletions(-)
drivers/net/bnxt/tf_core/tf_em_internal.c +9 -6
index 28ffbd5876..0720bb905d 100644
@@ -543,18 +543,21 @@ tf_em_get_resc_info(struct tf *tfp,
 	TF_CHECK_PARMS2(tfp, em);
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_EM, &em_db_ptr);
-	if (rc) {
-		TFP_DRV_LOG(INFO,
-			    "No resource allocated for em from session\n");
-		return 0;
-	}
+	if (rc == -ENOMEM)
+		return 0;  /* db does not exist */
+	else if (rc)
+		return rc; /* db error */
+
 	em_db = (struct em_rm_db *)em_db_ptr;
 
-	/* check if reserved resource for WC is multiple of num_slices */
+	/* check if reserved resource for EM is multiple of num_slices */
 	for (d = 0; d < TF_DIR_MAX; d++) {
 		ainfo.rm_db = em_db->em_db[d];
 		dinfo = em[d].info;
 
+		if (!ainfo.rm_db)
+			continue;
+
 		ainfo.info = (struct tf_rm_alloc_info *)dinfo;
 		ainfo.subtype = 0;
 		rc = tf_rm_get_all_info(&ainfo, TF_EM_TBL_TYPE_MAX);
drivers/net/bnxt/tf_core/tf_identifier.c +9 -5
index 9f27a41fcf..c491f77a2b 100644
@@ -369,16 +369,20 @@ tf_ident_get_resc_info(struct tf *tfp,
 	TF_CHECK_PARMS2(tfp, ident);
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_IDENTIFIER, &ident_db_ptr);
-	if (rc) {
-		TFP_DRV_LOG(INFO,
-			    "No resource allocated for ident from session\n");
-		return 0;
-	}
+	if (rc == -ENOMEM)
+		return 0; /* db doesn't exist */
+	else if (rc)
+		return rc; /* error getting db */
+
 	ident_db = (struct ident_rm_db *)ident_db_ptr;
 
 	/* check if reserved resource for WC is multiple of num_slices */
 	for (d = 0; d < TF_DIR_MAX; d++) {
 		ainfo.rm_db = ident_db->ident_db[d];
+
+		if (!ainfo.rm_db)
+			continue;
+
 		dinfo = ident[d].info;
 
 		ainfo.info = (struct tf_rm_alloc_info *)dinfo;
drivers/net/bnxt/tf_core/tf_msg.c +3 -21
index 18eea8338a..fbd4b1d910 100644
@@ -267,31 +267,13 @@ tf_msg_session_client_unregister(struct tf *tfp,
 
 int
 tf_msg_session_close(struct tf *tfp,
-		     struct tf_session *tfs)
+		     uint8_t fw_session_id,
+		     int mailbox)
 {
 	int rc;
 	struct hwrm_tf_session_close_input req = { 0 };
 	struct hwrm_tf_session_close_output resp = { 0 };
 	struct tfp_send_msg_parms parms = { 0 };
-	uint8_t fw_session_id;
-	struct tf_dev_info *dev;
-
-	/* Retrieve the device information */
-	rc = tf_session_get_device(tfs, &dev);
-	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "Failed to lookup device, rc:%s\n",
-			    strerror(-rc));
-		return rc;
-	}
-
-	rc = tf_session_get_fw_session_id(tfp, &fw_session_id);
-	if (rc) {
-		TFP_DRV_LOG(ERR,
-			    "Unable to lookup FW id, rc:%s\n",
-			    strerror(-rc));
-		return rc;
-	}
 
 	/* Populate the request */
 	req.fw_session_id = tfp_cpu_to_le_32(fw_session_id);
@@ -301,7 +283,7 @@ tf_msg_session_close(struct tf *tfp,
 	parms.req_size = sizeof(req);
 	parms.resp_data = (uint32_t *)&resp;
 	parms.resp_size = sizeof(resp);
-	parms.mailbox = dev->ops->tf_dev_get_mailbox();
+	parms.mailbox = mailbox;
 
 	rc = tfp_send_msg_direct(tf_session_get_bp(tfp),
 				 &parms);
drivers/net/bnxt/tf_core/tf_msg.h +8 -1
index e8662fef0e..b26b15bfa3 100644
@@ -115,11 +115,18 @@ int tf_msg_session_client_unregister(struct tf *tfp,
  * [in] session
  *   Pointer to session handle
  *
+ * [in] fw_session_id
+ *   fw session id
+ *
+ * [in] mailbox
+ *   mailbox
+ *
  * Returns:
  *   0 on Success else internal Truflow error
  */
 int tf_msg_session_close(struct tf *tfp,
-			 struct tf_session *tfs);
+			 uint8_t fw_session_id,
+			 int mailbox);
 
 /**
  * Sends session query config request to TF Firmware
drivers/net/bnxt/tf_core/tf_rm.c +7 -52

89 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_session.c +27 -5
index 70844edb50..71ccb2e3e7 100644
@@ -215,6 +215,16 @@ tf_session_create(struct tf *tfp,
 	return 0;
 
  cleanup:
+	rc = tf_msg_session_close(tfp,
+			fw_session_id,
+			dev.ops->tf_dev_get_mailbox());
+	if (rc) {
+		/* Log error */
+		TFP_DRV_LOG(ERR,
+			    "FW Session close failed, rc:%s\n",
+			    strerror(-rc));
+	}
+
 	tfp_free(tfp->session->core_data);
 	tfp_free(tfp->session);
 	tfp->session = NULL;
@@ -479,6 +489,8 @@ tf_session_close_session(struct tf *tfp,
 	struct tf_dev_info *tfd = NULL;
 	struct tf_session_client_destroy_parms scdparms;
 	uint16_t fid;
+	uint8_t fw_session_id = 1;
+	int mailbox = 0;
 
 	TF_CHECK_PARMS2(tfp, parms);
 
@@ -563,6 +575,16 @@ tf_session_close_session(struct tf *tfp,
 		return rc;
 	}
 
+	mailbox = tfd->ops->tf_dev_get_mailbox();
+
+	rc = tf_session_get_fw_session_id(tfp, &fw_session_id);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "Unable to lookup FW id, rc:%s\n",
+			    strerror(-rc));
+		return rc;
+	}
+
 	/* Unbind the device */
 	rc = tf_dev_unbind(tfp, tfd);
 	if (rc) {
@@ -572,7 +594,7 @@ tf_session_close_session(struct tf *tfp,
 			    strerror(-rc));
 	}
 
-	rc = tf_msg_session_close(tfp, tfs);
+	rc = tf_msg_session_close(tfp, fw_session_id, mailbox);
 	if (rc) {
 		/* Log error */
 		TFP_DRV_LOG(ERR,
@@ -881,26 +903,26 @@ tf_session_get_db(struct tf *tfp,
 		if (tfs->id_db_handle)
 			*db_handle = tfs->id_db_handle;
 		else
-			rc = -EINVAL;
+			rc = -ENOMEM;
 		break;
 	case TF_MODULE_TYPE_TABLE:
 		if (tfs->tbl_db_handle)
 			*db_handle = tfs->tbl_db_handle;
 		else
-			rc = -EINVAL;
+			rc = -ENOMEM;
 
 		break;
 	case TF_MODULE_TYPE_TCAM:
 		if (tfs->tcam_db_handle)
 			*db_handle = tfs->tcam_db_handle;
 		else
-			rc = -EINVAL;
+			rc = -ENOMEM;
 		break;
 	case TF_MODULE_TYPE_EM:
 		if (tfs->em_db_handle)
 			*db_handle = tfs->em_db_handle;
 		else
-			rc = -EINVAL;
+			rc = -ENOMEM;
 		break;
 	default:
 		rc = -EINVAL;
drivers/net/bnxt/tf_core/tf_tbl.c +46 -5

69 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.c +9 -5
index d7e12e00ef..45206c5992 100644
@@ -818,16 +818,20 @@ tf_tcam_get_resc_info(struct tf *tfp,
 	TF_CHECK_PARMS2(tfp, tcam);
 
 	rc = tf_session_get_db(tfp, TF_MODULE_TYPE_TCAM, &tcam_db_ptr);
-	if (rc) {
-		TFP_DRV_LOG(INFO,
-			    "No resource allocated for tcam from session\n");
-		return 0;
-	}
+	if (rc == -ENOMEM)
+		return 0;  /* db doesn't exist */
+	else if (rc)
+		return rc; /* error getting db */
+
 	tcam_db = (struct tcam_rm_db *)tcam_db_ptr;
 
 	/* check if reserved resource for WC is multiple of num_slices */
 	for (d = 0; d < TF_DIR_MAX; d++) {
 		ainfo.rm_db = tcam_db->tcam_db[d];
+
+		if (!ainfo.rm_db)
+			continue;
+
 		dinfo = tcam[d].info;
 
 		ainfo.info = (struct tf_rm_alloc_info *)dinfo;
drivers/net/bnxt/tf_core/tf_tcam_shared.c +20 -21

82 lines not on this page · raw message

Signature · 1 line
2.21.1 (Apple Git-122.3)
#88 lore raw

PATCH v2 23/58 net/bnxt: cleanup WC TCAM shared pool

In reply to Ajit Khaparde

From: Farah Smith <[email protected]>

Clean up all allocated hi or lo pool TCAM regions on close. Along with message cleanup and remove unnecessary multi-slice options Also make sure that find next free entry should start from 0 first time.

---
 drivers/net/bnxt/tf_core/tf_tcam_shared.c | 333 ++++++++++++----------
 1 file changed, 179 insertions(+), 154 deletions(-)
drivers/net/bnxt/tf_core/tf_tcam_shared.c +179 -154
index 5139b28537..b96d9ca9dd 100644
@@ -19,8 +19,6 @@
 #include "tf_core.h"
 #include "tf_rm.h"
 
-struct tf;
-
 /** Shared WC TCAM pool identifiers
  */
 enum tf_tcam_shared_wc_pool_id {
@@ -288,6 +286,12 @@ tf_tcam_shared_bind(struct tf *tfp,
 		if (rc)
 			return rc;
 
+		if (num_slices > 1) {
+			TFP_DRV_LOG(ERR,
+				    "Only single slice supported\n");
+			return -EOPNOTSUPP;
+		}
+
 		tf_tcam_shared_create_db(&tcam_shared_wc);
 
 
@@ -338,49 +342,135 @@ int
 tf_tcam_shared_unbind(struct tf *tfp)
 {
 	int rc, dir;
+	struct tf_dev_info *dev;
 	struct tf_session *tfs;
 	void *tcam_shared_db_ptr = NULL;
 	struct tf_tcam_shared_wc_pools *tcam_shared_wc;
+	enum tf_tcam_shared_wc_pool_id pool_id;
+	struct tf_tcam_free_parms parms;
+	struct bitalloc *pool;
+	uint16_t start;
+	int log_idx, phy_idx;
+	uint16_t hcapi_type;
+	struct tf_rm_alloc_info info;
+	int i, pool_cnt;
 
 	TF_CHECK_PARMS1(tfp);
 
-	/* Perform normal unbind, this will write all the
-	 * allocated TCAM entries in the shared session.
-	 */
-	rc = tf_tcam_unbind(tfp);
-	if (rc)
-		return rc;
-
 	/* Retrieve the session information */
 	rc = tf_session_get_session_internal(tfp, &tfs);
 	if (rc)
 		return rc;
 
-	rc = tf_session_get_tcam_shared_db(tfp, (void *)&tcam_shared_db_ptr);
+	/* If not the shared session, call the normal
+	 * tcam unbind and exit
+	 */
+	if (!tf_session_is_shared_session(tfs)) {
+		rc = tf_tcam_unbind(tfp);
+		return rc;
+	}
+
+	/* We must be a shared session, get the database
+	 */
+	rc = tf_session_get_tcam_shared_db(tfp,
+					   (void *)&tcam_shared_db_ptr);
 	if (rc) {
 		TFP_DRV_LOG(ERR,
-			    "Failed to get tcam_shared_db from session, rc:%s\n",
+			    "Failed to get tcam_shared_db, rc:%s\n",
 			    strerror(-rc));
 		return rc;
 	}
-	tcam_shared_wc = (struct tf_tcam_shared_wc_pools *)tcam_shared_db_ptr;
 
-	/* If we are the shared session
+	tcam_shared_wc =
+		(struct tf_tcam_shared_wc_pools *)tcam_shared_db_ptr;
+
+
+	/* Get the device
 	 */
-	if (tf_session_is_shared_session(tfs)) {
-		/* If there are WC TCAM entries allocated, free them
+	rc = tf_session_get_device(tfs, &dev);
+	if (rc)
+		return rc;
+
+
+	/* If there are WC TCAM entries allocated, free them
+	 */
+	for (dir = 0; dir < TF_DIR_MAX; dir++) {
+		/* If the database is invalid, skip
 		 */
-		for (dir = 0; dir < TF_DIR_MAX; dir++) {
-			tf_tcam_shared_free_wc_pool(dir,
-						    TF_TCAM_SHARED_WC_POOL_HI,
-						    tcam_shared_wc);
+		if (!tf_tcam_db_valid(tfp, dir))
+			continue;
+
+		rc = tf_tcam_shared_get_rm_info(tfp,
+						dir,
+						&hcapi_type,
+						&info);
+		if (rc) {
+			TFP_DRV_LOG(ERR,
+				    "%s: TCAM shared rm info get failed\n",
+				    tf_dir_2_str(dir));
+			return rc;
+		}
+
+		for (pool_id = TF_TCAM_SHARED_WC_POOL_HI;
+		     pool_id < TF_TCAM_SHARED_WC_POOL_MAX;
+		     pool_id++) {
+			pool = tcam_shared_wc->db[dir][pool_id].pool;
+			start = tcam_shared_wc->db[dir][pool_id].info.start;
+			pool_cnt = ba_inuse_count(pool);
+
+			if (pool_cnt) {
+				TFP_DRV_LOG(INFO,
+					    "%s: %s: %d residuals found, freeing\n",
+					    tf_dir_2_str(dir),
+					    tf_pool_2_str(pool_id),
+					    pool_cnt);
+			}
+
+			log_idx = 0;
+
+			for (i = 0; i < pool_cnt; i++) {
+				log_idx = ba_find_next_inuse(pool, log_idx);
+
+				if (log_idx < 0) {
+					TFP_DRV_LOG(ERR,
+						    "Expected a found %s entry %d\n",
+						    tf_pool_2_str(pool_id),
+						    i);
+					/* attempt normal unbind
+					 */
+					goto done;
+				}
+				phy_idx = start + log_idx;
+
+				parms.type = TF_TCAM_TBL_TYPE_WC_TCAM;
+				parms.hcapi_type = hcapi_type;
+				parms.idx = phy_idx;
+				parms.dir = dir;
+				rc = tf_msg_tcam_entry_free(tfp, dev, &parms);
+				if (rc) {
+					/* Log error */
+					TFP_DRV_LOG(ERR,
+						    "%s: %s: %d free failed, rc:%s\n",
+						    tf_dir_2_str(parms.dir),
+						    tf_tcam_tbl_2_str(parms.type),
+						    phy_idx,
+						    strerror(-rc));
+					return rc;
+				}
+			}
+			/* Free the pool once all the entries
+			 * have been cleared
+			 */
 			tf_tcam_shared_free_wc_pool(dir,
-						    TF_TCAM_SHARED_WC_POOL_LO,
+						    pool_id,
 						    tcam_shared_wc);
 		}
 	}
-	return 0;
+done:
+	rc = tf_tcam_unbind(tfp);
+	return rc;
 }
+
 /**
  * tf_tcam_shared_alloc
  */
@@ -388,13 +478,12 @@ int
 tf_tcam_shared_alloc(struct tf *tfp,
 		     struct tf_tcam_alloc_parms *parms)
 {
-	int rc, i;
+	int rc;
 	struct tf_session *tfs;
 	struct tf_dev_info *dev;
 	int log_idx;
 	struct bitalloc *pool;
 	enum tf_tcam_shared_wc_pool_id id;
-	uint16_t num_slices;
 	struct tf_tcam_shared_wc_pools *tcam_shared_wc;
 	void *tcam_shared_db_ptr = NULL;
 
@@ -444,32 +533,24 @@ tf_tcam_shared_alloc(struct tf *tfp,
 	if (rc)
 		return rc;
 
-	rc = tf_tcam_shared_get_slices(tfp, dev, &num_slices);
-	if (rc)
-		return rc;
-
 	pool = tcam_shared_wc->db[parms->dir][id].pool;
 
-	for (i = 0; i < num_slices; i++) {
-		/*
-		 * priority  0: allocate from top of the tcam i.e. high
-		 * priority !0: allocate index from bottom i.e lowest
-		 */
-		if (parms->priority)
-			log_idx = ba_alloc_reverse(pool);
-		else
-			log_idx = ba_alloc(pool);
-		if (log_idx == BA_FAIL) {
-			TFP_DRV_LOG(ERR,
-				    "%s: Allocation failed, rc:%s\n",
-				    tf_dir_2_str(parms->dir),
-				    strerror(ENOMEM));
-			return -ENOMEM;
-		}
-		/* return the index without the start of each row */
-		if (i == 0)
-			parms->idx = log_idx;
+	/*
+	 * priority  0: allocate from top of the tcam i.e. high
+	 * priority !0: allocate index from bottom i.e lowest
+	 */
+	if (parms->priority)
+		log_idx = ba_alloc_reverse(pool);
+	else
+		log_idx = ba_alloc(pool);
+	if (log_idx == BA_FAIL) {
+		TFP_DRV_LOG(ERR,
+			    "%s: Allocation failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(ENOMEM));
+		return -ENOMEM;
 	}
+	parms->idx = log_idx;
 	return 0;
 }
 
@@ -481,13 +562,11 @@ tf_tcam_shared_free(struct tf *tfp,
 	struct tf_session *tfs;
 	struct tf_dev_info *dev;
 	int allocated = 0;
-	int i;
 	uint16_t start;
 	int phy_idx;
 	struct bitalloc *pool;
 	enum tf_tcam_shared_wc_pool_id id;
 	struct tf_tcam_free_parms nparms;
-	uint16_t num_slices;
 	uint16_t hcapi_type;
 	struct tf_rm_alloc_info info;
 	void *tcam_shared_db_ptr = NULL;
@@ -540,10 +619,6 @@ tf_tcam_shared_free(struct tf *tfp,
 	if (rc)
 		return rc;
 
-	rc = tf_tcam_shared_get_slices(tfp, dev, &num_slices);
-	if (rc)
-		return rc;
-
 	rc = tf_tcam_shared_get_rm_info(tfp,
 					parms->dir,
 					&hcapi_type,
@@ -558,13 +633,6 @@ tf_tcam_shared_free(struct tf *tfp,
 	pool = tcam_shared_wc->db[parms->dir][id].pool;
 	start = tcam_shared_wc->db[parms->dir][id].info.start;
 
-	if (parms->idx % num_slices) {
-		TFP_DRV_LOG(ERR,
-			    "%s: TCAM reserved resource is not multiple of %d\n",
-			    tf_dir_2_str(parms->dir), num_slices);
-		return -EINVAL;
-	}
-
 	phy_idx = parms->idx + start;
 	allocated = ba_inuse(pool, parms->idx);
 
@@ -575,16 +643,14 @@ tf_tcam_shared_free(struct tf *tfp,
 		return -EINVAL;
 	}
 
-	for (i = 0; i < num_slices; i++) {
-		rc = ba_free(pool, parms->idx + i);
-		if (rc) {
-			TFP_DRV_LOG(ERR,
-				    "%s: Free failed, type:%s, idx:%d\n",
-				    tf_dir_2_str(parms->dir),
-				    tf_tcam_tbl_2_str(parms->type),
-				    parms->idx);
-			return rc;
-		}
+	rc = ba_free(pool, parms->idx);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: Free failed, type:%s, idx:%d\n",
+			    tf_dir_2_str(parms->dir),
+			    tf_tcam_tbl_2_str(parms->type),
+			    parms->idx);
+		return rc;
 	}
 
 	/* Override HI/LO type with parent WC TCAM type */
@@ -616,7 +682,6 @@ tf_tcam_shared_set(struct tf *tfp __rte_unused,
 	struct tf_dev_info *dev;
 	int allocated = 0;
 	int phy_idx, log_idx;
-	uint16_t num_slices;
 	struct tf_tcam_set_parms nparms;
 	struct bitalloc *pool;
 	uint16_t start;
@@ -685,16 +750,7 @@ tf_tcam_shared_set(struct tf *tfp __rte_unused,
 			    tf_dir_2_str(parms->dir), parms->type, log_idx);
 		return -EINVAL;
 	}
-	rc = tf_tcam_shared_get_slices(tfp, dev, &num_slices);
-	if (rc)
-		return rc;
 
-	if (parms->idx % num_slices) {
-		TFP_DRV_LOG(ERR,
-			    "%s: TCAM reserved resource is not multiple of %d\n",
-			    tf_dir_2_str(parms->dir), num_slices);
-		return -EINVAL;
-	}
 	rc = tf_tcam_shared_get_rm_info(tfp,
 					parms->dir,
 					&hcapi_type,
@@ -736,7 +792,6 @@ tf_tcam_shared_get(struct tf *tfp __rte_unused,
 	struct tf_dev_info *dev;
 	int allocated = 0;
 	int phy_idx, log_idx;
-	uint16_t num_slices;
 	struct tf_tcam_get_parms nparms;
 	struct bitalloc *pool;
 	uint16_t start;
@@ -794,16 +849,6 @@ tf_tcam_shared_get(struct tf *tfp __rte_unused,
 	pool = tcam_shared_wc->db[parms->dir][id].pool;
 	start = tcam_shared_wc->db[parms->dir][id].info.start;
 
-	rc = tf_tcam_shared_get_slices(tfp, dev, &num_slices);
-	if (rc)
-		return rc;
-
-	if (parms->idx % num_slices) {
-		TFP_DRV_LOG(ERR,
-			    "%s: TCAM reserved resource is not multiple of %d\n",
-			    tf_dir_2_str(parms->dir), num_slices);
-		return -EINVAL;
-	}
 	log_idx = parms->idx;
 	phy_idx = parms->idx + start;
 	allocated = ba_inuse(pool, parms->idx);
@@ -881,7 +926,6 @@ tf_tcam_shared_move_entry(struct tf *tfp,
 			  int dphy_idx,
 			  int key_sz_bytes,
 			  int remap_sz_bytes,
-			  uint16_t num_slices,
 			  bool set_enable_bit)
 {
 	int rc = 0;
@@ -897,12 +941,6 @@ tf_tcam_shared_move_entry(struct tf *tfp,
 	memset(&tcam_remap_obj, 0, sizeof(tcam_remap_obj));
 	memset(&gparms, 0, sizeof(gparms));
 
-	if (num_slices > 1) {
-		TFP_DRV_LOG(ERR,
-			    "Only single slice supported");
-		return -EOPNOTSUPP;
-	}
-
 	gparms.hcapi_type = hcapi_type;
 	gparms.dir = dir;
 	gparms.type = TF_TCAM_TBL_TYPE_WC_TCAM;
@@ -917,7 +955,8 @@ tf_tcam_shared_move_entry(struct tf *tfp,
 	if (rc) {
 		/* Log error */
 		TFP_DRV_LOG(ERR,
-			    "%s: WC_TCAM_HIGH: phyid(%d) get failed, rc:%s",
+			    "%s: %s: phyid(%d) get failed, rc:%s\n",
+			    tf_tcam_tbl_2_str(gparms.type),
 			    tf_dir_2_str(dir),
 			    gparms.idx,
 			    strerror(-rc));
@@ -942,7 +981,8 @@ tf_tcam_shared_move_entry(struct tf *tfp,
 	if (rc) {
 		/* Log error */
 		TFP_DRV_LOG(ERR,
-			    "%s: WC_TCAM_LOW phyid(%d/0x%x) set failed, rc:%s",
+			    "%s: %s phyid(%d/0x%x) set failed, rc:%s\n",
+			    tf_tcam_tbl_2_str(sparms.type),
 			    tf_dir_2_str(dir),
 			    sparms.idx,
 			    sparms.idx,
@@ -985,13 +1025,12 @@ int tf_tcam_shared_move(struct tf *tfp,
 	struct tf_session *tfs;
 	struct tf_dev_info *dev;
 	int log_idx;
-	uint16_t num_slices;
 	struct bitalloc *hi_pool, *lo_pool;
 	uint16_t hi_start, lo_start;
 	enum tf_tcam_shared_wc_pool_id hi_id, lo_id;
 	uint16_t hcapi_type;
 	struct tf_rm_alloc_info info;
-	int hi_cnt, i, j;
+	int hi_cnt, i;
 	struct tf_tcam_shared_wc_pools *tcam_shared_wc;
 	void *tcam_shared_db_ptr = NULL;
 
@@ -1027,9 +1066,6 @@ int tf_tcam_shared_move(struct tf *tfp,
 		/* TODO print amazing error */
 		return rc;
 	}
-	rc = tf_tcam_shared_get_slices(tfp, dev, &num_slices);
-	if (rc)
-		return rc;
 
 	rc = tf_tcam_shared_get_rm_info(tfp,
 					parms->dir,
@@ -1068,62 +1104,51 @@ int tf_tcam_shared_move(struct tf *tfp,
 
 	/* Copy each valid entry to the same low pool logical offset
 	 */
+	log_idx = 0;
+
 	for (i = 0; i < hi_cnt; i++) {
-		/* Go through all the slices
+		/* Find next free index starting from where we left off
 		 */
-		for (j = 0; j < num_slices; j++) {
-			/* Find next free starting from where we left off
-			 */
-			log_idx = ba_find_next_inuse(hi_pool, i);
+		log_idx = ba_find_next_inuse(hi_pool, log_idx);
+		if (log_idx < 0) {
+			TFP_DRV_LOG(ERR,
+				    "Expected a found %s entry %d\n",
+				    tf_pool_2_str(hi_id),
+				    i);
+			goto done;
+		}
+		/* The user should have never allocated from the low
+		 * pool because the move only happens when switching
+		 * from the high to the low pool
+		 */
+		if (ba_alloc_index(lo_pool, log_idx) < 0) {
+			TFP_DRV_LOG(ERR,
+				    "Warning %s index %d already allocated\n",
+				    tf_pool_2_str(lo_id),
+				    i);
 
-			if (log_idx < 0) {
-				TFP_DRV_LOG(ERR,
-					    "Expected a found %s entry %d\n",
-					    tf_pool_2_str(hi_id),
-					    i);
-				goto done;
-			}
-			/* The user should have never allocated from the low
-			 * pool because the move only happens when switching
-			 * from the high to the low pool
+			/* Since already allocated, continue with move
 			 */
-			if (ba_alloc_index(lo_pool, log_idx) < 0) {
-				TFP_DRV_LOG(ERR,
-					    "Cannot allocate %s index %d\n",
-					    tf_pool_2_str(lo_id),
-					    i);
-				goto done;
-			}
+		}
 
-			if (j == 0) {
-				rc = tf_tcam_shared_move_entry(tfp, dev,
-							       hcapi_type,
-							       parms->dir,
-							       hi_start + log_idx,
-							       lo_start + log_idx,
-							       key_sz_bytes,
-							       remap_sz_bytes,
-							       num_slices,
-							       set_enable_bit);
-				if (rc) {
-					TFP_DRV_LOG(ERR,
-						    "Cannot allocate %s index %d\n",
-						    tf_pool_2_str(hi_id),
-						    i);
-					goto done;
-				}
-				ba_free(hi_pool, log_idx);
-				TFP_DRV_LOG(DEBUG,
-					    "%s: TCAM shared move pool(%s) phyid(%d)\n",
-					    tf_dir_2_str(parms->dir),
-					    tf_pool_2_str(hi_id),
-					    hi_start + log_idx);
-				TFP_DRV_LOG(DEBUG,
-					    "to pool(%s) phyid(%d)\n",
-					    tf_pool_2_str(lo_id),
-					    lo_start + log_idx);
-			}
+		rc = tf_tcam_shared_move_entry(tfp, dev,
+					       hcapi_type,
+					       parms->dir,
+					       hi_start + log_idx,
+					       lo_start + log_idx,
+					       key_sz_bytes,
+					       remap_sz_bytes,
+					       set_enable_bit);
+		if (rc) {
+			TFP_DRV_LOG(ERR,
+				    "%s: Move error %s to %s index %d\n",
+				    tf_dir_2_str(parms->dir),
+				    tf_pool_2_str(hi_id),
+				    tf_pool_2_str(lo_id),
+				    i);
+			goto done;
 		}
+		ba_free(hi_pool, log_idx);
 	}
 done:
 	return rc;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#89 lore raw

PATCH v2 24/58 net/bnxt: add support for WC TCAM shared session

In reply to Ajit Khaparde

From: Jay Ding <[email protected]>

If the session shares WC TCAM entries with others, specify it in the session name by attach "-wc_tcam". Firmware will flush the shared WC TCAM entries if the last shared session using them is closed.

---
 drivers/net/bnxt/tf_core/tf_msg.c     | 46 +++++++++++++++++++++++----
 drivers/net/bnxt/tf_core/tf_session.c |  5 +++
 2 files changed, 44 insertions(+), 7 deletions(-)
drivers/net/bnxt/tf_core/tf_msg.c +39 -7
index fbd4b1d910..6717710dbd 100644
@@ -58,6 +58,16 @@ static_assert(sizeof(struct hwrm_tf_tbl_type_set_input) ==
  */
 #define TF_PCI_BUF_SIZE_MAX 88
 
+/**
+ * This is the length of shared session name "tf_share"
+ */
+#define TF_SHARED_SESSION_NAME_LEN 8
+
+/**
+ * This is the length of tcam shared session name "tf_shared-wc_tcam"
+ */
+#define TF_TCAM_SHARED_SESSION_NAME_LEN 17
+
 /**
  * If data bigger than TF_PCI_BUF_SIZE_MAX then use DMA method
  */
@@ -126,13 +136,17 @@ tf_msg_session_open(struct bnxt *bp,
 	struct hwrm_tf_session_open_output resp = { 0 };
 	struct tfp_send_msg_parms parms = { 0 };
 	int name_len;
-	char *name;
+	char *session_name;
+	char *tcam_session_name;
 
 	/* Populate the request */
 	name_len = strnlen(ctrl_chan_name, TF_SESSION_NAME_MAX);
-	name = &ctrl_chan_name[name_len - strlen("tf_shared")];
-	if (!strncmp(name, "tf_shared", strlen("tf_shared")))
-		tfp_memcpy(&req.session_name, name, strlen("tf_share"));
+	session_name = &ctrl_chan_name[name_len - strlen("tf_shared")];
+	tcam_session_name = &ctrl_chan_name[name_len - strlen("tf_shared-wc_tcam")];
+	if (!strncmp(tcam_session_name, "tf_shared-wc_tcam", strlen("tf_shared-wc_tcam")))
+		tfp_memcpy(&req.session_name, tcam_session_name, TF_TCAM_SHARED_SESSION_NAME_LEN);
+	else if (!strncmp(session_name, "tf_shared", strlen("tf_shared")))
+		tfp_memcpy(&req.session_name, session_name, TF_SHARED_SESSION_NAME_LEN);
 	else
 		tfp_memcpy(&req.session_name, ctrl_chan_name, TF_SESSION_NAME_MAX);
 
@@ -177,6 +191,9 @@ tf_msg_session_client_register(struct tf *tfp,
 	struct tfp_send_msg_parms parms = { 0 };
 	uint8_t fw_session_id;
 	struct tf_dev_info *dev;
+	int name_len;
+	char *session_name;
+	char *tcam_session_name;
 
 	/* Retrieve the device information */
 	rc = tf_session_get_device(tfs, &dev);
@@ -197,9 +214,24 @@ tf_msg_session_client_register(struct tf *tfp,
 
 	/* Populate the request */
 	req.fw_session_id = tfp_cpu_to_le_32(fw_session_id);
-	tfp_memcpy(&req.session_client_name,
-		   ctrl_channel_name,
-		   TF_SESSION_NAME_MAX);
+	name_len = strnlen(ctrl_channel_name, TF_SESSION_NAME_MAX);
+	session_name = &ctrl_channel_name[name_len - strlen("tf_shared")];
+	tcam_session_name = &ctrl_channel_name[name_len -
+		strlen("tf_shared-wc_tcam")];
+	if (!strncmp(tcam_session_name,
+				"tf_shared-wc_tcam",
+				strlen("tf_shared-wc_tcam")))
+		tfp_memcpy(&req.session_client_name,
+				tcam_session_name,
+				TF_TCAM_SHARED_SESSION_NAME_LEN);
+	else if (!strncmp(session_name, "tf_shared", strlen("tf_shared")))
+		tfp_memcpy(&req.session_client_name,
+				session_name,
+				TF_SHARED_SESSION_NAME_LEN);
+	else
+		tfp_memcpy(&req.session_client_name,
+				ctrl_channel_name,
+				TF_SESSION_NAME_MAX);
 
 	parms.tf_type = HWRM_TF_SESSION_REGISTER;
 	parms.req_data = (uint32_t *)&req;
drivers/net/bnxt/tf_core/tf_session.c +5 -0
index 71ccb2e3e7..90b65c59e6 100644
@@ -188,6 +188,11 @@ tf_session_create(struct tf *tfp,
 	if (!strncmp(name, "tf_shared", strlen("tf_shared")))
 		session->shared_session = true;
 
+	name = &parms->open_cfg->ctrl_chan_name[name_len -
+		strlen("tf_shared-wc_tcam")];
+	if (!strncmp(name, "tf_shared-wc_tcam", strlen("tf_shared-wc_tcam")))
+		session->shared_session = true;
+
 	if (session->shared_session && shared_session_creator) {
 		session->shared_session_creator = true;
 		parms->open_cfg->shared_session_creator = true;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#90 lore raw

PATCH v2 25/58 net/bnxt: add API to clear TCAM regions

In reply to Ajit Khaparde

From: Farah Smith <[email protected]>

Add TRUFLOW API to clear either the hi or the low regions in WildCard TCAM for ungraceful exit cleanup.

---
 drivers/net/bnxt/tf_core/tf_core.c        |  51 ++++++++++
 drivers/net/bnxt/tf_core/tf_core.h        |  39 +++++++-
 drivers/net/bnxt/tf_core/tf_device.h      |  19 +++-
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   4 +-
 drivers/net/bnxt/tf_core/tf_device_p58.c  |   1 +
 drivers/net/bnxt/tf_core/tf_tcam_shared.c | 111 +++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_tcam_shared.h |  21 ++++
 drivers/net/bnxt/tf_core/tf_util.h        |   1 -
 8 files changed, 235 insertions(+), 12 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +51 -0
index 0fbbd40252..97e6165e92 100644
@@ -968,6 +968,57 @@ tf_move_tcam_shared_entries(struct tf *tfp,
 
 	return 0;
 }
+
+int
+tf_clear_tcam_shared_entries(struct tf *tfp,
+			     struct tf_clear_tcam_shared_entries_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+
+	TF_CHECK_PARMS2(tfp, parms);
+
+	/* Retrieve the session information */
+	rc = tf_session_get_session(tfp, &tfs);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: Failed to lookup session, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Retrieve the device information */
+	rc = tf_session_get_device(tfs, &dev);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: Failed to lookup device, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	if (dev->ops->tf_dev_clear_tcam == NULL) {
+		rc = -EOPNOTSUPP;
+		TFP_DRV_LOG(ERR,
+			    "%s: Operation not supported, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	rc = dev->ops->tf_dev_clear_tcam(tfp, parms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: TCAM shared entries clear failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	return 0;
+}
 #endif /* TF_TCAM_SHARED */
 
 int
drivers/net/bnxt/tf_core/tf_core.h +36 -3
index 44c30fa904..0b06bb2bb5 100644
@@ -233,7 +233,7 @@ enum tf_identifier_type {
 	 */
 	TF_IDENT_TYPE_EM_PROF,
 	/**
-	 *  TH
+	 *  (Future)
 	 *  The L2 func is included in the ILT result and from recycling to
 	 *  enable virtualization of further lookups.
 	 */
@@ -1244,6 +1244,8 @@ int tf_free_tbl_scope(struct tf *tfp,
  *
 #ifdef TF_TCAM_SHARED
  * @ref tf_move_tcam_shared_entries
+ *
+ * @ref tf_clear_tcam_shared_entries
 #endif
  */
 
@@ -1580,6 +1582,37 @@ struct tf_move_tcam_shared_entries_parms {
 int tf_move_tcam_shared_entries(struct tf *tfp,
 				struct tf_move_tcam_shared_entries_parms *parms);
 
+/**
+ * tf_clear_tcam_shared_entries parameter definition
+ */
+struct tf_clear_tcam_shared_entries_parms {
+	/**
+	 * [in] receive or transmit direction
+	 */
+	enum tf_dir dir;
+	/**
+	 * [in] TCAM table type
+	 */
+	enum tf_tcam_tbl_type tcam_tbl_type;
+};
+
+/**
+ * Clear TCAM shared entries pool
+ *
+ * This API only affects the following TCAM pools within a shared session:
+ *
+ * TF_TCAM_TBL_TYPE_WC_TCAM_HIGH
+ * TF_TCAM_TBL_TYPE_WC_TCAM_LOW
+ *
+ * When called, the indicated WC TCAM high or low pool will be cleared.
+ *
+ * This API is not supported on a non-shared session.
+ *
+ * Returns success or failure code.
+ */
+int tf_clear_tcam_shared_entries(struct tf *tfp,
+			      struct tf_clear_tcam_shared_entries_parms *parms);
+
 #endif /* TF_TCAM_SHARED */
 /**
  * @page table Table Access
@@ -2108,7 +2141,7 @@ struct tf_move_em_entry_parms {
 	uint64_t flow_handle;
 };
 /**
- * tf_search_em_entry parameter definition
+ * tf_search_em_entry parameter definition (Future)
  */
 struct tf_search_em_entry_parms {
 	/**
@@ -2211,7 +2244,7 @@ int tf_delete_em_entry(struct tf *tfp,
 		       struct tf_delete_em_entry_parms *parms);
 
 /**
- * search em hash entry table memory
+ * search em hash entry table memory (Future)
  *
  * Internal:
 
drivers/net/bnxt/tf_core/tf_device.h +18 -1
index 1893f630e7..da3f541685 100644
@@ -595,7 +595,24 @@ struct tf_dev_ops {
 	 *    -EINVAL - Error
 	 */
 	int (*tf_dev_move_tcam)(struct tf *tfp,
-				struct tf_move_tcam_shared_entries_parms *parms);
+			       struct tf_move_tcam_shared_entries_parms *parms);
+
+	/**
+	 * Move TCAM shared entries
+	 *
+	 * [in] tfp
+	 *   Pointer to TF handle
+	 *
+	 * [in] parms
+	 *   Pointer to parameters
+	 *
+	 *    returns:
+	 *    0       - Success
+	 *    -EINVAL - Error
+	 */
+	int (*tf_dev_clear_tcam)(struct tf *tfp,
+			      struct tf_clear_tcam_shared_entries_parms *parms);
+
 #endif /* TF_TCAM_SHARED */
 
 	/**
drivers/net/bnxt/tf_core/tf_device_p4.c +1 -3
index 239784897d..971fab7bda 100644
@@ -248,9 +248,6 @@ const struct tf_dev_ops tf_dev_ops_p4_init = {
 	.tf_dev_alloc_search_tcam = NULL,
 	.tf_dev_set_tcam = NULL,
 	.tf_dev_get_tcam = NULL,
-#ifdef TF_TCAM_SHARED
-	.tf_dev_move_tcam = NULL,
-#endif /* TF_TCAM_SHARED */
 	.tf_dev_get_tcam_resc_info = NULL,
 	.tf_dev_insert_int_em_entry = NULL,
 	.tf_dev_delete_int_em_entry = NULL,
@@ -298,6 +295,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_set_tcam = tf_tcam_shared_set,
 	.tf_dev_get_tcam = tf_tcam_shared_get,
 	.tf_dev_move_tcam = tf_tcam_shared_move_p4,
+	.tf_dev_clear_tcam = tf_tcam_shared_clear,
 #else /* !TF_TCAM_SHARED */
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
drivers/net/bnxt/tf_core/tf_device_p58.c +1 -0
index 483f771999..6bbc5e21e9 100644
@@ -339,6 +339,7 @@ const struct tf_dev_ops tf_dev_ops_p58 = {
 	.tf_dev_set_tcam = tf_tcam_shared_set,
 	.tf_dev_get_tcam = tf_tcam_shared_get,
 	.tf_dev_move_tcam = tf_tcam_shared_move_p58,
+	.tf_dev_clear_tcam = tf_tcam_shared_clear,
 #else /* !TF_TCAM_SHARED */
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
drivers/net/bnxt/tf_core/tf_tcam_shared.c +107 -4

126 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam_shared.h +21 -0
index 5588125470..020763af6b 100644
@@ -24,6 +24,11 @@
  *
  * @ref tf_tcam_shared_get
  *
+ * @ref tf_tcam_shared_move_p4
+ *
+ * @ref tf_tcam_shared_move_p58
+ *
+ * @ref tf_tcam_shared_clear
  */
 
 /**
@@ -159,4 +164,20 @@ int tf_tcam_shared_move_p4(struct tf *tfp,
 int tf_tcam_shared_move_p58(struct tf *tfp,
 			    struct tf_move_tcam_shared_entries_parms *parms);
 
+/**
+ * Allocates and clears the entire WC_TCAM_HI or WC_TCAM_LO shared pools
+ *
+ * [in] tfp
+ *   Pointer to the truflow handle
+ *
+ * [in] parms
+ *   Pointer to parameters
+ *
+ * Returns
+ *   - (0) if successful.
+ *   - (-EINVAL) on failure.
+ */
+int tf_tcam_shared_clear(struct tf *tfp,
+			 struct tf_clear_tcam_shared_entries_parms *parms);
+
 #endif /* _TF_TCAM_SHARED_H */
drivers/net/bnxt/tf_core/tf_util.h +0 -1
index 4caf50349d..854c51931a 100644
@@ -7,7 +7,6 @@
 #define _TF_UTIL_H_
 
 #include "tf_core.h"
-#include "tf_device.h"
 
 #define TF_BITS2BYTES(x) (((x) + 7) >> 3)
 #define TF_BITS2BYTES_WORD_ALIGN(x) ((((x) + 31) >> 5) * 4)
Signature · 1 line
2.21.1 (Apple Git-122.3)
#91 lore raw

PATCH v2 26/58 net/bnxt: check FW capability to support TRUFLOW

In reply to Ajit Khaparde

From: Venkat Duvvuru <[email protected]>

Currently, a devarg (host-based-truflow) is passed while launching the app to enable TRUFLOW feature. However, this mechanism adds an extra step in enabling TRUFLOW. This doesn't give a seamless experience when flow offloads has to work with FW that doesn't/does support TRUFLOW feature. Also, it's likely that customers may not want to use devarg to enable flow offloads.

This patch fixes it by checking for TRUFLOW feature support in device's capabilities and configurations field of the hwrm_ver_get.

---
 doc/guides/nics/bnxt.rst       |  3 +-
 drivers/net/bnxt/bnxt.h        | 10 +++---
 drivers/net/bnxt/bnxt_ethdev.c | 56 ----------------------------------
 drivers/net/bnxt/bnxt_hwrm.c   |  7 ++++-
 4 files changed, 12 insertions(+), 64 deletions(-)
doc/guides/nics/bnxt.rst +1 -2
index feb0c6a765..e75f4fa9e3 100644
@@ -658,8 +658,7 @@ which currently supports basic packet classification in the receive path.
 The feature uses a newly implemented control-plane firmware interface which
 optimizes flow insertions and deletions.
 
-This is a tech preview feature, and is disabled by default. It can be enabled
-using bnxt devargs. For ex: "-a 0000:0d:00.0,host-based-truflow=1”.
+This is a tech preview feature.
 
 This feature is currently supported on Whitney+ and Stingray devices.
 
drivers/net/bnxt/bnxt.h +5 -5
index e93a7eb933..532755467f 100644
@@ -688,10 +688,9 @@ struct bnxt {
 #define BNXT_FLAG_RX_VECTOR_PKT_MODE		BIT(24)
 #define BNXT_FLAG_FLOW_XSTATS_EN		BIT(25)
 #define BNXT_FLAG_DFLT_MAC_SET			BIT(26)
-#define BNXT_FLAG_TRUFLOW_EN			BIT(27)
-#define BNXT_FLAG_GFID_ENABLE			BIT(28)
-#define BNXT_FLAG_RFS_NEEDS_VNIC		BIT(29)
-#define BNXT_FLAG_FLOW_CFA_RFS_RING_TBL_IDX_V2	BIT(30)
+#define BNXT_FLAG_GFID_ENABLE			BIT(27)
+#define BNXT_FLAG_RFS_NEEDS_VNIC		BIT(28)
+#define BNXT_FLAG_FLOW_CFA_RFS_RING_TBL_IDX_V2	BIT(29)
 #define BNXT_RFS_NEEDS_VNIC(bp)	((bp)->flags & BNXT_FLAG_RFS_NEEDS_VNIC)
 #define BNXT_PF(bp)		(!((bp)->flags & BNXT_FLAG_VF))
 #define BNXT_VF(bp)		((bp)->flags & BNXT_FLAG_VF)
@@ -707,7 +706,6 @@ struct bnxt {
 #define BNXT_HAS_RING_GRPS(bp)	(!BNXT_CHIP_P5(bp))
 #define BNXT_FLOW_XSTATS_EN(bp)	((bp)->flags & BNXT_FLAG_FLOW_XSTATS_EN)
 #define BNXT_HAS_DFLT_MAC_SET(bp)      ((bp)->flags & BNXT_FLAG_DFLT_MAC_SET)
-#define BNXT_TRUFLOW_EN(bp)	((bp)->flags & BNXT_FLAG_TRUFLOW_EN)
 #define BNXT_GFID_ENABLED(bp)	((bp)->flags & BNXT_FLAG_GFID_ENABLE)
 
 	uint32_t			flags2;
@@ -729,6 +727,8 @@ struct bnxt {
 #define BNXT_FW_CAP_ADV_FLOW_MGMT	BIT(5)
 #define BNXT_FW_CAP_ADV_FLOW_COUNTERS	BIT(6)
 #define BNXT_FW_CAP_LINK_ADMIN		BIT(7)
+#define BNXT_FW_CAP_TRUFLOW_EN		BIT(8)
+#define BNXT_TRUFLOW_EN(bp)	((bp)->fw_cap & BNXT_FW_CAP_TRUFLOW_EN)
 
 	pthread_mutex_t         flow_lock;
 
drivers/net/bnxt/bnxt_ethdev.c +0 -56

86 lines not on this page · raw message

drivers/net/bnxt/bnxt_hwrm.c +6 -1
index a65ac6c0ec..6eab2342f6 100644
@@ -1349,6 +1349,12 @@ int bnxt_hwrm_ver_get(struct bnxt *bp, uint32_t timeout)
 		bp->fw_cap |= BNXT_FW_CAP_ADV_FLOW_COUNTERS;
 	}
 
+	if (dev_caps_cfg &
+	    HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED) {
+		PMD_DRV_LOG(DEBUG, "Host-based truflow feature enabled.\n");
+		bp->fw_cap |= BNXT_FW_CAP_TRUFLOW_EN;
+	}
+
 error:
 	HWRM_UNLOCK();
 	return rc;
@@ -4660,7 +4666,6 @@ int bnxt_hwrm_erase_nvram_directory(struct bnxt *bp, uint8_t index)
 	return rc;
 }
 
-
 int bnxt_hwrm_flash_nvram(struct bnxt *bp, uint16_t dir_type,
 			  uint16_t dir_ordinal, uint16_t dir_ext,
 			  uint16_t dir_attr, const uint8_t *data,
Signature · 1 line
2.21.1 (Apple Git-122.3)
#92 lore raw

PATCH v2 27/58 net/bnxt: add support for generic table processing

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Added support for generic table processing, this feature shall enable support for shared resource like mirror and TCAM cache tables.

---
 drivers/net/bnxt/tf_ulp/meson.build           |    1 +
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c         |  311 ++
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h         |  142 +
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  637 ++-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |   15 +-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   65 +-
 .../tf_ulp/ulp_template_db_stingray_class.c   | 3509 ++++++++++++++++-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |   43 +-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 3509 ++++++++++++++++-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   14 +
 drivers/net/bnxt/tf_ulp/ulp_utils.c           |  112 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.h           |   68 +
 12 files changed, 7666 insertions(+), 760 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h
drivers/net/bnxt/tf_ulp/meson.build +1 -0
index 98cbdf3177..611d7ab58e 100644
@@ -22,6 +22,7 @@ sources += files(
         'ulp_def_rules.c',
         'ulp_fc_mgr.c',
         'ulp_tun.c',
+        'ulp_gen_tbl.c',
         'ulp_template_db_wh_plus_act.c',
         'ulp_template_db_wh_plus_class.c',
         'ulp_template_db_stingray_act.c',
drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c new file +311 -0

311 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h new file +142 -0

142 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.c +264 -373

872 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +3 -12
index 4ce19cc88d..8422f44026 100644
@@ -14,6 +14,7 @@
 #include "ulp_template_struct.h"
 #include "bnxt_ulp.h"
 #include "ulp_utils.h"
+#include "ulp_gen_tbl.h"
 
 #define ULP_IDENTS_INVALID ((uint16_t)0xffff)
 
@@ -31,13 +32,6 @@ enum bnxt_ulp_cache_table_opc {
 	BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC
 };
 
-struct bnxt_ulp_mapper_cache_entry {
-	uint32_t ref_count;
-	uint16_t tcam_idx;
-	uint16_t idents[BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM];
-	uint8_t ident_types[BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM];
-};
-
 struct bnxt_ulp_mapper_glb_resource_entry {
 	enum bnxt_ulp_resource_func	resource_func;
 	uint32_t			resource_type; /* TF_ enum type */
@@ -47,8 +41,7 @@ struct bnxt_ulp_mapper_glb_resource_entry {
 struct bnxt_ulp_mapper_data {
 	struct bnxt_ulp_mapper_glb_resource_entry
 		glb_res_tbl[TF_DIR_MAX][BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ];
-	struct bnxt_ulp_mapper_cache_entry
-		*cache_tbl[BNXT_ULP_CACHE_TBL_MAX_SZ];
+	struct ulp_mapper_gen_tbl_list gen_tbl_list[BNXT_ULP_GEN_TBL_MAX_SZ];
 };
 
 /* Internal Structure for passing the arguments around */
@@ -69,13 +62,11 @@ struct bnxt_ulp_mapper_parms {
 	struct ulp_regfile			*regfile;
 	struct tf				*tfp;
 	struct bnxt_ulp_context			*ulp_ctx;
-	uint8_t					encap_byte_swap;
 	uint32_t				fid;
 	enum bnxt_ulp_fdb_type			flow_type;
 	struct bnxt_ulp_mapper_data		*mapper_data;
 	enum bnxt_ulp_cache_table_opc		tcam_tbl_opc;
-	struct bnxt_ulp_mapper_cache_entry	*cache_ptr;
-	struct bnxt_ulp_device_params           *device_params;
+	struct bnxt_ulp_device_params		*device_params;
 	uint32_t				parent_fid;
 	uint32_t				parent_flow;
 	uint8_t					tun_idx;
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +43 -22

95 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c +3341 -168

1,530 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +38 -5

43 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +3341 -168

3,509 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +14 -0
index a539ec0c84..67308f1cf1 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.c +100 -12

112 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_utils.h +68 -0

68 lines not on this page · raw message

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#93 lore raw

PATCH v2 28/58 net/bnxt: add support for mapper flow database opcodes

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Added support for mapper flow database opcode to enable shared resources like mirror action. This allows mapper to conditionally populate flow database based on template content.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 119 ++++++++++++------
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   8 ++
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   4 +
 3 files changed, 95 insertions(+), 36 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +83 -36
index 7037297922..c8ae924cf0 100644
@@ -469,6 +469,80 @@ ulp_mapper_child_flow_free(struct bnxt_ulp_context *ulp,
 	return 0;
 }
 
+/*
+ * Process the flow database opcode action.
+ * returns 0 on success.
+ */
+static int32_t
+ulp_mapper_fdb_opc_process(struct bnxt_ulp_mapper_parms *parms,
+			   struct bnxt_ulp_mapper_tbl_info *tbl,
+			   struct ulp_flow_db_res_params *fid_parms)
+{
+	uint32_t push_fid, fid = 0;
+	uint64_t val64;
+	int32_t rc = 0;
+
+	switch (tbl->fdb_opcode) {
+	case BNXT_ULP_FDB_OPC_PUSH:
+		push_fid = parms->fid;
+		break;
+	case BNXT_ULP_FDB_OPC_ALLOC_PUSH_REGFILE:
+		/* allocate a new fid */
+		rc = ulp_flow_db_fid_alloc(parms->ulp_ctx,
+					   BNXT_ULP_FDB_TYPE_REGULAR,
+					   tbl->resource_func, &fid);
+		if (rc) {
+			BNXT_TF_DBG(ERR,
+				    "Unable to allocate flow table entry\n");
+			return rc;
+		}
+		/* Store the allocated fid in regfile*/
+		val64 = fid;
+		rc = ulp_regfile_write(parms->regfile, tbl->flow_db_operand,
+				       val64);
+		if (!rc) {
+			BNXT_TF_DBG(ERR, "Write regfile[%d] failed\n",
+				    tbl->flow_db_operand);
+			rc = -EINVAL;
+			goto error;
+		}
+		/* Use the allocated fid to update the flow resource */
+		push_fid = fid;
+		break;
+	case BNXT_ULP_FDB_OPC_PUSH_REGFILE:
+		/* get the fid from the regfile */
+		rc = ulp_regfile_read(parms->regfile, tbl->flow_db_operand,
+				      &val64);
+		if (!rc) {
+			BNXT_TF_DBG(ERR, "regfile[%d] read oob\n",
+				    tbl->flow_db_operand);
+			return -EINVAL;
+		}
+		/* Use the extracted fid to update the flow resource */
+		push_fid = (uint32_t)val64;
+		break;
+	default:
+		return rc; /* Nothing to be done */
+	}
+
+	/* Add the resource to the flow database */
+	rc = ulp_flow_db_resource_add(parms->ulp_ctx, parms->flow_type,
+				      push_fid, fid_parms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to add res to flow %x rc = %d\n",
+			    push_fid, rc);
+		goto error;
+	}
+	return rc;
+
+error:
+	/* free the allocated fid */
+	if (fid)
+		ulp_flow_db_fid_free(parms->ulp_ctx,
+				     BNXT_ULP_FDB_TYPE_REGULAR, fid);
+	return rc;
+}
+
 /*
  * Process the identifier instruction and either store it in the flow database
  * or return it in the val (if not NULL) on success.  If val is NULL, the
@@ -524,10 +598,7 @@ ulp_mapper_ident_process(struct bnxt_ulp_mapper_parms *parms,
 		fid_parms.resource_hndl	= iparms.id;
 		fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
 
-		rc = ulp_flow_db_resource_add(parms->ulp_ctx,
-					      parms->flow_type,
-					      parms->fid,
-					      &fid_parms);
+		rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Failed to link res to flow rc = %d\n",
 				    rc);
@@ -618,10 +689,7 @@ ulp_mapper_ident_extract(struct bnxt_ulp_mapper_parms *parms,
 	fid_parms.resource_type = ident->ident_type;
 	fid_parms.resource_hndl = sparms.search_id;
 	fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
-	rc = ulp_flow_db_resource_add(parms->ulp_ctx,
-				      parms->flow_type,
-				      parms->fid,
-				      &fid_parms);
+	rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
 	if (rc) {
 		BNXT_TF_DBG(ERR, "Failed to link res to flow rc = %d\n",
 			    rc);
@@ -1103,10 +1171,7 @@ ulp_mapper_mark_gfid_process(struct bnxt_ulp_mapper_parms *parms,
 	fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
 	fid_parms.resource_type	= mark_flag;
 	fid_parms.resource_hndl	= gfid;
-	rc = ulp_flow_db_resource_add(parms->ulp_ctx,
-				      parms->flow_type,
-				      parms->fid,
-				      &fid_parms);
+	rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
 	if (rc)
 		BNXT_TF_DBG(ERR, "Fail to link res to flow rc = %d\n", rc);
 	return rc;
@@ -1152,10 +1217,7 @@ ulp_mapper_mark_act_ptr_process(struct bnxt_ulp_mapper_parms *parms,
 	fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
 	fid_parms.resource_type	= mark_flag;
 	fid_parms.resource_hndl	= act_idx;
-	rc = ulp_flow_db_resource_add(parms->ulp_ctx,
-				      parms->flow_type,
-				      parms->fid,
-				      &fid_parms);
+	rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
 	if (rc)
 		BNXT_TF_DBG(ERR, "Fail to link res to flow rc = %d\n", rc);
 	return rc;
@@ -1201,10 +1263,7 @@ ulp_mapper_mark_vfr_idx_process(struct bnxt_ulp_mapper_parms *parms,
 	fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
 	fid_parms.resource_type	= mark_flag;
 	fid_parms.resource_hndl	= act_idx;
-	rc = ulp_flow_db_resource_add(parms->ulp_ctx,
-				      parms->flow_type,
-				      parms->fid,
-				      &fid_parms);
+	rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
 	if (rc)
 		BNXT_TF_DBG(ERR, "Fail to link res to flow rc = %d\n", rc);
 	return rc;
@@ -1580,10 +1639,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		fid_parms.resource_type	= tbl->resource_type;
 		fid_parms.critical_resource = tbl->critical_resource;
 		fid_parms.resource_hndl	= idx;
-		rc = ulp_flow_db_resource_add(parms->ulp_ctx,
-					      parms->flow_type,
-					      parms->fid,
-					      &fid_parms);
+		rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
 		if (rc) {
 			BNXT_TF_DBG(ERR,
 				    "Failed to link resource to flow rc = %d\n",
@@ -1741,10 +1797,7 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	fid_parms.critical_resource	= tbl->critical_resource;
 	fid_parms.resource_hndl		= iparms.flow_handle;
 
-	rc = ulp_flow_db_resource_add(parms->ulp_ctx,
-				      parms->flow_type,
-				      parms->fid,
-				      &fid_parms);
+	rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
 	if (rc) {
 		BNXT_TF_DBG(ERR, "Fail to link res to flow rc = %d\n",
 			    rc);
@@ -1968,10 +2021,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	fid_parms.resource_hndl	= index;
 	fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
 
-	rc = ulp_flow_db_resource_add(parms->ulp_ctx,
-				      parms->flow_type,
-				      parms->fid,
-				      &fid_parms);
+	rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
 	if (rc) {
 		BNXT_TF_DBG(ERR, "Failed to link resource to flow rc = %d\n",
 			    rc);
@@ -2280,10 +2330,7 @@ ulp_mapper_gen_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		fid_parms.resource_sub_type = tbl->resource_sub_type;
 		fid_parms.resource_hndl	= ckey;
 		fid_parms.critical_resource = tbl->critical_resource;
-		rc = ulp_flow_db_resource_add(parms->ulp_ctx,
-					      parms->flow_type,
-					      parms->fid,
-					      &fid_parms);
+		rc = ulp_mapper_fdb_opc_process(parms, tbl, &fid_parms);
 		if (rc)
 			BNXT_TF_DBG(ERR, "Fail to add gen ent flowdb %d\n", rc);
 	}
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +8 -0
index 2a9a290eea..f16651a821 100644
@@ -179,6 +179,14 @@ enum bnxt_ulp_direction {
 	BNXT_ULP_DIRECTION_LAST = 2
 };
 
+enum bnxt_ulp_fdb_opc {
+	BNXT_ULP_FDB_OPC_PUSH = 0,
+	BNXT_ULP_FDB_OPC_ALLOC_PUSH_REGFILE = 1,
+	BNXT_ULP_FDB_OPC_PUSH_REGFILE = 2,
+	BNXT_ULP_FDB_OPC_NOP = 3,
+	BNXT_ULP_FDB_OPC_LAST = 4
+};
+
 enum bnxt_ulp_flow_mem_type {
 	BNXT_ULP_FLOW_MEM_TYPE_INT = 0,
 	BNXT_ULP_FLOW_MEM_TYPE_EXT = 1,
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +4 -0
index 67308f1cf1..167116a2f4 100644
@@ -220,6 +220,10 @@ struct bnxt_ulp_mapper_tbl_info {
 
 	/* Table opcode for table operations */
 	uint32_t			tbl_opcode;
+
+	/* FDB table opcode */
+	enum bnxt_ulp_fdb_opc		fdb_opcode;
+	uint32_t			flow_db_operand;
 };
 
 struct bnxt_ulp_mapper_key_field_info {
Signature · 1 line
2.21.1 (Apple Git-122.3)
#94 lore raw

PATCH v2 29/58 net/bnxt: add conditional processing of templates

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Conditional execution and rejection processing added for templates and tables. This allows the mapper to skip tables and reject templates based on the content without having to hard code rules.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |   1 +
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 330 ++++++++++++++----
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |   2 +
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  30 +-
 .../tf_ulp/ulp_template_db_stingray_act.c     |  30 +-
 .../tf_ulp/ulp_template_db_stingray_class.c   |   8 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c | 243 +++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h |   2 +
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c |  30 +-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    |   8 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |  18 +-
 11 files changed, 593 insertions(+), 109 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +1 -0
index 777a6badd9..ddf38ed931 100644
@@ -93,6 +93,7 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 	mapper_cparms->flow_id		= params->fid;
 	mapper_cparms->parent_flow	= params->parent_flow;
 	mapper_cparms->parent_fid	= params->parent_fid;
+	mapper_cparms->fld_bitmap	= &params->fld_bitmap;
 }
 
 /* Function to create the rte flow. */
drivers/net/bnxt/tf_ulp/ulp_mapper.c +270 -60

376 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +2 -0
index 8422f44026..8bc6cdbdd5 100644
@@ -58,6 +58,7 @@ struct bnxt_ulp_mapper_parms {
 	struct ulp_rte_act_bitmap		*act_bitmap;
 	struct ulp_rte_hdr_bitmap		*hdr_bitmap;
 	struct ulp_rte_hdr_field		*hdr_field;
+	struct ulp_rte_field_bitmap		*fld_bitmap;
 	uint32_t				*comp_fld;
 	struct ulp_regfile			*regfile;
 	struct tf				*tfp;
@@ -79,6 +80,7 @@ struct bnxt_ulp_mapper_create_parms {
 	uint32_t			*comp_fld;
 	struct ulp_rte_act_bitmap	*act;
 	struct ulp_rte_act_prop		*act_prop;
+	struct ulp_rte_field_bitmap	*fld_bitmap;
 	uint32_t			class_tid;
 	uint32_t			act_tid;
 	uint16_t			func_id;
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +21 -9
index f16651a821..e4b8c56472 100644
@@ -27,6 +27,7 @@
 #define BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM 2
 #define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 8
 #define BNXT_ULP_GLB_TEMPLATE_TBL_MAX_SZ 1
+#define BNXT_ULP_GLB_FIELD_TBL_SHIFT 7
 
 enum bnxt_ulp_action_bit {
 	BNXT_ULP_ACTION_BIT_MARK             = 0x0000000000000001,
@@ -143,15 +144,26 @@ enum bnxt_ulp_cf_idx {
 	BNXT_ULP_CF_IDX_LAST = 46
 };
 
-enum bnxt_ulp_cond_opcode {
-	BNXT_ULP_COND_OPCODE_NOP = 0,
-	BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET = 1,
-	BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET = 2,
-	BNXT_ULP_COND_OPCODE_HDR_BIT_IS_SET = 3,
-	BNXT_ULP_COND_OPCODE_COMP_FIELD_NOT_SET = 4,
-	BNXT_ULP_COND_OPCODE_ACTION_BIT_NOT_SET = 5,
-	BNXT_ULP_COND_OPCODE_HDR_BIT_NOT_SET = 6,
-	BNXT_ULP_COND_OPCODE_LAST = 7
+enum bnxt_ulp_cond_list_opc {
+	BNXT_ULP_COND_LIST_OPC_TRUE = 0,
+	BNXT_ULP_COND_LIST_OPC_FALSE = 1,
+	BNXT_ULP_COND_LIST_OPC_OR = 2,
+	BNXT_ULP_COND_LIST_OPC_AND = 3,
+	BNXT_ULP_COND_LIST_OPC_LAST = 4
+};
+
+enum bnxt_ulp_cond_opc {
+	BNXT_ULP_COND_OPC_COMP_FIELD_IS_SET = 0,
+	BNXT_ULP_COND_OPC_COMP_FIELD_NOT_SET = 1,
+	BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET = 2,
+	BNXT_ULP_COND_OPC_ACTION_BIT_NOT_SET = 3,
+	BNXT_ULP_COND_OPC_HDR_BIT_IS_SET = 4,
+	BNXT_ULP_COND_OPC_HDR_BIT_NOT_SET = 5,
+	BNXT_ULP_COND_OPC_FIELD_BIT_IS_SET = 6,
+	BNXT_ULP_COND_OPC_FIELD_BIT_NOT_SET = 7,
+	BNXT_ULP_COND_OPC_REGFILE_IS_SET = 8,
+	BNXT_ULP_COND_OPC_REGFILE_NOT_SET = 9,
+	BNXT_ULP_COND_OPC_LAST = 10
 };
 
 enum bnxt_ulp_critical_resource {
drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_act.c +15 -15
index b370da22f7..6ad6263183 100644
@@ -47,7 +47,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -64,7 +64,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_MODIFY_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_SET_IPV4_SRC,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -81,7 +81,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_MODIFY_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_SET_IPV4_DST,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -146,7 +146,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -195,7 +195,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -244,7 +244,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -261,7 +261,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_SP_SMAC_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_IS_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_ACT_ENCAP_IPV4_FLAG,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
@@ -278,7 +278,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_SP_SMAC_IPV6,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_IS_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_ACT_ENCAP_IPV6_FLAG,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
@@ -342,7 +342,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -359,7 +359,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_MODIFY_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_SET_IPV4_SRC,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -376,7 +376,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_MODIFY_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_SET_IPV4_DST,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -441,7 +441,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -459,7 +459,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
 	.mem_type_opcode = BNXT_ULP_MEM_TYPE_OPCODE_EXECUTE_IF_INT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_PUSH_VLAN,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -493,7 +493,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
 	.mem_type_opcode = BNXT_ULP_MEM_TYPE_OPCODE_EXECUTE_IF_EXT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_NOT_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_NOT_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_PUSH_VLAN,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -511,7 +511,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[] = {
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
 	.mem_type_opcode = BNXT_ULP_MEM_TYPE_OPCODE_EXECUTE_IF_EXT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_PUSH_VLAN,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c +4 -4
index a8f26e8c51..c11d1ad96d 100644
@@ -292,7 +292,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_class_tbl_list[] = {
 	{ /* class_tid: 2, stingray, table: l2_cntxt_tcam_vfr_0 */
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_IS_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_VFR_MODE,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -315,7 +315,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_CACHE_TYPE_L2_CNTXT_TCAM,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_NOT_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_NOT_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_VFR_MODE,
 	.direction = TF_DIR_TX,
 	.key_start_idx = 27,
@@ -332,7 +332,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_class_tbl_list[] = {
 	{ /* class_tid: 2, stingray, table: l2_cntxt_tcam_0 */
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_NOT_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_NOT_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_VFR_MODE,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -1785,7 +1785,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_class_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT_ACC,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +243 -0

249 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h +2 -0
index 684e93f557..a656f3da52 100644
@@ -45,4 +45,6 @@ extern struct bnxt_ulp_mapper_tbl_info ulp_stingray_act_tbl_list[];
 
 extern struct
 bnxt_ulp_mapper_result_field_info ulp_stingray_act_result_field_list[];
+
+extern uint8_t ulp_glb_field_tbl[];
 #endif
drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +15 -15
index 26eba56516..be6149b9ce 100644
@@ -47,7 +47,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -64,7 +64,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_MODIFY_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_SET_IPV4_SRC,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -81,7 +81,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_MODIFY_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_SET_IPV4_DST,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -145,7 +145,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -194,7 +194,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -243,7 +243,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -260,7 +260,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_SP_SMAC_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_IS_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_ACT_ENCAP_IPV4_FLAG,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
@@ -277,7 +277,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_SP_SMAC_IPV6,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_IS_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_ACT_ENCAP_IPV6_FLAG,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
@@ -341,7 +341,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -358,7 +358,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_MODIFY_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_SET_IPV4_SRC,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -375,7 +375,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_MODIFY_IPV4,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_SET_IPV4_DST,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -440,7 +440,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -458,7 +458,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
 	.mem_type_opcode = BNXT_ULP_MEM_TYPE_OPCODE_EXECUTE_IF_INT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_PUSH_VLAN,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -492,7 +492,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
 	.mem_type_opcode = BNXT_ULP_MEM_TYPE_OPCODE_EXECUTE_IF_EXT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_NOT_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_NOT_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_PUSH_VLAN,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -510,7 +510,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_act_tbl_list[] = {
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
 	.mem_type_opcode = BNXT_ULP_MEM_TYPE_OPCODE_EXECUTE_IF_EXT,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_PUSH_VLAN,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +4 -4
index 1abc8ecdd4..ddf82c4abe 100644
@@ -292,7 +292,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {
 	{ /* class_tid: 2, wh_plus, table: l2_cntxt_tcam_vfr_0 */
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_IS_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_VFR_MODE,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -315,7 +315,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_CACHE_TYPE_L2_CNTXT_TCAM,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_NOT_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_NOT_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_VFR_MODE,
 	.direction = TF_DIR_TX,
 	.key_start_idx = 27,
@@ -332,7 +332,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {
 	{ /* class_tid: 2, wh_plus, table: l2_cntxt_tcam_0 */
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_NOT_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_COMP_FIELD_NOT_SET,
 	.cond_operand = BNXT_ULP_CF_IDX_VFR_MODE,
 	.direction = TF_DIR_TX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -1785,7 +1785,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_wh_plus_class_tbl_list[] = {
 	.resource_type = TF_TBL_TYPE_ACT_STATS_64,
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT_ACC,
-	.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
+	.cond_opcode = BNXT_ULP_COND_OPC_ACTION_BIT_IS_SET,
 	.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
 	.direction = TF_DIR_RX,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +16 -2
index 167116a2f4..9a15968ea8 100644
@@ -149,12 +149,24 @@ extern	uint16_t ulp_act_sig_tbl[];
 extern struct bnxt_ulp_act_match_info ulp_act_match_list[];
 
 /* Device Specific Tables for mapper */
+struct bnxt_ulp_mapper_cond_info {
+	enum bnxt_ulp_cond_opc cond_opcode;
+	uint32_t cond_operand;
+};
+
+struct bnxt_ulp_mapper_cond_list_info {
+	enum bnxt_ulp_cond_list_opc cond_list_opcode;
+	uint32_t cond_start_idx;
+	uint32_t cond_nums;
+};
+
 struct ulp_template_device_tbls {
 	struct bnxt_ulp_mapper_tbl_list_info *tmpl_list;
 	struct bnxt_ulp_mapper_tbl_info *tbl_list;
 	struct bnxt_ulp_mapper_key_field_info *key_field_list;
 	struct bnxt_ulp_mapper_result_field_info *result_field_list;
 	struct bnxt_ulp_mapper_ident_info *ident_list;
+	struct bnxt_ulp_mapper_cond_info *cond_list;
 };
 
 /* Device specific parameters */
@@ -183,14 +195,16 @@ struct bnxt_ulp_mapper_tbl_list_info {
 	uint32_t		device_name;
 	uint32_t		start_tbl_idx;
 	uint32_t		num_tbls;
+	struct bnxt_ulp_mapper_cond_list_info reject_info;
 };
 
 struct bnxt_ulp_mapper_tbl_info {
 	enum bnxt_ulp_resource_func	resource_func;
 	uint32_t			resource_type; /* TF_ enum type */
 	enum bnxt_ulp_resource_sub_type	resource_sub_type;
-	enum bnxt_ulp_cond_opcode	cond_opcode;
-	uint32_t			cond_operand;
+	struct bnxt_ulp_mapper_cond_list_info execute_info;
+	enum bnxt_ulp_cond_opc cond_opcode;
+	uint32_t cond_operand;
 	enum bnxt_ulp_mem_type_opcode	mem_type_opcode;
 	uint8_t				direction;
 	uint32_t			priority;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#95 lore raw

PATCH v2 30/58 net/bnxt: modify TCAM opcode processing

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Added TCAM table specific opcode to process TCAM entry creation and reuse. This change removes the TCAM cache mechanism and uses the generic table mechanism for reuse of TCAM entries.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 135 ++++++-----------
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |  15 --
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   7 +
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 138 ++++++++++++------
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   1 +
 5 files changed, 144 insertions(+), 152 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +44 -91
index c70e1c5215..56005480af 100644
@@ -1356,20 +1356,11 @@ ulp_mapper_tcam_tbl_scan_ident_alloc(struct bnxt_ulp_mapper_parms *parms,
 	uint32_t num_idents;
 	uint32_t i;
 
-	/*
-	 * Since the cache entry is responsible for allocating
-	 * identifiers when in use, allocate the identifiers only
-	 * during normal processing.
-	 */
-	if (parms->tcam_tbl_opc ==
-	    BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL) {
-		idents = ulp_mapper_ident_fields_get(parms, tbl, &num_idents);
-
-		for (i = 0; i < num_idents; i++) {
-			if (ulp_mapper_ident_process(parms, tbl,
-						     &idents[i], NULL))
-				return -EINVAL;
-		}
+	idents = ulp_mapper_ident_fields_get(parms, tbl, &num_idents);
+	for (i = 0; i < num_idents; i++) {
+		if (ulp_mapper_ident_process(parms, tbl,
+					     &idents[i], NULL))
+			return -EINVAL;
 	}
 	return 0;
 }
@@ -1490,14 +1481,15 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	struct tf_search_tcam_entry_parms searchparms   = { 0 };
 	struct ulp_flow_db_res_params	fid_parms	= { 0 };
 	struct tf_free_tcam_entry_parms free_parms	= { 0 };
-	enum bnxt_ulp_search_before_alloc search_flag;
 	uint32_t hit = 0;
 	uint16_t tmplen = 0;
 	uint16_t idx;
 
-	/* Skip this if was handled by the cache. */
-	if (parms->tcam_tbl_opc == BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_SKIP) {
-		parms->tcam_tbl_opc = BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL;
+	/* Skip this if table opcode is NOP */
+	if (tbl->tbl_opcode == BNXT_ULP_TCAM_TBL_OPC_NOT_USED ||
+	    tbl->tbl_opcode >= BNXT_ULP_TCAM_TBL_OPC_LAST) {
+		BNXT_TF_DBG(ERR, "Invalid tcam table opcode %d\n",
+			    tbl->tbl_opcode);
 		return 0;
 	}
 
@@ -1555,41 +1547,31 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 	}
 
+	/* For wild card tcam perform the post process to swap the blob */
 	if (tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM) {
 		ulp_mapper_wc_tcam_tbl_post_process(&key, tbl->key_bit_size);
 		ulp_mapper_wc_tcam_tbl_post_process(&mask, tbl->key_bit_size);
 	}
 
-	if (tbl->srch_b4_alloc == BNXT_ULP_SEARCH_BEFORE_ALLOC_NO) {
-		/*
-		 * No search for re-use is requested, so simply allocate the
-		 * tcam index.
-		 */
-		aparms.dir		= tbl->direction;
-		aparms.tcam_tbl_type	= tbl->resource_type;
-		aparms.search_enable	= tbl->srch_b4_alloc;
-		aparms.key		= ulp_blob_data_get(&key, &tmplen);
-		aparms.key_sz_in_bits	= tmplen;
+	if (tbl->tbl_opcode == BNXT_ULP_TCAM_TBL_OPC_ALLOC_WR_REGFILE) {
+		/* allocate the tcam index */
+		aparms.dir = tbl->direction;
+		aparms.tcam_tbl_type = tbl->resource_type;
+		aparms.key = ulp_blob_data_get(&key, &tmplen);
+		aparms.key_sz_in_bits = tmplen;
 		if (tbl->blob_key_bit_size != tmplen) {
 			BNXT_TF_DBG(ERR, "Key len (%d) != Expected (%d)\n",
 				    tmplen, tbl->blob_key_bit_size);
 			return -EINVAL;
 		}
 
-		aparms.mask		= ulp_blob_data_get(&mask, &tmplen);
+		aparms.mask = ulp_blob_data_get(&mask, &tmplen);
 		if (tbl->blob_key_bit_size != tmplen) {
 			BNXT_TF_DBG(ERR, "Mask len (%d) != Expected (%d)\n",
 				    tmplen, tbl->blob_key_bit_size);
 			return -EINVAL;
 		}
-
-		aparms.priority		= tbl->priority;
-
-		/*
-		 * All failures after this succeeds require the entry to be
-		 * freed. cannot return directly on failure, but needs to goto
-		 * error.
-		 */
+		aparms.priority = tbl->priority;
 		rc = tf_alloc_tcam_entry(tfp, &aparms);
 		if (rc) {
 			BNXT_TF_DBG(ERR, "tcam alloc failed rc=%d.\n", rc);
@@ -1627,14 +1609,18 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		hit = searchparms.hit;
 	}
 
-	/* if it is miss then it is same as no search before alloc */
-	if (!hit)
-		search_flag = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO;
-	else
-		search_flag = tbl->srch_b4_alloc;
+	/* Write the tcam index into the regfile*/
+	if (!ulp_regfile_write(parms->regfile, tbl->tbl_operand,
+			       (uint64_t)tfp_cpu_to_be_64(idx))) {
+		BNXT_TF_DBG(ERR, "Regfile[%d] write failed.\n",
+			    tbl->tbl_operand);
+		rc = -EINVAL;
+		/* Need to free the tcam idx, so goto error */
+		goto error;
+	}
 
-	switch (search_flag) {
-	case BNXT_ULP_SEARCH_BEFORE_ALLOC_NO:
+	/* if it is miss then it is same as no search before alloc */
+	if (!hit || tbl->tbl_opcode == BNXT_ULP_TCAM_TBL_OPC_ALLOC_WR_REGFILE) {
 		/*Scan identifier list, allocate identifier and update regfile*/
 		rc = ulp_mapper_tcam_tbl_scan_ident_alloc(parms, tbl);
 		/* Create the result blob */
@@ -1645,60 +1631,29 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		if (!rc)
 			rc = ulp_mapper_tcam_tbl_entry_write(parms, tbl, &key,
 							     &mask, &data, idx);
-		break;
-	case BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP:
-		/*Scan identifier list, extract identifier and update regfile*/
-		rc = ulp_mapper_tcam_tbl_scan_ident_extract(parms, tbl, &data);
-		break;
-	case BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_UPDATE:
+	} else {
 		/*Scan identifier list, extract identifier and update regfile*/
 		rc = ulp_mapper_tcam_tbl_scan_ident_extract(parms, tbl, &data);
-		/* Create the result blob */
-		if (!rc)
-			rc = ulp_mapper_tcam_tbl_result_create(parms, tbl,
-							       &update_data);
-		/* Update/overwrite the tcam entry */
-		if (!rc)
-			rc = ulp_mapper_tcam_tbl_entry_write(parms, tbl, &key,
-							     &mask,
-							     &update_data, idx);
-		break;
-	default:
-		BNXT_TF_DBG(ERR, "invalid search opcode\n");
-		rc =  -EINVAL;
-		break;
 	}
 	if (rc)
 		goto error;
-	/*
-	 * Only link the entry to the flow db in the event that cache was not
-	 * used.
-	 */
-	if (parms->tcam_tbl_opc == BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL) {
-		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 (rc) {
-			BNXT_TF_DBG(ERR,
-				    "Failed to link resource to flow rc = %d\n",
-				    rc);
-			/* Need to free the identifier, so goto error */
-			goto error;
-		}
-	} else {
-		/*
-		 * Reset the tcam table opcode to normal in case the next tcam
-		 * entry does not use cache.
-		 */
-		parms->tcam_tbl_opc = BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL;
+
+	/* Add the tcam index to the flow database */
+	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 (rc) {
+		BNXT_TF_DBG(ERR, "Failed to link resource to flow rc = %d\n",
+			    rc);
+		/* Need to free the identifier, so goto error */
+		goto error;
 	}
 
 	return 0;
 error:
-	parms->tcam_tbl_opc = BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL;
 	free_parms.dir			= tbl->direction;
 	free_parms.tcam_tbl_type	= tbl->resource_type;
 	free_parms.idx			= idx;
@@ -1706,7 +1661,6 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	if (trc)
 		BNXT_TF_DBG(ERR, "Failed to free tcam[%d][%d][%d] on failure\n",
 			    tbl->resource_type, tbl->direction, idx);
-
 	return rc;
 }
 
@@ -2976,7 +2930,6 @@ ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,
 	parms.comp_fld = cparms->comp_fld;
 	parms.tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);
 	parms.ulp_ctx = ulp_ctx;
-	parms.tcam_tbl_opc = BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL;
 	parms.act_tid = cparms->act_tid;
 	parms.class_tid = cparms->class_tid;
 	parms.flow_type = cparms->flow_type;
drivers/net/bnxt/tf_ulp/ulp_mapper.h +0 -15
index 8bc6cdbdd5..4c423d2374 100644
@@ -18,20 +18,6 @@
 
 #define ULP_IDENTS_INVALID ((uint16_t)0xffff)
 
-/*
- * The cache table opcode is used to convey informat from the cache handler
- * to the tcam handler.  The opcodes do the following:
- * NORMAL - tcam should process all instructions as normal
- * SKIP - tcam is using the cached entry and doesn't need to process the
- *	instruction.
- * ALLOC - tcam needs to allocate the tcam index and store in the cache entry
- */
-enum bnxt_ulp_cache_table_opc {
-	BNXT_ULP_MAPPER_TCAM_TBL_OPC_NORMAL,
-	BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_SKIP,
-	BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC
-};
-
 struct bnxt_ulp_mapper_glb_resource_entry {
 	enum bnxt_ulp_resource_func	resource_func;
 	uint32_t			resource_type; /* TF_ enum type */
@@ -66,7 +52,6 @@ struct bnxt_ulp_mapper_parms {
 	uint32_t				fid;
 	enum bnxt_ulp_fdb_type			flow_type;
 	struct bnxt_ulp_mapper_data		*mapper_data;
-	enum bnxt_ulp_cache_table_opc		tcam_tbl_opc;
 	struct bnxt_ulp_device_params		*device_params;
 	uint32_t				parent_fid;
 	uint32_t				parent_flow;
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +7 -0
index e4b8c56472..ddc396b3f9 100644
@@ -323,6 +323,13 @@ enum bnxt_ulp_regfile_index {
 	BNXT_ULP_REGFILE_INDEX_LAST = 30
 };
 
+enum bnxt_ulp_tcam_tbl_opc {
+	BNXT_ULP_TCAM_TBL_OPC_NOT_USED = 0,
+	BNXT_ULP_TCAM_TBL_OPC_ALLOC_WR_REGFILE = 1,
+	BNXT_ULP_TCAM_TBL_OPC_SRCH_ALLOC_WR_REGFILE = 2,
+	BNXT_ULP_TCAM_TBL_OPC_LAST = 3
+};
+
 enum bnxt_ulp_search_before_alloc {
 	BNXT_ULP_SEARCH_BEFORE_ALLOC_NO = 0,
 	BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP = 1,
drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +92 -46

414 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +1 -0
index 9a15968ea8..ee17390358 100644
@@ -234,6 +234,7 @@ struct bnxt_ulp_mapper_tbl_info {
 
 	/* Table opcode for table operations */
 	uint32_t			tbl_opcode;
+	uint32_t			tbl_operand;
 
 	/* FDB table opcode */
 	enum bnxt_ulp_fdb_opc		fdb_opcode;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#96 lore raw

PATCH v2 31/58 net/bnxt: modify VXLAN decap for multichannel mode

In reply to Ajit Khaparde

From: Venkat Duvvuru <[email protected]>

The driver is using physical port id as the index into the tunnel inner flow table. However, this will not work in case of multichannel mode where multiple physical functions are going to share the same physical port id.

When tunnel inner flow offload request comes before tunnel outer flow offload request, the driver caches the tunnel inner flow details and programs it in the hardware after installing the tunnel outer flow in the hardware. If more than one tunnel inner flow arrives before tunnel outer flow is offloaded, the driver rejects any such tunnel inner flow offload requests.

This patch fixes the above two problems by
1. Using dpdk port id as the index to store tunnel inner info.
2. Caching any number of tunnel inner flow offload requests that come before offloading tunnel outer flow offload request

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |   3 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |   3 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   1 +
 drivers/net/bnxt/tf_ulp/ulp_tun.c             | 192 ++++++++++++------
 drivers/net/bnxt/tf_ulp/ulp_tun.h             |  30 ++-
 5 files changed, 150 insertions(+), 79 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +3 -0
index 5c805eef97..59fb530fb1 100644
@@ -22,6 +22,7 @@
 #include "ulp_flow_db.h"
 #include "ulp_mapper.h"
 #include "ulp_port_db.h"
+#include "ulp_tun.h"
 
 /* Linked list of all TF sessions. */
 STAILQ_HEAD(, bnxt_ulp_session_state) bnxt_ulp_session_list =
@@ -533,6 +534,8 @@ ulp_ctx_init(struct bnxt *bp,
 	if (rc)
 		goto error_deinit;
 
+	ulp_tun_tbl_init(ulp_data->tun_tbl);
+
 	bnxt_ulp_cntxt_tfp_set(bp->ulp_ctx, &bp->tfp);
 	return rc;
 
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +2 -1
index ddf38ed931..836e94bc60 100644
@@ -79,6 +79,7 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 			    struct ulp_rte_parser_params *params,
 			    enum bnxt_ulp_fdb_type flow_type)
 {
+	memset(mapper_cparms, 0, sizeof(*mapper_cparms));
 	mapper_cparms->flow_type	= flow_type;
 	mapper_cparms->app_priority	= params->priority;
 	mapper_cparms->dir_attr		= params->dir_attr;
@@ -176,7 +177,7 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev,
 	params.fid = fid;
 	params.func_id = func_id;
 	params.priority = attr->priority;
-	params.port_id = bnxt_get_phy_port_id(dev->data->port_id);
+	params.port_id = dev->data->port_id;
 	/* Perform the rte flow post process */
 	ret = bnxt_ulp_rte_parser_post_process(&params);
 	if (ret == BNXT_TF_RC_ERROR)
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +1 -0
index ee17390358..b253aefe8d 100644
@@ -62,6 +62,7 @@ struct ulp_rte_act_prop {
 
 /* Structure to be used for passing all the parser functions */
 struct ulp_rte_parser_params {
+	STAILQ_ENTRY(ulp_rte_parser_params)  next;
 	struct ulp_rte_hdr_bitmap	hdr_bitmap;
 	struct ulp_rte_hdr_bitmap	hdr_fp_bit;
 	struct ulp_rte_field_bitmap	fld_bitmap;
drivers/net/bnxt/tf_ulp/ulp_tun.c +132 -60

302 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_tun.h +12 -18
index af6926f0e4..7e31f81f13 100644
@@ -15,7 +15,7 @@
 #include "ulp_template_db_enum.h"
 #include "ulp_template_struct.h"
 
-#define	BNXT_OUTER_TUN_SIGNATURE(l3_tun, params)		\
+#define	BNXT_OUTER_TUN_FLOW(l3_tun, params)		\
 	((l3_tun) &&					\
 	 ULP_BITMAP_ISSET((params)->act_bitmap.bits,	\
 			  BNXT_ULP_ACTION_BIT_JUMP))
@@ -24,22 +24,16 @@
 	 !ULP_BITMAP_ISSET((params)->hdr_bitmap.bits,			\
 			   BNXT_ULP_HDR_BIT_O_ETH))
 
-#define	BNXT_FIRST_INNER_TUN_FLOW(state, inner_tun_sig)	\
+#define	BNXT_CACHE_INNER_TUN_FLOW(state, inner_tun_sig)	\
 	((state) == BNXT_ULP_FLOW_STATE_NORMAL && (inner_tun_sig))
 #define	BNXT_INNER_TUN_FLOW(state, inner_tun_sig)		\
 	((state) == BNXT_ULP_FLOW_STATE_TUN_O_OFFLD && (inner_tun_sig))
-#define	BNXT_OUTER_TUN_FLOW(outer_tun_sig)		((outer_tun_sig))
 
 /* It is invalid to get another outer flow offload request
  * for the same tunnel, while the outer flow is already offloaded.
  */
 #define	BNXT_REJECT_OUTER_TUN_FLOW(state, outer_tun_sig)	\
 	((state) == BNXT_ULP_FLOW_STATE_TUN_O_OFFLD && (outer_tun_sig))
-/* It is invalid to get another inner flow offload request
- * for the same tunnel, while the outer flow is not yet offloaded.
- */
-#define	BNXT_REJECT_INNER_TUN_FLOW(state, inner_tun_sig)	\
-	((state) == BNXT_ULP_FLOW_STATE_TUN_I_CACHED && (inner_tun_sig))
 
 #define	ULP_TUN_O_DMAC_HDR_FIELD_INDEX	1
 #define	ULP_TUN_O_IPV4_DIP_INDEX	19
@@ -50,10 +44,10 @@
  * requests arrive.
  *
  * If inner tunnel flow offload request arrives first then the flow
- * state will change from BNXT_ULP_FLOW_STATE_NORMAL to
- * BNXT_ULP_FLOW_STATE_TUN_I_CACHED and the following outer tunnel
- * flow offload request will change the state of the flow to
- * BNXT_ULP_FLOW_STATE_TUN_O_OFFLD from BNXT_ULP_FLOW_STATE_TUN_I_CACHED.
+ * state will remain in BNXT_ULP_FLOW_STATE_NORMAL state.
+ * The following outer tunnel flow offload request will change the
+ * state of the flow to BNXT_ULP_FLOW_STATE_TUN_O_OFFLD from
+ * BNXT_ULP_FLOW_STATE_NORMAL.
  *
  * If outer tunnel flow offload request arrives first then the flow state
  * will change from BNXT_ULP_FLOW_STATE_NORMAL to
@@ -67,17 +61,15 @@
 enum bnxt_ulp_tun_flow_state {
 	BNXT_ULP_FLOW_STATE_NORMAL = 0,
 	BNXT_ULP_FLOW_STATE_TUN_O_OFFLD,
-	BNXT_ULP_FLOW_STATE_TUN_I_CACHED
 };
 
 struct ulp_per_port_flow_info {
-	enum bnxt_ulp_tun_flow_state	state;
-	uint32_t			first_tun_i_fid;
-	struct ulp_rte_parser_params	first_inner_tun_params;
+	enum bnxt_ulp_tun_flow_state		state;
+	uint32_t				tun_i_cnt;
+	STAILQ_HEAD(, ulp_rte_parser_params)	tun_i_prms_list;
 };
 
 struct bnxt_tun_cache_entry {
-	bool				valid;
 	bool				t_dst_ip_valid;
 	uint8_t				t_dmac[RTE_ETHER_ADDR_LEN];
 	union {
@@ -86,10 +78,12 @@ struct bnxt_tun_cache_entry {
 	};
 	uint32_t			outer_tun_flow_id;
 	uint16_t			outer_tun_rej_cnt;
-	uint16_t			inner_tun_rej_cnt;
 	struct ulp_per_port_flow_info	tun_flow_info[RTE_MAX_ETHPORTS];
 };
 
+void
+ulp_tun_tbl_init(struct bnxt_tun_cache_entry *tun_tbl);
+
 void
 ulp_clear_tun_entry(struct bnxt_tun_cache_entry *tun_tbl, uint8_t tun_idx);
 
Signature · 1 line
2.21.1 (Apple Git-122.3)
#97 lore raw

PATCH v2 32/58 net/bnxt: modify table processing

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

1. Added interface table specific opcode to process interface table entry creation and reuse. This allows reuse of the interface table entry for multiple flows. Changed the regfile apis to store the data in big endian format.

2. The result blob creation being done in tcam, interface, index tables are consolidate to a common method.

3. Added result blob processing for generic table write

4. Modified the index table opcode processing to support new opcodes.

5. The driver was setting key size that did not take into account the word alignment.

6. The hard coded values for critical resource is replaced with template defined values.

---
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c         |  18 +-
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h         |   4 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 674 ++++++++++--------
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  22 +
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c | 108 +--
 .../tf_ulp/ulp_template_db_wh_plus_class.c    |  69 +-
 6 files changed, 512 insertions(+), 383 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c +14 -4
index 0a15789c4e..62a5924a36 100644
@@ -5,6 +5,8 @@
 
 #include <rte_log.h>
 #include <rte_malloc.h>
+#include "tf_core.h"
+#include "tfp.h"
 #include "ulp_mapper.h"
 #include "ulp_flow_db.h"
 
@@ -163,18 +165,20 @@ ulp_mapper_gen_tbl_idx_calculate(uint32_t res_sub_type, uint32_t dir)
 }
 
 /*
- * Set the data in the generic table entry
+ * Set the data in the generic table entry, Data is in Big endian format
  *
  * entry [in] - generic table entry
  * offset [in] - The offset in bits where the data has to be set
  * len [in] - The length of the data in bits to be set
  * data [in] - pointer to the data to be used for setting the value.
+ * data_size [in] - length of the data pointer in bytes.
  *
  * returns 0 on success
  */
 int32_t
 ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,
-				  uint32_t offset, uint32_t len, uint8_t *data)
+				  uint32_t offset, uint32_t len, uint8_t *data,
+				  uint32_t data_size)
 {
 	/* validate the null arguments */
 	if (!entry || !data) {
@@ -183,12 +187,17 @@ ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,
 	}
 
 	/* check the size of the buffer for validation */
-	if ((offset + len) > ULP_BYTE_2_BITS(entry->byte_data_size)) {
+	if ((offset + len) > ULP_BYTE_2_BITS(entry->byte_data_size) ||
+	    data_size < ULP_BITS_2_BYTE(len)) {
 		BNXT_TF_DBG(ERR, "invalid offset or length %x:%x:%x\n",
 			    offset, len, entry->byte_data_size);
 		return -EINVAL;
 	}
 
+	/* adjust the data pointer */
+	data = data + (data_size - ULP_BITS_2_BYTE(len));
+
+	/* Push the data into the byte data array */
 	if (entry->byte_order == BNXT_ULP_BYTE_ORDER_LE) {
 		if (ulp_bs_push_lsb(entry->byte_data, offset, len, data) !=
 		    len) {
@@ -208,7 +217,7 @@ ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,
 }
 
 /*
- * Get the data in the generic table entry
+ * Get the data in the generic table entry, Data is in Big endian format
  *
  * entry [in] - generic table entry
  * offset [in] - The offset in bits where the data has to get
@@ -298,6 +307,7 @@ ulp_mapper_gen_tbl_res_free(struct bnxt_ulp_context *ulp_ctx,
 			    tbl_idx, res->resource_hndl);
 		return -EINVAL;
 	}
+	fid = tfp_be_to_cpu_32(fid);
 
 	/* Destroy the flow associated with the shared flow id */
 	if (ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_REGULAR,
drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h +3 -1
index c8a1112af4..701a8d10e5 100644
@@ -104,12 +104,14 @@ ulp_mapper_gen_tbl_idx_calculate(uint32_t res_sub_type, uint32_t dir);
  * offset [in] - The offset in bits where the data has to be set
  * len [in] - The length of the data in bits to be set
  * data [in] - pointer to the data to be used for setting the value.
+ * data_size [in] - length of the data pointer in bytes.
  *
  * returns 0 on success
  */
 int32_t
 ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,
-				  uint32_t offset, uint32_t len, uint8_t *data);
+				  uint32_t offset, uint32_t len, uint8_t *data,
+				  uint32_t data_size);
 
 /*
  * Get the data in the generic table entry
drivers/net/bnxt/tf_ulp/ulp_mapper.c +384 -290

896 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +22 -0
index ddc396b3f9..b9a81d881b 100644
@@ -3,6 +3,8 @@
  * All rights reserved.
  */
 
+/* date: Thu Oct 15 17:28:37 2020 */
+
 #ifndef ULP_TEMPLATE_DB_H_
 #define ULP_TEMPLATE_DB_H_
 
@@ -230,6 +232,26 @@ enum bnxt_ulp_hdr_type {
 	BNXT_ULP_HDR_TYPE_LAST = 3
 };
 
+enum bnxt_ulp_if_tbl_opc {
+	BNXT_ULP_IF_TBL_OPC_NOT_USED = 0,
+	BNXT_ULP_IF_TBL_OPC_WR_COMP_FIELD = 1,
+	BNXT_ULP_IF_TBL_OPC_WR_REGFILE = 2,
+	BNXT_ULP_IF_TBL_OPC_WR_CONST = 3,
+	BNXT_ULP_IF_TBL_OPC_RD_COMP_FIELD = 4,
+	BNXT_ULP_IF_TBL_OPC_LAST = 5
+};
+
+enum bnxt_ulp_index_tbl_opc {
+	BNXT_ULP_INDEX_TBL_OPC_NOT_USED = 0,
+	BNXT_ULP_INDEX_TBL_OPC_ALLOC_REGFILE = 1,
+	BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE = 2,
+	BNXT_ULP_INDEX_TBL_OPC_SRCH_ALLOC_WR_REGFILE = 3,
+	BNXT_ULP_INDEX_TBL_OPC_WR_GLB_REGFILE = 4,
+	BNXT_ULP_INDEX_TBL_OPC_WR_REGFILE = 5,
+	BNXT_ULP_INDEX_TBL_OPC_RD_REGFILE = 6,
+	BNXT_ULP_INDEX_TBL_OPC_LAST = 7
+};
+
 enum bnxt_ulp_index_opcode {
 	BNXT_ULP_INDEX_OPCODE_NOT_USED = 0,
 	BNXT_ULP_INDEX_OPCODE_ALLOCATE = 1,
drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +54 -54

282 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +35 -34

171 lines not on this page · raw message

Signature · 1 line
2.21.1 (Apple Git-122.3)
#98 lore raw

PATCH v2 33/58 net/bnxt: add ULP priority opcode processing

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Added ULP priority opcode to enable flexibility to the usage of the flow priority. New opcodes help template specify the flow priority accordingly.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |   7 +
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c          |  25 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |  23 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h         |   3 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  92 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |   1 +
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  75 +-
 .../tf_ulp/ulp_template_db_stingray_act.c     | 833 ++++++++++++++----
 .../tf_ulp/ulp_template_db_stingray_class.c   | 620 +++++++------
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |  12 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h |  12 +-
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c | 723 ++++++++++++---
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 506 ++++++-----
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |  18 +-
 14 files changed, 1955 insertions(+), 995 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +7 -0
index 330965061a..96aef28b92 100644
@@ -30,6 +30,13 @@
 #define BNXT_ULP_VF_REP_ENABLED		0x1
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
 
+enum bnxt_ulp_flow_mem_type {
+	BNXT_ULP_FLOW_MEM_TYPE_INT = 0,
+	BNXT_ULP_FLOW_MEM_TYPE_EXT = 1,
+	BNXT_ULP_FLOW_MEM_TYPE_BOTH = 2,
+	BNXT_ULP_FLOW_MEM_TYPE_LAST = 3
+};
+
 struct bnxt_ulp_df_rule_info {
 	uint32_t			port_to_app_flow_id;
 	uint32_t			app_to_port_flow_id;
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +15 -10
index 3eddbd6831..de21fc0e20 100644
@@ -251,7 +251,8 @@ ulp_bulk_get_flow_stats(struct tf *tfp,
 	 */
 	parms.entry_sz_in_bytes = sizeof(uint64_t);
 	stats = (uint64_t *)fc_info->shadow_hw_tbl[dir].mem_va;
-	parms.physical_mem_addr = (uintptr_t)fc_info->shadow_hw_tbl[dir].mem_pa;
+	parms.physical_mem_addr = (uint64_t)
+		((uintptr_t)(fc_info->shadow_hw_tbl[dir].mem_pa));
 
 	if (!stats) {
 		PMD_DRV_LOG(ERR,
@@ -588,11 +589,11 @@ int ulp_fc_mgr_query_count_get(struct bnxt_ulp_context *ctxt,
 		if (params.resource_func ==
 		     BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE &&
 		     (params.resource_sub_type ==
-		      BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT ||
+		      BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT ||
 		      params.resource_sub_type ==
-		      BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_EXT_COUNT ||
+		      BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_EXT_COUNT ||
 		      params.resource_sub_type ==
-		      BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT_ACC)) {
+		      BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT_ACC)) {
 			found_cntr_resource = true;
 			break;
 		}
@@ -606,7 +607,10 @@ int ulp_fc_mgr_query_count_get(struct bnxt_ulp_context *ctxt,
 	dir = params.direction;
 	hw_cntr_id = params.resource_hndl;
 	if (params.resource_sub_type ==
-			BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT) {
+			BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT) {
+		/* TODO:
+		 * Think about optimizing with try_lock later
+		 */
 		pthread_mutex_lock(&ulp_fc_info->fc_lock);
 		sw_cntr_idx = hw_cntr_id -
 			ulp_fc_info->shadow_hw_tbl[dir].start_idx;
@@ -623,11 +627,12 @@ int ulp_fc_mgr_query_count_get(struct bnxt_ulp_context *ctxt,
 		}
 		pthread_mutex_unlock(&ulp_fc_info->fc_lock);
 	} else if (params.resource_sub_type ==
-			BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT_ACC) {
-		/* Get stats from the parent child table */
-		ulp_flow_db_parent_flow_count_get(ctxt, flow_id,
-						  &count->hits, &count->bytes,
-						  count->reset);
+			BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT_ACC) {
+		/* Get the stats from the parent child table */
+		ulp_flow_db_parent_flow_count_get(ctxt,
+						  flow_id,
+						  &count->hits,
+						  &count->bytes);
 		count->hits_set = 1;
 		count->bytes_set = 1;
 	} else {
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +10 -13
index 8669edfeba..c599e0c7e1 100644
@@ -720,7 +720,7 @@ ulp_flow_db_resource_add(struct bnxt_ulp_context *ulp_ctxt,
 
 	if (params->resource_type == TF_TBL_TYPE_ACT_STATS_64 &&
 	    params->resource_sub_type ==
-	    BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT) {
+	    BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT) {
 		/* Store the first HW counter ID for this table */
 		if (!ulp_fc_mgr_start_idx_isset(ulp_ctxt, params->direction))
 			ulp_fc_mgr_start_idx_set(ulp_ctxt, params->direction,
@@ -833,7 +833,7 @@ ulp_flow_db_resource_del(struct bnxt_ulp_context *ulp_ctxt,
 	 */
 	if (params->resource_type == TF_TBL_TYPE_ACT_STATS_64 &&
 	    params->resource_sub_type ==
-	    BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT) {
+	    BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT) {
 		ulp_fc_mgr_cntr_reset(ulp_ctxt, params->direction,
 				      params->resource_hndl);
 	}
@@ -1259,7 +1259,7 @@ ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
 				   uint32_t flow_id,
 				   uint16_t *cfa_action)
 {
-	uint8_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_VFR_CFA_ACTION;
+	uint8_t sub_typ = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_VFR_CFA_ACTION;
 	struct ulp_flow_db_res_params params;
 	int32_t rc;
 
@@ -1267,7 +1267,7 @@ ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
 					     BNXT_ULP_FDB_TYPE_DEFAULT,
 					     flow_id,
 					     BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,
-					     sub_type, &params);
+					     sub_typ, &params);
 	if (rc) {
 		BNXT_TF_DBG(ERR, "CFA Action ptr not found for flow id %u\n",
 			    flow_id);
@@ -1647,7 +1647,7 @@ int32_t
 ulp_flow_db_parent_flow_create(struct bnxt_ulp_mapper_parms *parms)
 {
 	struct ulp_flow_db_res_params fid_parms;
-	uint32_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT_ACC;
+	uint32_t sub_typ = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT_ACC;
 	struct ulp_flow_db_res_params res_params;
 	int32_t fid_idx, rc;
 
@@ -1676,7 +1676,7 @@ ulp_flow_db_parent_flow_create(struct bnxt_ulp_mapper_parms *parms)
 					     BNXT_ULP_FDB_TYPE_REGULAR,
 					     parms->fid,
 					     BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,
-					     sub_type,
+					     sub_typ,
 					     &res_params)) {
 		/* Enable the counter accumulation in parent entry */
 		if (ulp_flow_db_parent_flow_count_accum_set(parms->ulp_ctx,
@@ -1708,7 +1708,7 @@ int32_t
 ulp_flow_db_child_flow_create(struct bnxt_ulp_mapper_parms *parms)
 {
 	struct ulp_flow_db_res_params fid_parms;
-	uint32_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT;
+	uint32_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT;
 	enum bnxt_ulp_resource_func res_fun;
 	struct ulp_flow_db_res_params res_p;
 	uint32_t parent_fid = parms->parent_fid;
@@ -1819,8 +1819,9 @@ ulp_flow_db_parent_flow_count_update(struct bnxt_ulp_context *ulp_ctxt,
  */
 int32_t
 ulp_flow_db_parent_flow_count_get(struct bnxt_ulp_context *ulp_ctxt,
-				  uint32_t parent_fid, uint64_t *packet_count,
-				  uint64_t *byte_count, uint8_t count_reset)
+				  uint32_t parent_fid,
+				  uint64_t *packet_count,
+				  uint64_t *byte_count)
 {
 	struct bnxt_ulp_flow_db *flow_db;
 	struct ulp_fdb_parent_child_db *p_pdb;
@@ -1841,10 +1842,6 @@ ulp_flow_db_parent_flow_count_get(struct bnxt_ulp_context *ulp_ctxt,
 					p_pdb->parent_flow_tbl[idx].pkt_count;
 				*byte_count =
 					p_pdb->parent_flow_tbl[idx].byte_count;
-				if (count_reset) {
-					p_pdb->parent_flow_tbl[idx].pkt_count = 0;
-					p_pdb->parent_flow_tbl[idx].byte_count = 0;
-				}
 			}
 			return 0;
 		}
drivers/net/bnxt/tf_ulp/ulp_flow_db.h +1 -2
index 62c914833b..14369271ff 100644
@@ -390,8 +390,7 @@ int32_t
 ulp_flow_db_parent_flow_count_get(struct bnxt_ulp_context *ulp_ctxt,
 				  uint32_t parent_fid,
 				  uint64_t *packet_count,
-				  uint64_t *byte_count,
-				  uint8_t count_reset);
+				  uint64_t *byte_count);
 
 /*
  * reset the parent accumulation counters
drivers/net/bnxt/tf_ulp/ulp_mapper.c +69 -23

210 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +1 -0
index 4c423d2374..bef72696d3 100644
@@ -56,6 +56,7 @@ struct bnxt_ulp_mapper_parms {
 	uint32_t				parent_fid;
 	uint32_t				parent_flow;
 	uint8_t					tun_idx;
+	uint32_t				app_priority;
 };
 
 struct bnxt_ulp_mapper_create_parms {
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +23 -52

119 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_act.c +642 -191

2,514 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c +306 -314

620 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +6 -6
index 4fe90d8bb9..bb48ad284a 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h +8 -4
index a656f3da52..727818bede 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +587 -136

723 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +272 -234

506 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +8 -10
index b253aefe8d..23b4c89896 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.21.1 (Apple Git-122.3)

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

#99 lore raw

PATCH v2 34/58 net/bnxt: add support to identify duplicate flows

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Conflict resolution feature allows rejection of flows based on the previously added flows that conflict. For instance, a five tuple flow is added and then you add a new flow with only 4 tuple instead having same layer2 details then it will be rejected.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |    12 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |     8 +-
 drivers/net/bnxt/tf_ulp/meson.build           |     1 +
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       |    10 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |    62 +-
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c         |    38 +-
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h         |     3 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |   789 +-
 drivers/net/bnxt/tf_ulp/ulp_matcher.c         |     2 +
 drivers/net/bnxt/tf_ulp/ulp_port_db.c         |     4 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c |   412 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |    47 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c |   766 +-
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   |  4144 +--
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  1233 +-
 .../net/bnxt/tf_ulp/ulp_template_db_field.h   |  1394 +-
 .../tf_ulp/ulp_template_db_stingray_act.c     |  3706 +-
 .../tf_ulp/ulp_template_db_stingray_class.c   | 28599 ++++-----------
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |  1024 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h |    24 +-
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c |  3705 +-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 28654 ++++------------
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |    61 +-
 drivers/net/bnxt/tf_ulp/ulp_tun.c             |   225 +-
 drivers/net/bnxt/tf_ulp/ulp_tun.h             |    37 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.c           |    16 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.h           |    10 +-
 27 files changed, 15666 insertions(+), 59320 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +2 -10
index 59fb530fb1..0975a4689f 100644
@@ -22,7 +22,6 @@
 #include "ulp_flow_db.h"
 #include "ulp_mapper.h"
 #include "ulp_port_db.h"
-#include "ulp_tun.h"
 
 /* Linked list of all TF sessions. */
 STAILQ_HEAD(, bnxt_ulp_session_state) bnxt_ulp_session_list =
@@ -55,14 +54,13 @@ bnxt_ulp_devid_get(struct bnxt *bp,
 {
 	if (BNXT_CHIP_P5(bp))
 		return -EINVAL;
-	/* Assuming Whitney */
-	*ulp_dev_id = BNXT_ULP_DEVICE_ID_WH_PLUS;
 
 	if (BNXT_STINGRAY(bp))
 		*ulp_dev_id = BNXT_ULP_DEVICE_ID_STINGRAY;
 	else
 		/* Assuming Whitney */
 		*ulp_dev_id = BNXT_ULP_DEVICE_ID_WH_PLUS;
+
 	return 0;
 }
 
@@ -400,21 +398,18 @@ ulp_eem_tbl_scope_init(struct bnxt *bp)
 
 	if (bnxt_ulp_cntxt_mem_type_get(bp->ulp_ctx, &mtype))
 		return -EINVAL;
-
 	if (mtype != BNXT_ULP_FLOW_MEM_TYPE_EXT) {
 		BNXT_TF_DBG(INFO, "Table Scope alloc is not required\n");
 		return 0;
 	}
 
 	bnxt_init_tbl_scope_parms(bp, &params);
-
 	rc = tf_alloc_tbl_scope(&bp->tfp, &params);
 	if (rc) {
 		BNXT_TF_DBG(ERR, "Unable to allocate eem table scope rc = %d\n",
 			    rc);
 		return rc;
 	}
-
 	rc = bnxt_ulp_cntxt_tbl_scope_id_set(bp->ulp_ctx, params.tbl_scope_id);
 	if (rc) {
 		BNXT_TF_DBG(ERR, "Unable to set table scope id\n");
@@ -534,8 +529,6 @@ ulp_ctx_init(struct bnxt *bp,
 	if (rc)
 		goto error_deinit;
 
-	ulp_tun_tbl_init(ulp_data->tun_tbl);
-
 	bnxt_ulp_cntxt_tfp_set(bp->ulp_ctx, &bp->tfp);
 	return rc;
 
@@ -547,8 +540,7 @@ ulp_ctx_init(struct bnxt *bp,
 
 /* The function to initialize ulp dparms with devargs */
 static int32_t
-ulp_dparms_init(struct bnxt *bp,
-		struct bnxt_ulp_context *ulp_ctx)
+ulp_dparms_init(struct bnxt *bp, struct bnxt_ulp_context *ulp_ctx)
 {
 	struct bnxt_ulp_device_params *dparms;
 	uint32_t dev_id;
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +6 -2
index 836e94bc60..2c1a2a7be3 100644
@@ -79,7 +79,6 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 			    struct ulp_rte_parser_params *params,
 			    enum bnxt_ulp_fdb_type flow_type)
 {
-	memset(mapper_cparms, 0, sizeof(*mapper_cparms));
 	mapper_cparms->flow_type	= flow_type;
 	mapper_cparms->app_priority	= params->priority;
 	mapper_cparms->dir_attr		= params->dir_attr;
@@ -95,6 +94,12 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 	mapper_cparms->parent_flow	= params->parent_flow;
 	mapper_cparms->parent_fid	= params->parent_fid;
 	mapper_cparms->fld_bitmap	= &params->fld_bitmap;
+
+	/* update the signature fields into the computed field list */
+	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_HDR_SIG_ID,
+			    params->hdr_sig_id);
+	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_FLOW_SIG_ID,
+			    params->flow_sig_id);
 }
 
 /* Function to create the rte flow. */
@@ -177,7 +182,6 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev,
 	params.fid = fid;
 	params.func_id = func_id;
 	params.priority = attr->priority;
-	params.port_id = dev->data->port_id;
 	/* Perform the rte flow post process */
 	ret = bnxt_ulp_rte_parser_post_process(&params);
 	if (ret == BNXT_TF_RC_ERROR)
drivers/net/bnxt/tf_ulp/meson.build +1 -0
index 611d7ab58e..701a510f27 100644
@@ -23,6 +23,7 @@ sources += files(
         'ulp_fc_mgr.c',
         'ulp_tun.c',
         'ulp_gen_tbl.c',
+	'ulp_rte_handler_tbl.c',
         'ulp_template_db_wh_plus_act.c',
         'ulp_template_db_wh_plus_class.c',
         'ulp_template_db_stingray_act.c',
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +5 -5
index 8a3c5ee8fb..72a6bcd1b3 100644
@@ -366,7 +366,7 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
 		goto err1;
 	}
 
-	rc = ulp_flow_db_fid_alloc(ulp_ctx, BNXT_ULP_FDB_TYPE_DEFAULT,
+	rc = ulp_flow_db_fid_alloc(ulp_ctx, mapper_params.flow_type,
 				   mapper_params.func_id, &fid);
 	if (rc) {
 		BNXT_TF_DBG(ERR, "Unable to allocate flow table entry\n");
@@ -383,7 +383,7 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
 	return 0;
 
 err3:
-	ulp_flow_db_fid_free(ulp_ctx, BNXT_ULP_FDB_TYPE_DEFAULT, fid);
+	ulp_flow_db_fid_free(ulp_ctx, mapper_params.flow_type, fid);
 err2:
 	bnxt_ulp_cntxt_release_fdb_lock(ulp_ctx);
 err1:
@@ -437,7 +437,7 @@ void
 bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint16_t port_id;
+	uint8_t port_id;
 
 	if (!BNXT_TRUFLOW_EN(bp) ||
 	    BNXT_ETH_DEV_IS_REPRESENTOR(bp->eth_dev))
@@ -501,7 +501,7 @@ int32_t
 bnxt_ulp_create_df_rules(struct bnxt *bp)
 {
 	struct bnxt_ulp_df_rule_info *info;
-	uint16_t port_id;
+	uint8_t port_id;
 	int rc;
 
 	if (!BNXT_TRUFLOW_EN(bp) ||
@@ -575,7 +575,7 @@ bnxt_ulp_create_vfr_default_rules(struct rte_eth_dev *vfr_ethdev)
 	struct rte_eth_dev *parent_dev = vfr->parent_dev;
 	struct bnxt *bp = parent_dev->data->dev_private;
 	uint16_t vfr_port_id = vfr_ethdev->data->port_id;
-	uint16_t port_id;
+	uint8_t port_id;
 	int rc;
 
 	if (!bp || !BNXT_TRUFLOW_EN(bp))
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +35 -27

181 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c +9 -29
index 62a5924a36..da394ba210 100644
@@ -47,7 +47,7 @@ ulp_mapper_generic_tbl_list_init(struct bnxt_ulp_mapper_data *mapper_data)
 		if (tbl->result_num_entries != 0) {
 			/* add 4 bytes for reference count */
 			entry->mem_data_size = (tbl->result_num_entries + 1) *
-				(tbl->result_byte_size + sizeof(uint32_t));
+				(tbl->result_num_bytes + sizeof(uint32_t));
 
 			/* allocate the big chunk of memory */
 			entry->mem_data = rte_zmalloc("ulp mapper gen tbl",
@@ -60,7 +60,7 @@ ulp_mapper_generic_tbl_list_init(struct bnxt_ulp_mapper_data *mapper_data)
 			}
 			/* Populate the generic table container */
 			entry->container.num_elem = tbl->result_num_entries;
-			entry->container.byte_data_size = tbl->result_byte_size;
+			entry->container.byte_data_size = tbl->result_num_bytes;
 			entry->container.ref_count =
 				(uint32_t *)entry->mem_data;
 			size = sizeof(uint32_t) * (tbl->result_num_entries + 1);
@@ -168,7 +168,6 @@ ulp_mapper_gen_tbl_idx_calculate(uint32_t res_sub_type, uint32_t dir)
  * Set the data in the generic table entry, Data is in Big endian format
  *
  * entry [in] - generic table entry
- * offset [in] - The offset in bits where the data has to be set
  * len [in] - The length of the data in bits to be set
  * data [in] - pointer to the data to be used for setting the value.
  * data_size [in] - length of the data pointer in bytes.
@@ -177,7 +176,7 @@ ulp_mapper_gen_tbl_idx_calculate(uint32_t res_sub_type, uint32_t dir)
  */
 int32_t
 ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,
-				  uint32_t offset, uint32_t len, uint8_t *data,
+				  uint32_t len, uint8_t *data,
 				  uint32_t data_size)
 {
 	/* validate the null arguments */
@@ -187,32 +186,13 @@ ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,
 	}
 
 	/* check the size of the buffer for validation */
-	if ((offset + len) > ULP_BYTE_2_BITS(entry->byte_data_size) ||
+	if (len > ULP_BYTE_2_BITS(entry->byte_data_size) ||
 	    data_size < ULP_BITS_2_BYTE(len)) {
-		BNXT_TF_DBG(ERR, "invalid offset or length %x:%x:%x\n",
-			    offset, len, entry->byte_data_size);
+		BNXT_TF_DBG(ERR, "invalid offset or length %x:%x\n",
+			    len, entry->byte_data_size);
 		return -EINVAL;
 	}
-
-	/* adjust the data pointer */
-	data = data + (data_size - ULP_BITS_2_BYTE(len));
-
-	/* Push the data into the byte data array */
-	if (entry->byte_order == BNXT_ULP_BYTE_ORDER_LE) {
-		if (ulp_bs_push_lsb(entry->byte_data, offset, len, data) !=
-		    len) {
-			BNXT_TF_DBG(ERR, "write failed offset = %x, len =%x\n",
-				    offset, len);
-			return -EIO;
-		}
-	} else {
-		if (ulp_bs_push_msb(entry->byte_data, offset, len, data) !=
-		    len) {
-			BNXT_TF_DBG(ERR, "write failed offset = %x, len =%x\n",
-				    offset, len);
-			return -EIO;
-		}
-	}
+	memcpy(entry->byte_data, data, ULP_BITS_2_BYTE(len));
 	return 0;
 }
 
@@ -267,7 +247,7 @@ ulp_mapper_gen_tbl_res_free(struct bnxt_ulp_context *ulp_ctx,
 {
 	struct ulp_mapper_gen_tbl_entry entry;
 	int32_t tbl_idx;
-	uint32_t fid;
+	uint32_t fid = 0;
 
 	/* Extract the resource sub type and direction */
 	tbl_idx = ulp_mapper_gen_tbl_idx_calculate(res->resource_sub_type,
@@ -310,7 +290,7 @@ ulp_mapper_gen_tbl_res_free(struct bnxt_ulp_context *ulp_ctx,
 	fid = tfp_be_to_cpu_32(fid);
 
 	/* Destroy the flow associated with the shared flow id */
-	if (ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_REGULAR,
+	if (ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_RID,
 				    fid))
 		BNXT_TF_DBG(ERR, "Error in deleting shared flow id %x\n", fid);
 
drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h +1 -2
index 701a8d10e5..6236dc3ca2 100644
@@ -101,7 +101,6 @@ ulp_mapper_gen_tbl_idx_calculate(uint32_t res_sub_type, uint32_t dir);
  * Set the data in the generic table entry
  *
  * entry [in] - generic table entry
- * offset [in] - The offset in bits where the data has to be set
  * len [in] - The length of the data in bits to be set
  * data [in] - pointer to the data to be used for setting the value.
  * data_size [in] - length of the data pointer in bytes.
@@ -110,7 +109,7 @@ ulp_mapper_gen_tbl_idx_calculate(uint32_t res_sub_type, uint32_t dir);
  */
 int32_t
 ulp_mapper_gen_tbl_entry_data_set(struct ulp_mapper_gen_tbl_entry *entry,
-				  uint32_t offset, uint32_t len, uint8_t *data,
+				  uint32_t len, uint8_t *data,
 				  uint32_t data_size);
 
 /*
drivers/net/bnxt/tf_ulp/ulp_mapper.c +398 -391

1,207 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_matcher.c +2 -0
index e23867f8b9..275214d489 100644
@@ -77,6 +77,8 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
 	BNXT_TF_DBG(DEBUG, "Found matching pattern template %d\n",
 		    class_match->class_tid);
 	*class_id = class_match->class_tid;
+	params->hdr_sig_id = class_match->hdr_sig_id;
+	params->flow_sig_id = class_match->flow_sig_id;
 	return BNXT_TF_RC_SUCCESS;
 
 error:
drivers/net/bnxt/tf_ulp/ulp_port_db.c +1 -3
index a11e6786c0..cc66c78312 100644
@@ -185,15 +185,13 @@ int32_t	ulp_port_db_dev_port_intf_update(struct bnxt_ulp_context *ulp_ctxt,
 	port_data = &port_db->phy_port_list[func->phy_port_id];
 	if (!port_data->port_valid) {
 		port_data->port_svif =
-			bnxt_get_svif(port_id, false,
-				      BNXT_ULP_INTF_TYPE_INVALID);
+			bnxt_get_svif(port_id, false, BNXT_ULP_INTF_TYPE_INVALID);
 		port_data->port_spif = bnxt_get_phy_port_id(port_id);
 		port_data->port_parif =
 			bnxt_get_parif(port_id, BNXT_ULP_INTF_TYPE_INVALID);
 		port_data->port_vport = bnxt_get_vport(port_id);
 		port_data->port_valid = true;
 	}
-
 	return 0;
 }
 
drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c new file +412 -0

412 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +14 -33

126 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +47 -719

819 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +513 -3631

4,144 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +621 -612

1,233 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_field.h +213 -1181

1,394 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_act.c +317 -3389

3,706 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c +6187 -22412

28,599 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +248 -776

1,024 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h +18 -6
index 727818bede..befde44a1b 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +316 -3389

3,705 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +6172 -22482

28,654 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +36 -25

61 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_tun.c +61 -164

225 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_tun.h +18 -19
index 7e31f81f13..8d8fd5277a 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.c +8 -8
index ff8eabd3f3..8e3a920ab4 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.h +5 -5
index bbd8c16407..9c259a7021 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.21.1 (Apple Git-122.3)

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

#100 lore raw

PATCH v2 35/58 net/bnxt: add conditional goto processing

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

The condition execute of the mapper tables have goto field that defines the offset of the next table to be processed instead of sequential processing of the tables, this improving the performance. Also, modify key and mask field opcode processing

---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       |    6 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  393 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |   36 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c |   48 +-
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 3286 ++++++++--
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    | 1222 ++--
 .../net/bnxt/tf_ulp/ulp_template_db_field.h   |  462 +-
 .../tf_ulp/ulp_template_db_stingray_act.c     |  585 +-
 .../tf_ulp/ulp_template_db_stingray_class.c   | 5638 +++++++---------
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |  234 +-
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c |  581 +-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 5656 +++++++----------
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   16 +-
 drivers/net/bnxt/tf_ulp/ulp_tun.c             |    2 +-
 drivers/net/bnxt/tf_ulp/ulp_tun.h             |    2 +-
 15 files changed, 9532 insertions(+), 8635 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +3 -3
index 72a6bcd1b3..f3b8d81766 100644
@@ -139,7 +139,7 @@ ulp_set_vlan_in_act_prop(uint16_t port_id,
 	struct ulp_rte_act_prop *act_prop = mapper_params->act_prop;
 
 	if (ULP_BITMAP_ISSET(mapper_params->act->bits,
-			     BNXT_ULP_ACTION_BIT_SET_VLAN_VID)) {
+			     BNXT_ULP_ACT_BIT_SET_VLAN_VID)) {
 		BNXT_TF_DBG(ERR,
 			    "VLAN already set, multiple VLANs unsupported\n");
 		return BNXT_TF_RC_ERROR;
@@ -148,7 +148,7 @@ ulp_set_vlan_in_act_prop(uint16_t port_id,
 	port_id = rte_cpu_to_be_16(port_id);
 
 	ULP_BITMAP_SET(mapper_params->act->bits,
-		       BNXT_ULP_ACTION_BIT_SET_VLAN_VID);
+		       BNXT_ULP_ACT_BIT_SET_VLAN_VID);
 
 	memcpy(&act_prop->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_VTAG],
 	       &port_id, sizeof(port_id));
@@ -161,7 +161,7 @@ ulp_set_mark_in_act_prop(uint16_t port_id,
 			 struct bnxt_ulp_mapper_create_parms *mapper_params)
 {
 	if (ULP_BITMAP_ISSET(mapper_params->act->bits,
-			     BNXT_ULP_ACTION_BIT_MARK)) {
+			     BNXT_ULP_ACT_BIT_MARK)) {
 		BNXT_TF_DBG(ERR,
 			    "MARK already set, multiple MARKs unsupported\n");
 		return BNXT_TF_RC_ERROR;
drivers/net/bnxt/tf_ulp/ulp_mapper.c +213 -180

559 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +18 -18
index f5f9ff6839..8de7cec2ae 100644
@@ -274,7 +274,7 @@ ulp_post_process_normal_flow(struct ulp_rte_parser_params *params)
 
 	/* Update the decrement ttl computational fields */
 	if (ULP_BITMAP_ISSET(params->act_bitmap.bits,
-			     BNXT_ULP_ACTION_BIT_DEC_TTL)) {
+			     BNXT_ULP_ACT_BIT_DEC_TTL)) {
 		/*
 		 * Check that vxlan proto is included and vxlan decap
 		 * action is not set then decrement tunnel ttl.
@@ -283,7 +283,7 @@ ulp_post_process_normal_flow(struct ulp_rte_parser_params *params)
 		if ((ULP_BITMAP_ISSET(params->hdr_bitmap.bits,
 				      BNXT_ULP_HDR_BIT_T_VXLAN) &&
 		    !ULP_BITMAP_ISSET(params->act_bitmap.bits,
-				      BNXT_ULP_ACTION_BIT_VXLAN_DECAP))) {
+				      BNXT_ULP_ACT_BIT_VXLAN_DECAP))) {
 			ULP_COMP_FLD_IDX_WR(params,
 					    BNXT_ULP_CF_IDX_ACT_T_DEC_TTL, 1);
 		} else {
@@ -1439,7 +1439,7 @@ ulp_rte_mark_act_handler(const struct rte_flow_action *action_item,
 		       &mark_id, BNXT_ULP_ACT_PROP_SZ_MARK);
 
 		/* Update the hdr_bitmap with vxlan */
-		ULP_BITMAP_SET(act->bits, BNXT_ULP_ACTION_BIT_MARK);
+		ULP_BITMAP_SET(act->bits, BNXT_ULP_ACT_BIT_MARK);
 		return BNXT_TF_RC_SUCCESS;
 	}
 	BNXT_TF_DBG(ERR, "Parse Error: Mark arg is invalid\n");
@@ -1455,7 +1455,7 @@ ulp_rte_rss_act_handler(const struct rte_flow_action *action_item,
 
 	if (rss) {
 		/* Update the hdr_bitmap with vxlan */
-		ULP_BITMAP_SET(param->act_bitmap.bits, BNXT_ULP_ACTION_BIT_RSS);
+		ULP_BITMAP_SET(param->act_bitmap.bits, BNXT_ULP_ACT_BIT_RSS);
 		return BNXT_TF_RC_SUCCESS;
 	}
 	BNXT_TF_DBG(ERR, "Parse Error: RSS arg is invalid\n");
@@ -1728,7 +1728,7 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,
 	       &vxlan_size, sizeof(uint32_t));
 
 	/* update the hdr_bitmap with vxlan */
-	ULP_BITMAP_SET(act->bits, BNXT_ULP_ACTION_BIT_VXLAN_ENCAP);
+	ULP_BITMAP_SET(act->bits, BNXT_ULP_ACT_BIT_VXLAN_ENCAP);
 	return BNXT_TF_RC_SUCCESS;
 }
 
@@ -1740,7 +1740,7 @@ ulp_rte_vxlan_decap_act_handler(const struct rte_flow_action *action_item
 {
 	/* update the hdr_bitmap with vxlan */
 	ULP_BITMAP_SET(params->act_bitmap.bits,
-		       BNXT_ULP_ACTION_BIT_VXLAN_DECAP);
+		       BNXT_ULP_ACT_BIT_VXLAN_DECAP);
 	/* Update computational field with tunnel decap info */
 	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L3_TUN_DECAP, 1);
 	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L3_TUN, 1);
@@ -1753,7 +1753,7 @@ ulp_rte_drop_act_handler(const struct rte_flow_action *action_item __rte_unused,
 			 struct ulp_rte_parser_params *params)
 {
 	/* Update the hdr_bitmap with drop */
-	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACTION_BIT_DROP);
+	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACT_BIT_DROP);
 	return BNXT_TF_RC_SUCCESS;
 }
 
@@ -1779,7 +1779,7 @@ ulp_rte_count_act_handler(const struct rte_flow_action *action_item,
 	}
 
 	/* Update the hdr_bitmap with count */
-	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACTION_BIT_COUNT);
+	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACT_BIT_COUNT);
 	return BNXT_TF_RC_SUCCESS;
 }
 
@@ -1992,7 +1992,7 @@ ulp_rte_of_pop_vlan_act_handler(const struct rte_flow_action *a __rte_unused,
 				struct ulp_rte_parser_params *params)
 {
 	/* Update the act_bitmap with pop */
-	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACTION_BIT_POP_VLAN);
+	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACT_BIT_POP_VLAN);
 	return BNXT_TF_RC_SUCCESS;
 }
 
@@ -2017,7 +2017,7 @@ ulp_rte_of_push_vlan_act_handler(const struct rte_flow_action *action_item,
 		       &ethertype, BNXT_ULP_ACT_PROP_SZ_PUSH_VLAN);
 		/* Update the hdr_bitmap with push vlan */
 		ULP_BITMAP_SET(params->act_bitmap.bits,
-			       BNXT_ULP_ACTION_BIT_PUSH_VLAN);
+			       BNXT_ULP_ACT_BIT_PUSH_VLAN);
 		return BNXT_TF_RC_SUCCESS;
 	}
 	BNXT_TF_DBG(ERR, "Parse Error: Push vlan arg is invalid\n");
@@ -2040,7 +2040,7 @@ ulp_rte_of_set_vlan_vid_act_handler(const struct rte_flow_action *action_item,
 		       &vid, BNXT_ULP_ACT_PROP_SZ_SET_VLAN_VID);
 		/* Update the hdr_bitmap with vlan vid */
 		ULP_BITMAP_SET(params->act_bitmap.bits,
-			       BNXT_ULP_ACTION_BIT_SET_VLAN_VID);
+			       BNXT_ULP_ACT_BIT_SET_VLAN_VID);
 		return BNXT_TF_RC_SUCCESS;
 	}
 	BNXT_TF_DBG(ERR, "Parse Error: Vlan vid arg is invalid\n");
@@ -2063,7 +2063,7 @@ ulp_rte_of_set_vlan_pcp_act_handler(const struct rte_flow_action *action_item,
 		       &pcp, BNXT_ULP_ACT_PROP_SZ_SET_VLAN_PCP);
 		/* Update the hdr_bitmap with vlan vid */
 		ULP_BITMAP_SET(params->act_bitmap.bits,
-			       BNXT_ULP_ACTION_BIT_SET_VLAN_PCP);
+			       BNXT_ULP_ACT_BIT_SET_VLAN_PCP);
 		return BNXT_TF_RC_SUCCESS;
 	}
 	BNXT_TF_DBG(ERR, "Parse Error: Vlan pcp arg is invalid\n");
@@ -2084,7 +2084,7 @@ ulp_rte_set_ipv4_src_act_handler(const struct rte_flow_action *action_item,
 		       &set_ipv4->ipv4_addr, BNXT_ULP_ACT_PROP_SZ_SET_IPV4_SRC);
 		/* Update the hdr_bitmap with set ipv4 src */
 		ULP_BITMAP_SET(params->act_bitmap.bits,
-			       BNXT_ULP_ACTION_BIT_SET_IPV4_SRC);
+			       BNXT_ULP_ACT_BIT_SET_IPV4_SRC);
 		return BNXT_TF_RC_SUCCESS;
 	}
 	BNXT_TF_DBG(ERR, "Parse Error: set ipv4 src arg is invalid\n");
@@ -2105,7 +2105,7 @@ ulp_rte_set_ipv4_dst_act_handler(const struct rte_flow_action *action_item,
 		       &set_ipv4->ipv4_addr, BNXT_ULP_ACT_PROP_SZ_SET_IPV4_DST);
 		/* Update the hdr_bitmap with set ipv4 dst */
 		ULP_BITMAP_SET(params->act_bitmap.bits,
-			       BNXT_ULP_ACTION_BIT_SET_IPV4_DST);
+			       BNXT_ULP_ACT_BIT_SET_IPV4_DST);
 		return BNXT_TF_RC_SUCCESS;
 	}
 	BNXT_TF_DBG(ERR, "Parse Error: set ipv4 dst arg is invalid\n");
@@ -2126,7 +2126,7 @@ ulp_rte_set_tp_src_act_handler(const struct rte_flow_action *action_item,
 		       &set_tp->port, BNXT_ULP_ACT_PROP_SZ_SET_TP_SRC);
 		/* Update the hdr_bitmap with set tp src */
 		ULP_BITMAP_SET(params->act_bitmap.bits,
-			       BNXT_ULP_ACTION_BIT_SET_TP_SRC);
+			       BNXT_ULP_ACT_BIT_SET_TP_SRC);
 		return BNXT_TF_RC_SUCCESS;
 	}
 
@@ -2148,7 +2148,7 @@ ulp_rte_set_tp_dst_act_handler(const struct rte_flow_action *action_item,
 		       &set_tp->port, BNXT_ULP_ACT_PROP_SZ_SET_TP_DST);
 		/* Update the hdr_bitmap with set tp dst */
 		ULP_BITMAP_SET(params->act_bitmap.bits,
-			       BNXT_ULP_ACTION_BIT_SET_TP_DST);
+			       BNXT_ULP_ACT_BIT_SET_TP_DST);
 		return BNXT_TF_RC_SUCCESS;
 	}
 
@@ -2162,7 +2162,7 @@ ulp_rte_dec_ttl_act_handler(const struct rte_flow_action *act __rte_unused,
 			    struct ulp_rte_parser_params *params)
 {
 	/* Update the act_bitmap with dec ttl */
-	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACTION_BIT_DEC_TTL);
+	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACT_BIT_DEC_TTL);
 	return BNXT_TF_RC_SUCCESS;
 }
 
@@ -2172,6 +2172,6 @@ ulp_rte_jump_act_handler(const struct rte_flow_action *action_item __rte_unused,
 			    struct ulp_rte_parser_params *params)
 {
 	/* Update the act_bitmap with dec ttl */
-	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACTION_BIT_JUMP);
+	ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACT_BIT_JUMP);
 	return BNXT_TF_RC_SUCCESS;
 }
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +24 -24

132 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +2909 -377

2,142 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +674 -548

1,222 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_field.h +274 -188

462 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_act.c +305 -280

585 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c +2311 -3327

5,638 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +166 -68

234 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +303 -278

581 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +2320 -3336

5,656 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +10 -6
index adb2266d09..02dfb04558 100644

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

drivers/net/bnxt/tf_ulp/ulp_tun.c +1 -1
index 7661c4571c..6a65185290 100644

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

drivers/net/bnxt/tf_ulp/ulp_tun.h +1 -1
index 8d8fd5277a..f753038337 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.21.1 (Apple Git-122.3)

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

#101 lore raw

PATCH v2 36/58 net/bnxt: set shared handle for generic table

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

The shared handle is set in the mapper params when generic resource are created, this shall be used by application as a handle to the shared resource like mirror handle.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c | 1 +
 drivers/net/bnxt/tf_ulp/ulp_mapper.h | 1 +
 2 files changed, 2 insertions(+)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +1 -0
index dc21b2a4c6..45c17cffeb 100644
@@ -2403,6 +2403,7 @@ ulp_mapper_gen_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		/* increment the reference count */
 		ULP_GEN_TBL_REF_CNT_INC(&gen_tbl_ent);
 		fdb_write = 1;
+		parms->shared_hndl = (uint64_t)tbl_idx << 32 | ckey;
 		break;
 	default:
 		BNXT_TF_DBG(ERR, "Invalid table opcode %x\n", tbl->tbl_opcode);
drivers/net/bnxt/tf_ulp/ulp_mapper.h +1 -0
index bef72696d3..b7399b8949 100644
@@ -57,6 +57,7 @@ struct bnxt_ulp_mapper_parms {
 	uint32_t				parent_flow;
 	uint8_t					tun_idx;
 	uint32_t				app_priority;
+	uint64_t				shared_hndl;
 };
 
 struct bnxt_ulp_mapper_create_parms {
Signature · 1 line
2.21.1 (Apple Git-122.3)
#102 lore raw

PATCH v2 37/58 net/bnxt: modify ULP template

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

1. Update template to add both ipv4 and ipv6 flows.
2. The VF representor template missed generic table read.

---
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 3224 ++++-------------
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  272 +-
 .../net/bnxt/tf_ulp/ulp_template_db_field.h   |  194 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |  202 +-
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c |   72 +-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 2163 +++++++++--
 6 files changed, 2946 insertions(+), 3181 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +788 -2436
index 9c630d164a..0d9531fa0f 100644
@@ -3,7 +3,7 @@
  * All rights reserved.
  */
 
-/* date: Tue Dec  1 11:40:24 2020 */
+/* date: Mon Dec  7 09:51:03 2020 */
 
 #include "ulp_template_db_enum.h"
 #include "ulp_template_db_field.h"
@@ -16,1800 +16,571 @@
  * maps hash id to ulp_class_match_list[] index
  */
 uint16_t ulp_class_sig_tbl[BNXT_ULP_CLASS_SIG_TBL_MAX_SZ] = {
-	[BNXT_ULP_CLASS_HID_07e0] = 1,
-	[BNXT_ULP_CLASS_HID_01dc] = 2,
-	[BNXT_ULP_CLASS_HID_006e] = 3,
-	[BNXT_ULP_CLASS_HID_025a] = 4,
-	[BNXT_ULP_CLASS_HID_0146] = 5,
-	[BNXT_ULP_CLASS_HID_0332] = 6,
-	[BNXT_ULP_CLASS_HID_01c4] = 7,
-	[BNXT_ULP_CLASS_HID_078a] = 8,
-	[BNXT_ULP_CLASS_HID_02ed] = 9,
-	[BNXT_ULP_CLASS_HID_04d9] = 10,
-	[BNXT_ULP_CLASS_HID_036b] = 11,
-	[BNXT_ULP_CLASS_HID_0131] = 12,
-	[BNXT_ULP_CLASS_HID_0217] = 13,
-	[BNXT_ULP_CLASS_HID_03c3] = 14,
-	[BNXT_ULP_CLASS_HID_0295] = 15,
-	[BNXT_ULP_CLASS_HID_0441] = 16,
-	[BNXT_ULP_CLASS_HID_0095] = 17,
-	[BNXT_ULP_CLASS_HID_0241] = 18,
-	[BNXT_ULP_CLASS_HID_04ed] = 19,
-	[BNXT_ULP_CLASS_HID_06d9] = 20,
-	[BNXT_ULP_CLASS_HID_07bf] = 21,
-	[BNXT_ULP_CLASS_HID_016b] = 22,
-	[BNXT_ULP_CLASS_HID_0417] = 23,
-	[BNXT_ULP_CLASS_HID_05c3] = 24,
-	[BNXT_ULP_CLASS_HID_0187] = 25,
-	[BNXT_ULP_CLASS_HID_0373] = 26,
-	[BNXT_ULP_CLASS_HID_0205] = 27,
-	[BNXT_ULP_CLASS_HID_03f1] = 28,
-	[BNXT_ULP_CLASS_HID_00a1] = 29,
-	[BNXT_ULP_CLASS_HID_029d] = 30,
-	[BNXT_ULP_CLASS_HID_012f] = 31,
-	[BNXT_ULP_CLASS_HID_031b] = 32,
-	[BNXT_ULP_CLASS_HID_072f] = 33,
-	[BNXT_ULP_CLASS_HID_011b] = 34,
-	[BNXT_ULP_CLASS_HID_0387] = 35,
-	[BNXT_ULP_CLASS_HID_0573] = 36,
-	[BNXT_ULP_CLASS_HID_0649] = 37,
-	[BNXT_ULP_CLASS_HID_0005] = 38,
-	[BNXT_ULP_CLASS_HID_02a1] = 39,
-	[BNXT_ULP_CLASS_HID_049d] = 40,
-	[BNXT_ULP_CLASS_HID_01ea] = 41,
-	[BNXT_ULP_CLASS_HID_03de] = 42,
-	[BNXT_ULP_CLASS_HID_0672] = 43,
-	[BNXT_ULP_CLASS_HID_0026] = 44,
-	[BNXT_ULP_CLASS_HID_0746] = 45,
-	[BNXT_ULP_CLASS_HID_010a] = 46,
-	[BNXT_ULP_CLASS_HID_03ae] = 47,
-	[BNXT_ULP_CLASS_HID_0592] = 48,
-	[BNXT_ULP_CLASS_HID_07d0] = 49,
-	[BNXT_ULP_CLASS_HID_01ec] = 50,
-	[BNXT_ULP_CLASS_HID_005e] = 51,
-	[BNXT_ULP_CLASS_HID_026a] = 52,
-	[BNXT_ULP_CLASS_HID_0176] = 53,
-	[BNXT_ULP_CLASS_HID_0302] = 54,
-	[BNXT_ULP_CLASS_HID_01f4] = 55,
-	[BNXT_ULP_CLASS_HID_07ba] = 56,
-	[BNXT_ULP_CLASS_HID_06a7] = 57,
-	[BNXT_ULP_CLASS_HID_006b] = 58,
-	[BNXT_ULP_CLASS_HID_0725] = 59,
-	[BNXT_ULP_CLASS_HID_00e9] = 60,
-	[BNXT_ULP_CLASS_HID_05d9] = 61,
-	[BNXT_ULP_CLASS_HID_078d] = 62,
-	[BNXT_ULP_CLASS_HID_065f] = 63,
-	[BNXT_ULP_CLASS_HID_0003] = 64,
-	[BNXT_ULP_CLASS_HID_045f] = 65,
-	[BNXT_ULP_CLASS_HID_0603] = 66,
-	[BNXT_ULP_CLASS_HID_00a7] = 67,
-	[BNXT_ULP_CLASS_HID_026b] = 68,
-	[BNXT_ULP_CLASS_HID_0371] = 69,
-	[BNXT_ULP_CLASS_HID_0525] = 70,
-	[BNXT_ULP_CLASS_HID_07d9] = 71,
-	[BNXT_ULP_CLASS_HID_018d] = 72,
-	[BNXT_ULP_CLASS_HID_0177] = 73,
-	[BNXT_ULP_CLASS_HID_033b] = 74,
-	[BNXT_ULP_CLASS_HID_05df] = 75,
-	[BNXT_ULP_CLASS_HID_0783] = 76,
-	[BNXT_ULP_CLASS_HID_0069] = 77,
-	[BNXT_ULP_CLASS_HID_025d] = 78,
-	[BNXT_ULP_CLASS_HID_00ef] = 79,
-	[BNXT_ULP_CLASS_HID_06a5] = 80,
-	[BNXT_ULP_CLASS_HID_02f1] = 81,
-	[BNXT_ULP_CLASS_HID_04a5] = 82,
-	[BNXT_ULP_CLASS_HID_0377] = 83,
-	[BNXT_ULP_CLASS_HID_053b] = 84,
-	[BNXT_ULP_CLASS_HID_0601] = 85,
-	[BNXT_ULP_CLASS_HID_03df] = 86,
-	[BNXT_ULP_CLASS_HID_0269] = 87,
-	[BNXT_ULP_CLASS_HID_045d] = 88,
-	[BNXT_ULP_CLASS_HID_02dd] = 89,
-	[BNXT_ULP_CLASS_HID_04e9] = 90,
-	[BNXT_ULP_CLASS_HID_035b] = 91,
-	[BNXT_ULP_CLASS_HID_0101] = 92,
-	[BNXT_ULP_CLASS_HID_0227] = 93,
-	[BNXT_ULP_CLASS_HID_03f3] = 94,
-	[BNXT_ULP_CLASS_HID_02a5] = 95,
-	[BNXT_ULP_CLASS_HID_0471] = 96,
-	[BNXT_ULP_CLASS_HID_00a5] = 97,
-	[BNXT_ULP_CLASS_HID_0271] = 98,
-	[BNXT_ULP_CLASS_HID_04dd] = 99,
-	[BNXT_ULP_CLASS_HID_06e9] = 100,
-	[BNXT_ULP_CLASS_HID_078f] = 101,
-	[BNXT_ULP_CLASS_HID_015b] = 102,
-	[BNXT_ULP_CLASS_HID_0427] = 103,
-	[BNXT_ULP_CLASS_HID_05f3] = 104,
-	[BNXT_ULP_CLASS_HID_01b7] = 105,
-	[BNXT_ULP_CLASS_HID_0343] = 106,
-	[BNXT_ULP_CLASS_HID_0235] = 107,
-	[BNXT_ULP_CLASS_HID_03c1] = 108,
-	[BNXT_ULP_CLASS_HID_0091] = 109,
-	[BNXT_ULP_CLASS_HID_02ad] = 110,
-	[BNXT_ULP_CLASS_HID_011f] = 111,
-	[BNXT_ULP_CLASS_HID_032b] = 112,
-	[BNXT_ULP_CLASS_HID_071f] = 113,
-	[BNXT_ULP_CLASS_HID_012b] = 114,
-	[BNXT_ULP_CLASS_HID_03b7] = 115,
-	[BNXT_ULP_CLASS_HID_0543] = 116,
-	[BNXT_ULP_CLASS_HID_0679] = 117,
-	[BNXT_ULP_CLASS_HID_0035] = 118,
-	[BNXT_ULP_CLASS_HID_0291] = 119,
-	[BNXT_ULP_CLASS_HID_04ad] = 120,
-	[BNXT_ULP_CLASS_HID_01da] = 121,
-	[BNXT_ULP_CLASS_HID_03ee] = 122,
-	[BNXT_ULP_CLASS_HID_0642] = 123,
-	[BNXT_ULP_CLASS_HID_0016] = 124,
-	[BNXT_ULP_CLASS_HID_0776] = 125,
-	[BNXT_ULP_CLASS_HID_013a] = 126,
-	[BNXT_ULP_CLASS_HID_039e] = 127,
-	[BNXT_ULP_CLASS_HID_05a2] = 128,
-	[BNXT_ULP_CLASS_HID_0697] = 129,
-	[BNXT_ULP_CLASS_HID_005b] = 130,
-	[BNXT_ULP_CLASS_HID_0715] = 131,
-	[BNXT_ULP_CLASS_HID_00d9] = 132,
-	[BNXT_ULP_CLASS_HID_05e9] = 133,
-	[BNXT_ULP_CLASS_HID_07bd] = 134,
-	[BNXT_ULP_CLASS_HID_066f] = 135,
-	[BNXT_ULP_CLASS_HID_0033] = 136,
-	[BNXT_ULP_CLASS_HID_046f] = 137,
-	[BNXT_ULP_CLASS_HID_0633] = 138,
-	[BNXT_ULP_CLASS_HID_0097] = 139,
-	[BNXT_ULP_CLASS_HID_025b] = 140,
-	[BNXT_ULP_CLASS_HID_0341] = 141,
-	[BNXT_ULP_CLASS_HID_0515] = 142,
-	[BNXT_ULP_CLASS_HID_07e9] = 143,
-	[BNXT_ULP_CLASS_HID_01bd] = 144,
-	[BNXT_ULP_CLASS_HID_0147] = 145,
-	[BNXT_ULP_CLASS_HID_030b] = 146,
-	[BNXT_ULP_CLASS_HID_05ef] = 147,
-	[BNXT_ULP_CLASS_HID_07b3] = 148,
-	[BNXT_ULP_CLASS_HID_0059] = 149,
-	[BNXT_ULP_CLASS_HID_026d] = 150,
-	[BNXT_ULP_CLASS_HID_00df] = 151,
-	[BNXT_ULP_CLASS_HID_0695] = 152,
-	[BNXT_ULP_CLASS_HID_02c1] = 153,
-	[BNXT_ULP_CLASS_HID_0495] = 154,
-	[BNXT_ULP_CLASS_HID_0347] = 155,
-	[BNXT_ULP_CLASS_HID_050b] = 156,
-	[BNXT_ULP_CLASS_HID_0631] = 157,
-	[BNXT_ULP_CLASS_HID_03ef] = 158,
-	[BNXT_ULP_CLASS_HID_0259] = 159,
-	[BNXT_ULP_CLASS_HID_046d] = 160
+	[BNXT_ULP_CLASS_HID_005c] = 1,
+	[BNXT_ULP_CLASS_HID_0003] = 2,
+	[BNXT_ULP_CLASS_HID_0132] = 3,
+	[BNXT_ULP_CLASS_HID_00e1] = 4,
+	[BNXT_ULP_CLASS_HID_0044] = 5,
+	[BNXT_ULP_CLASS_HID_001b] = 6,
+	[BNXT_ULP_CLASS_HID_012a] = 7,
+	[BNXT_ULP_CLASS_HID_00f9] = 8,
+	[BNXT_ULP_CLASS_HID_018d] = 9,
+	[BNXT_ULP_CLASS_HID_00a7] = 10,
+	[BNXT_ULP_CLASS_HID_006f] = 11,
+	[BNXT_ULP_CLASS_HID_0181] = 12,
+	[BNXT_ULP_CLASS_HID_0195] = 13,
+	[BNXT_ULP_CLASS_HID_00bf] = 14,
+	[BNXT_ULP_CLASS_HID_0077] = 15,
+	[BNXT_ULP_CLASS_HID_0199] = 16,
+	[BNXT_ULP_CLASS_HID_009a] = 17,
+	[BNXT_ULP_CLASS_HID_0192] = 18,
+	[BNXT_ULP_CLASS_HID_01e2] = 19,
+	[BNXT_ULP_CLASS_HID_00fa] = 20,
+	[BNXT_ULP_CLASS_HID_0165] = 21,
+	[BNXT_ULP_CLASS_HID_0042] = 22,
+	[BNXT_ULP_CLASS_HID_00cd] = 23,
+	[BNXT_ULP_CLASS_HID_01aa] = 24,
+	[BNXT_ULP_CLASS_HID_0178] = 25,
+	[BNXT_ULP_CLASS_HID_0070] = 26,
+	[BNXT_ULP_CLASS_HID_00f3] = 27,
+	[BNXT_ULP_CLASS_HID_01d8] = 28,
+	[BNXT_ULP_CLASS_HID_005b] = 29,
+	[BNXT_ULP_CLASS_HID_0153] = 30,
+	[BNXT_ULP_CLASS_HID_01a3] = 31,
+	[BNXT_ULP_CLASS_HID_00bb] = 32,
+	[BNXT_ULP_CLASS_HID_0082] = 33,
+	[BNXT_ULP_CLASS_HID_018a] = 34,
+	[BNXT_ULP_CLASS_HID_01fa] = 35,
+	[BNXT_ULP_CLASS_HID_00e2] = 36,
+	[BNXT_ULP_CLASS_HID_017d] = 37,
+	[BNXT_ULP_CLASS_HID_005a] = 38,
+	[BNXT_ULP_CLASS_HID_00d5] = 39,
+	[BNXT_ULP_CLASS_HID_01b2] = 40,
+	[BNXT_ULP_CLASS_HID_0160] = 41,
+	[BNXT_ULP_CLASS_HID_0068] = 42,
+	[BNXT_ULP_CLASS_HID_00eb] = 43,
+	[BNXT_ULP_CLASS_HID_01c0] = 44,
+	[BNXT_ULP_CLASS_HID_0043] = 45,
+	[BNXT_ULP_CLASS_HID_014b] = 46,
+	[BNXT_ULP_CLASS_HID_01bb] = 47,
+	[BNXT_ULP_CLASS_HID_00a3] = 48,
+	[BNXT_ULP_CLASS_HID_00cb] = 49,
+	[BNXT_ULP_CLASS_HID_00b4] = 50,
+	[BNXT_ULP_CLASS_HID_0013] = 51,
+	[BNXT_ULP_CLASS_HID_001c] = 52,
+	[BNXT_ULP_CLASS_HID_017b] = 53,
+	[BNXT_ULP_CLASS_HID_0164] = 54,
+	[BNXT_ULP_CLASS_HID_00c3] = 55,
+	[BNXT_ULP_CLASS_HID_00cc] = 56,
+	[BNXT_ULP_CLASS_HID_01a5] = 57,
+	[BNXT_ULP_CLASS_HID_0196] = 58,
+	[BNXT_ULP_CLASS_HID_010d] = 59,
+	[BNXT_ULP_CLASS_HID_00fe] = 60,
+	[BNXT_ULP_CLASS_HID_0084] = 61,
+	[BNXT_ULP_CLASS_HID_0046] = 62,
+	[BNXT_ULP_CLASS_HID_01ec] = 63,
+	[BNXT_ULP_CLASS_HID_01ae] = 64,
+	[BNXT_ULP_CLASS_HID_00d3] = 65,
+	[BNXT_ULP_CLASS_HID_00ac] = 66,
+	[BNXT_ULP_CLASS_HID_000b] = 67,
+	[BNXT_ULP_CLASS_HID_0004] = 68,
+	[BNXT_ULP_CLASS_HID_0163] = 69,
+	[BNXT_ULP_CLASS_HID_017c] = 70,
+	[BNXT_ULP_CLASS_HID_00db] = 71,
+	[BNXT_ULP_CLASS_HID_00d4] = 72,
+	[BNXT_ULP_CLASS_HID_01bd] = 73,
+	[BNXT_ULP_CLASS_HID_018e] = 74,
+	[BNXT_ULP_CLASS_HID_0115] = 75,
+	[BNXT_ULP_CLASS_HID_00e6] = 76,
+	[BNXT_ULP_CLASS_HID_009c] = 77,
+	[BNXT_ULP_CLASS_HID_005e] = 78,
+	[BNXT_ULP_CLASS_HID_01f4] = 79,
+	[BNXT_ULP_CLASS_HID_01b6] = 80
 };
 
 /* Array for the proto matcher list */
 struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 	[1] = {
-	.class_hid = BNXT_ULP_CLASS_HID_07e0,
+	.class_hid = BNXT_ULP_CLASS_HID_005c,
 	.class_tid = 1,
 	.hdr_sig_id = 0,
 	.flow_sig_id = 0,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_0_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_0_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_0_BITMASK_O_TCP_SRC_PORT |
 		BNXT_ULP_HF1_0_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[2] = {
-	.class_hid = BNXT_ULP_CLASS_HID_01dc,
+	.class_hid = BNXT_ULP_CLASS_HID_0003,
 	.class_tid = 1,
 	.hdr_sig_id = 0,
 	.flow_sig_id = 1,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_0_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_0_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_0_BITMASK_O_TCP_SRC_PORT |
 		BNXT_ULP_HF1_0_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[3] = {
-	.class_hid = BNXT_ULP_CLASS_HID_006e,
+	.class_hid = BNXT_ULP_CLASS_HID_0132,
 	.class_tid = 1,
 	.hdr_sig_id = 0,
-	.flow_sig_id = 2,
+	.flow_sig_id = 1,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_0_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_0_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_0_BITMASK_O_TCP_SRC_PORT |
 		BNXT_ULP_HF1_0_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[4] = {
-	.class_hid = BNXT_ULP_CLASS_HID_025a,
+	.class_hid = BNXT_ULP_CLASS_HID_00e1,
 	.class_tid = 1,
 	.hdr_sig_id = 0,
-	.flow_sig_id = 2,
+	.flow_sig_id = 1,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_0_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_0_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_0_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_0_BITMASK_O_TCP_SRC_PORT |
 		BNXT_ULP_HF1_0_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[5] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0146,
+	.class_hid = BNXT_ULP_CLASS_HID_0044,
 	.class_tid = 1,
-	.hdr_sig_id = 0,
-	.flow_sig_id = 2,
+	.hdr_sig_id = 1,
+	.flow_sig_id = 1,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_0_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_1_BITMASK_O_UDP_SRC_PORT |
+		BNXT_ULP_HF1_1_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[6] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0332,
+	.class_hid = BNXT_ULP_CLASS_HID_001b,
 	.class_tid = 1,
-	.hdr_sig_id = 0,
+	.hdr_sig_id = 1,
 	.flow_sig_id = 2,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_0_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_0_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_1_BITMASK_O_UDP_SRC_PORT |
+		BNXT_ULP_HF1_1_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[7] = {
-	.class_hid = BNXT_ULP_CLASS_HID_01c4,
+	.class_hid = BNXT_ULP_CLASS_HID_012a,
 	.class_tid = 1,
-	.hdr_sig_id = 0,
+	.hdr_sig_id = 1,
 	.flow_sig_id = 2,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_0_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_0_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_1_BITMASK_O_UDP_SRC_PORT |
+		BNXT_ULP_HF1_1_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[8] = {
-	.class_hid = BNXT_ULP_CLASS_HID_078a,
+	.class_hid = BNXT_ULP_CLASS_HID_00f9,
 	.class_tid = 1,
-	.hdr_sig_id = 0,
+	.hdr_sig_id = 1,
 	.flow_sig_id = 2,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_0_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_0_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_0_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_0_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_1_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_1_BITMASK_O_UDP_SRC_PORT |
+		BNXT_ULP_HF1_1_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[9] = {
-	.class_hid = BNXT_ULP_CLASS_HID_02ed,
+	.class_hid = BNXT_ULP_CLASS_HID_018d,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
+	.hdr_sig_id = 2,
 	.flow_sig_id = 2,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
 		BNXT_ULP_HDR_BIT_O_IPV6 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_2_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_2_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_PROTO_ID |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_SRC_ADDR |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[10] = {
-	.class_hid = BNXT_ULP_CLASS_HID_04d9,
+	.class_hid = BNXT_ULP_CLASS_HID_00a7,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 2,
+	.hdr_sig_id = 2,
+	.flow_sig_id = 3,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
 		BNXT_ULP_HDR_BIT_O_IPV6 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_2_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_2_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_SRC_ADDR |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[11] = {
-	.class_hid = BNXT_ULP_CLASS_HID_036b,
+	.class_hid = BNXT_ULP_CLASS_HID_006f,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 2,
+	.hdr_sig_id = 2,
+	.flow_sig_id = 3,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
 		BNXT_ULP_HDR_BIT_O_IPV6 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_2_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_PROTO_ID |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_SRC_ADDR |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[12] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0131,
+	.class_hid = BNXT_ULP_CLASS_HID_0181,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 2,
+	.hdr_sig_id = 2,
+	.flow_sig_id = 3,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
 		BNXT_ULP_HDR_BIT_O_IPV6 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_2_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_SRC_ADDR |
+		BNXT_ULP_HF1_2_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[13] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0217,
+	.class_hid = BNXT_ULP_CLASS_HID_0195,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 2,
+	.hdr_sig_id = 3,
+	.flow_sig_id = 3,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
 		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
+		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_3_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_3_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_PROTO_ID |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
+		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[14] = {
-	.class_hid = BNXT_ULP_CLASS_HID_03c3,
+	.class_hid = BNXT_ULP_CLASS_HID_00bf,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 3,
+	.hdr_sig_id = 3,
+	.flow_sig_id = 4,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
 		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
+		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_3_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_3_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
+		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[15] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0295,
+	.class_hid = BNXT_ULP_CLASS_HID_0077,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
+	.hdr_sig_id = 3,
 	.flow_sig_id = 4,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
 		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
+		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_3_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_PROTO_ID |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
+		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[16] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0441,
+	.class_hid = BNXT_ULP_CLASS_HID_0199,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
+	.hdr_sig_id = 3,
 	.flow_sig_id = 4,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
 		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
+		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_3_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
+		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
+		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[17] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0095,
+	.class_hid = BNXT_ULP_CLASS_HID_009a,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
+	.hdr_sig_id = 4,
 	.flow_sig_id = 4,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[18] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0241,
+	.class_hid = BNXT_ULP_CLASS_HID_0192,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
+	.hdr_sig_id = 4,
 	.flow_sig_id = 4,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[19] = {
-	.class_hid = BNXT_ULP_CLASS_HID_04ed,
+	.class_hid = BNXT_ULP_CLASS_HID_01e2,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
+	.hdr_sig_id = 4,
 	.flow_sig_id = 4,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[20] = {
-	.class_hid = BNXT_ULP_CLASS_HID_06d9,
+	.class_hid = BNXT_ULP_CLASS_HID_00fa,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
+	.hdr_sig_id = 4,
 	.flow_sig_id = 4,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[21] = {
-	.class_hid = BNXT_ULP_CLASS_HID_07bf,
+	.class_hid = BNXT_ULP_CLASS_HID_0165,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
+	.hdr_sig_id = 4,
 	.flow_sig_id = 4,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[22] = {
-	.class_hid = BNXT_ULP_CLASS_HID_016b,
+	.class_hid = BNXT_ULP_CLASS_HID_0042,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
+	.hdr_sig_id = 4,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[23] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0417,
+	.class_hid = BNXT_ULP_CLASS_HID_00cd,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
+	.hdr_sig_id = 4,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
 	[24] = {
-	.class_hid = BNXT_ULP_CLASS_HID_05c3,
+	.class_hid = BNXT_ULP_CLASS_HID_01aa,
 	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
+	.hdr_sig_id = 4,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[25] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0187,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[26] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0373,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[27] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0205,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[28] = {
-	.class_hid = BNXT_ULP_CLASS_HID_03f1,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[29] = {
-	.class_hid = BNXT_ULP_CLASS_HID_00a1,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[30] = {
-	.class_hid = BNXT_ULP_CLASS_HID_029d,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[31] = {
-	.class_hid = BNXT_ULP_CLASS_HID_012f,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[32] = {
-	.class_hid = BNXT_ULP_CLASS_HID_031b,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[33] = {
-	.class_hid = BNXT_ULP_CLASS_HID_072f,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[34] = {
-	.class_hid = BNXT_ULP_CLASS_HID_011b,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[35] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0387,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[36] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0573,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[37] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0649,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[38] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0005,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[39] = {
-	.class_hid = BNXT_ULP_CLASS_HID_02a1,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[40] = {
-	.class_hid = BNXT_ULP_CLASS_HID_049d,
-	.class_tid = 1,
-	.hdr_sig_id = 1,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_1_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_1_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_1_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[41] = {
-	.class_hid = BNXT_ULP_CLASS_HID_01ea,
-	.class_tid = 1,
-	.hdr_sig_id = 2,
-	.flow_sig_id = 4,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[42] = {
-	.class_hid = BNXT_ULP_CLASS_HID_03de,
-	.class_tid = 1,
-	.hdr_sig_id = 2,
-	.flow_sig_id = 5,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_2_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[43] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0672,
-	.class_tid = 1,
-	.hdr_sig_id = 2,
-	.flow_sig_id = 6,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_2_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[44] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0026,
-	.class_tid = 1,
-	.hdr_sig_id = 2,
-	.flow_sig_id = 6,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_2_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_2_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[45] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0746,
-	.class_tid = 1,
-	.hdr_sig_id = 2,
-	.flow_sig_id = 6,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[46] = {
-	.class_hid = BNXT_ULP_CLASS_HID_010a,
-	.class_tid = 1,
-	.hdr_sig_id = 2,
-	.flow_sig_id = 6,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_2_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[47] = {
-	.class_hid = BNXT_ULP_CLASS_HID_03ae,
-	.class_tid = 1,
-	.hdr_sig_id = 2,
-	.flow_sig_id = 6,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_2_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[48] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0592,
-	.class_tid = 1,
-	.hdr_sig_id = 2,
-	.flow_sig_id = 6,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_2_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_2_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_2_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[49] = {
-	.class_hid = BNXT_ULP_CLASS_HID_07d0,
-	.class_tid = 1,
-	.hdr_sig_id = 3,
-	.flow_sig_id = 6,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[50] = {
-	.class_hid = BNXT_ULP_CLASS_HID_01ec,
-	.class_tid = 1,
-	.hdr_sig_id = 3,
-	.flow_sig_id = 7,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_3_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[51] = {
-	.class_hid = BNXT_ULP_CLASS_HID_005e,
-	.class_tid = 1,
-	.hdr_sig_id = 3,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_3_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[52] = {
-	.class_hid = BNXT_ULP_CLASS_HID_026a,
-	.class_tid = 1,
-	.hdr_sig_id = 3,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_3_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_3_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[53] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0176,
-	.class_tid = 1,
-	.hdr_sig_id = 3,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[54] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0302,
-	.class_tid = 1,
-	.hdr_sig_id = 3,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_3_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[55] = {
-	.class_hid = BNXT_ULP_CLASS_HID_01f4,
-	.class_tid = 1,
-	.hdr_sig_id = 3,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_3_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[56] = {
-	.class_hid = BNXT_ULP_CLASS_HID_07ba,
-	.class_tid = 1,
-	.hdr_sig_id = 3,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_3_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_3_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_3_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[57] = {
-	.class_hid = BNXT_ULP_CLASS_HID_06a7,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[58] = {
-	.class_hid = BNXT_ULP_CLASS_HID_006b,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[59] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0725,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[60] = {
-	.class_hid = BNXT_ULP_CLASS_HID_00e9,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[61] = {
-	.class_hid = BNXT_ULP_CLASS_HID_05d9,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 8,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[62] = {
-	.class_hid = BNXT_ULP_CLASS_HID_078d,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 9,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[63] = {
-	.class_hid = BNXT_ULP_CLASS_HID_065f,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[64] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0003,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[65] = {
-	.class_hid = BNXT_ULP_CLASS_HID_045f,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[66] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0603,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[67] = {
-	.class_hid = BNXT_ULP_CLASS_HID_00a7,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[68] = {
-	.class_hid = BNXT_ULP_CLASS_HID_026b,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[69] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0371,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[70] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0525,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[71] = {
-	.class_hid = BNXT_ULP_CLASS_HID_07d9,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[72] = {
-	.class_hid = BNXT_ULP_CLASS_HID_018d,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[73] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0177,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[74] = {
-	.class_hid = BNXT_ULP_CLASS_HID_033b,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[75] = {
-	.class_hid = BNXT_ULP_CLASS_HID_05df,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[76] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0783,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[77] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0069,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[78] = {
-	.class_hid = BNXT_ULP_CLASS_HID_025d,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[79] = {
-	.class_hid = BNXT_ULP_CLASS_HID_00ef,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[80] = {
-	.class_hid = BNXT_ULP_CLASS_HID_06a5,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[81] = {
-	.class_hid = BNXT_ULP_CLASS_HID_02f1,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
-		BNXT_ULP_HDR_BIT_O_TCP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
-		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[82] = {
-	.class_hid = BNXT_ULP_CLASS_HID_04a5,
-	.class_tid = 1,
-	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
 		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[83] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0377,
+	[25] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0178,
 	.class_tid = 1,
 	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
@@ -1817,8 +588,7 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
@@ -1826,11 +596,11 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[84] = {
-	.class_hid = BNXT_ULP_CLASS_HID_053b,
+	[26] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0070,
 	.class_tid = 1,
 	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
@@ -1839,20 +609,17 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[85] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0601,
+	[27] = {
+	.class_hid = BNXT_ULP_CLASS_HID_00f3,
 	.class_tid = 1,
 	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
@@ -1860,7 +627,7 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
@@ -1869,11 +636,11 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[86] = {
-	.class_hid = BNXT_ULP_CLASS_HID_03df,
+	[28] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01d8,
 	.class_tid = 1,
 	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
@@ -1882,20 +649,18 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
 		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[87] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0269,
+	[29] = {
+	.class_hid = BNXT_ULP_CLASS_HID_005b,
 	.class_tid = 1,
 	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
@@ -1903,9 +668,8 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
@@ -1913,11 +677,11 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[88] = {
-	.class_hid = BNXT_ULP_CLASS_HID_045d,
+	[30] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0153,
 	.class_tid = 1,
 	.hdr_sig_id = 4,
-	.flow_sig_id = 10,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
@@ -1926,1472 +690,1060 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_4_BITMASK_O_ETH_TYPE |
 		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
 		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[89] = {
-	.class_hid = BNXT_ULP_CLASS_HID_02dd,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[90] = {
-	.class_hid = BNXT_ULP_CLASS_HID_04e9,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[91] = {
-	.class_hid = BNXT_ULP_CLASS_HID_035b,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[92] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0101,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[93] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0227,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 10,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[94] = {
-	.class_hid = BNXT_ULP_CLASS_HID_03f3,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 11,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[95] = {
-	.class_hid = BNXT_ULP_CLASS_HID_02a5,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[96] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0471,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[97] = {
-	.class_hid = BNXT_ULP_CLASS_HID_00a5,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[98] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0271,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[99] = {
-	.class_hid = BNXT_ULP_CLASS_HID_04dd,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[100] = {
-	.class_hid = BNXT_ULP_CLASS_HID_06e9,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[101] = {
-	.class_hid = BNXT_ULP_CLASS_HID_078f,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[102] = {
-	.class_hid = BNXT_ULP_CLASS_HID_015b,
-	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
-	.hdr_sig = { .bits =
-		BNXT_ULP_HDR_BIT_O_ETH |
-		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
-		BNXT_ULP_FLOW_DIR_BITMASK_ING },
-	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
-		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
-	},
-	[103] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0427,
+	[31] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01a3,
 	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.hdr_sig_id = 4,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[104] = {
-	.class_hid = BNXT_ULP_CLASS_HID_05f3,
+	[32] = {
+	.class_hid = BNXT_ULP_CLASS_HID_00bb,
 	.class_tid = 1,
-	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.hdr_sig_id = 4,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
-		BNXT_ULP_HDR_BIT_O_UDP |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_HDR_BIT_O_TCP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
-		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_HF1_4_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_IPV4_DST_ADDR |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_SRC_PORT |
+		BNXT_ULP_HF1_4_BITMASK_O_TCP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[105] = {
-	.class_hid = BNXT_ULP_CLASS_HID_01b7,
+	[33] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0082,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[106] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0343,
+	[34] = {
+	.class_hid = BNXT_ULP_CLASS_HID_018a,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[107] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0235,
+	[35] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01fa,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[108] = {
-	.class_hid = BNXT_ULP_CLASS_HID_03c1,
+	[36] = {
+	.class_hid = BNXT_ULP_CLASS_HID_00e2,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[109] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0091,
+	[37] = {
+	.class_hid = BNXT_ULP_CLASS_HID_017d,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 5,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
 		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[110] = {
-	.class_hid = BNXT_ULP_CLASS_HID_02ad,
+	[38] = {
+	.class_hid = BNXT_ULP_CLASS_HID_005a,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
 		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[111] = {
-	.class_hid = BNXT_ULP_CLASS_HID_011f,
+	[39] = {
+	.class_hid = BNXT_ULP_CLASS_HID_00d5,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
 		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[112] = {
-	.class_hid = BNXT_ULP_CLASS_HID_032b,
+	[40] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01b2,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
 		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[113] = {
-	.class_hid = BNXT_ULP_CLASS_HID_071f,
+	[41] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0160,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[114] = {
-	.class_hid = BNXT_ULP_CLASS_HID_012b,
+	[42] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0068,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[115] = {
-	.class_hid = BNXT_ULP_CLASS_HID_03b7,
+	[43] = {
+	.class_hid = BNXT_ULP_CLASS_HID_00eb,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[116] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0543,
+	[44] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01c0,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
 		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[117] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0679,
+	[45] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0043,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_PROTO_ID |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[118] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0035,
+	[46] = {
+	.class_hid = BNXT_ULP_CLASS_HID_014b,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
 		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
 		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_VID |
-		BNXT_ULP_HF1_5_BITMASK_OO_VLAN_TYPE |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_PROTO_ID |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_SRC_ADDR |
-		BNXT_ULP_HF1_5_BITMASK_O_IPV6_DST_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_SRC_ADDR |
+		BNXT_ULP_HF1_5_BITMASK_O_IPV4_DST_ADDR |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_SRC_PORT |
 		BNXT_ULP_HF1_5_BITMASK_O_UDP_DST_PORT |
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	},
-	[119] = {
-	.class_hid = BNXT_ULP_CLASS_HID_0291,
+	[47] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01bb,
 	.class_tid = 1,
 	.hdr_sig_id = 5,
-	.flow_sig_id = 12,
+	.flow_sig_id = 6,
 	.hdr_sig = { .bits =
 		BNXT_ULP_HDR_BIT_O_ETH |
 		BNXT_ULP_HDR_BIT_OO_VLAN |
-		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
 		BNXT_ULP_HDR_BIT_O_UDP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.field_sig = { .bits =
-		BNXT_ULP_HF1_5_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF1_5_BITMASK_O_ETH_DMAC |
[… more lines in the raw message]

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

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +97 -175

272 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_field.h +97 -97

194 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +101 -101

202 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +62 -10

72 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +1801 -362

2,163 lines not on this page · raw message

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#103 lore raw

PATCH v2 38/58 net/bnxt: add conditional opcode and L4 port fields

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

The conditional field opcode provides capability to perform changes to the field values specified by template to address platform specific modifications. For instance, mirror id value is modified before it is configured in the hardware.

The addition of L4 port compute fields enables support of generic exact match rule that can support both TCP and UDP flows with the same template.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 138 ++-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |  21 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c | 172 +++-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    | 125 ++-
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c | 801 ++++++++++++++++-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 837 ++++++++++++++++--
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   1 +
 7 files changed, 1953 insertions(+), 142 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +124 -14
index 45c17cffeb..e1717b5dc4 100644
@@ -879,6 +879,39 @@ ulp_mapper_ident_extract(struct bnxt_ulp_mapper_parms *parms,
 	return rc;
 }
 
+static int32_t
+ulp_mapper_field_process_inc_dec(struct bnxt_ulp_mapper_field_info *fld,
+				 struct ulp_blob *blob,
+				 uint64_t *val64,
+				 uint16_t const_val16,
+				 uint32_t bitlen,
+				 uint32_t *update_flag)
+{
+	uint64_t l_val64 = *val64;
+
+	if (fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_PLUS_CONST ||
+	    fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_PLUS_CONST_POST) {
+		l_val64 += const_val16;
+		l_val64 = tfp_be_to_cpu_64(l_val64);
+		ulp_blob_push_64(blob, &l_val64, bitlen);
+	} else if (fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_MINUS_CONST ||
+		   fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_MINUS_CONST_POST) {
+		l_val64 -= const_val16;
+		l_val64 = tfp_be_to_cpu_64(l_val64);
+		ulp_blob_push_64(blob, &l_val64, bitlen);
+	} else {
+		BNXT_TF_DBG(ERR, "Invalid field opcode %u\n", fld->field_opc);
+		return -EINVAL;
+	}
+
+	if (fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_MINUS_CONST_POST ||
+	    fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_PLUS_CONST_POST) {
+		*val64 = l_val64;
+		*update_flag = 1;
+	}
+	return 0;
+}
+
 static int32_t
 ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 			 enum tf_dir dir,
@@ -897,10 +930,24 @@ ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 	uint32_t src1_sel = 0;
 	enum bnxt_ulp_field_src fld_src;
 	uint8_t *fld_src_oper;
+	enum bnxt_ulp_field_cond_src field_cond_src;
+	uint16_t const_val = 0;
+	uint32_t update_flag = 0;
+	uint64_t src1_val64;
+
+	/* process the field opcode */
+	if (fld->field_opc != BNXT_ULP_FIELD_OPC_COND_OP) {
+		field_cond_src = BNXT_ULP_FIELD_COND_SRC_TRUE;
+		/* Read the constant from the second operand */
+		memcpy(&const_val, fld->field_opr2, sizeof(uint16_t));
+		const_val = tfp_be_to_cpu_16(const_val);
+	} else {
+		field_cond_src = fld->field_cond_src;
+	}
 
 	bitlen = fld->field_bit_size;
 	/* Evaluate the condition */
-	switch (fld->field_cond_src) {
+	switch (field_cond_src) {
 	case BNXT_ULP_FIELD_COND_SRC_TRUE:
 		src1_sel = 1;
 		break;
@@ -1010,12 +1057,35 @@ ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
-		if (idx < BNXT_ULP_CF_IDX_LAST)
+		if (idx >= BNXT_ULP_CF_IDX_LAST) {
+			BNXT_TF_DBG(ERR, "%s comp field [%d] read oob\n",
+				    name, idx);
+			return -EINVAL;
+		}
+		if (fld->field_opc == BNXT_ULP_FIELD_OPC_COND_OP) {
 			val = ulp_blob_push_32(blob, &parms->comp_fld[idx],
 					       bitlen);
-		if (!val) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
-			return -EINVAL;
+			if (!val) {
+				BNXT_TF_DBG(ERR, "%s push to blob failed\n",
+					    name);
+				return -EINVAL;
+			}
+		} else {
+			src1_val64 = ULP_COMP_FLD_IDX_RD(parms, idx);
+			if (ulp_mapper_field_process_inc_dec(fld, blob,
+							     &src1_val64,
+							     const_val,
+							     bitlen,
+							     &update_flag)) {
+				BNXT_TF_DBG(ERR, "%s field cond opc failed\n",
+					    name);
+				return -EINVAL;
+			}
+			if (update_flag) {
+				BNXT_TF_DBG(ERR, "%s invalid field cond opc\n",
+					    name);
+				return -EINVAL;
+			}
 		}
 		break;
 	case BNXT_ULP_FIELD_SRC_RF:
@@ -1032,11 +1102,33 @@ ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 				    name, idx);
 			return -EINVAL;
 		}
-
-		val = ulp_blob_push_64(blob, &regval, bitlen);
-		if (!val) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
-			return -EINVAL;
+		if (fld->field_opc == BNXT_ULP_FIELD_OPC_COND_OP) {
+			val = ulp_blob_push_64(blob, &regval, bitlen);
+			if (!val) {
+				BNXT_TF_DBG(ERR, "%s push to blob failed\n",
+					    name);
+				return -EINVAL;
+			}
+		} else {
+			if (ulp_mapper_field_process_inc_dec(fld, blob,
+							     &regval,
+							     const_val,
+							     bitlen,
+							     &update_flag)) {
+				BNXT_TF_DBG(ERR, "%s field cond opc failed\n",
+					    name);
+				return -EINVAL;
+			}
+			if (update_flag) {
+				regval = tfp_cpu_to_be_64(regval);
+				if (ulp_regfile_write(parms->regfile, idx,
+						      regval)) {
+					BNXT_TF_DBG(ERR,
+						    "Write regfile[%d] fail\n",
+						    idx);
+					return -EINVAL;
+				}
+			}
 		}
 		break;
 	case BNXT_ULP_FIELD_SRC_ACT_PROP:
@@ -1109,10 +1201,28 @@ ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 				    name, idx);
 			return -EINVAL;
 		}
-		val = ulp_blob_push_64(blob, &regval, bitlen);
-		if (!val) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
-			return -EINVAL;
+		if (fld->field_opc == BNXT_ULP_FIELD_OPC_COND_OP) {
+			val = ulp_blob_push_64(blob, &regval, bitlen);
+			if (!val) {
+				BNXT_TF_DBG(ERR, "%s push to blob failed\n",
+					    name);
+				return -EINVAL;
+			}
+		} else {
+			if (ulp_mapper_field_process_inc_dec(fld, blob,
+							     &regval,
+							     const_val,
+							     bitlen,
+							     &update_flag)) {
+				BNXT_TF_DBG(ERR, "%s field cond opc failed\n",
+					    name);
+				return -EINVAL;
+			}
+			if (update_flag) {
+				BNXT_TF_DBG(ERR, "%s invalid field cond opc\n",
+					    name);
+				return -EINVAL;
+			}
 		}
 		break;
 	case BNXT_ULP_FIELD_SRC_HF:
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +17 -4
index 8de7cec2ae..37dedbe243 100644
@@ -1176,7 +1176,7 @@ ulp_rte_udp_hdr_handler(const struct rte_flow_item *item,
 	struct ulp_rte_hdr_bitmap *hdr_bitmap = &params->hdr_bitmap;
 	uint32_t idx = params->field_idx;
 	uint32_t size;
-	uint16_t dst_port = 0;
+	uint16_t dport = 0, sport = 0;
 	uint32_t cnt;
 
 	cnt = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_L4_HDR_CNT);
@@ -1194,12 +1194,12 @@ ulp_rte_udp_hdr_handler(const struct rte_flow_item *item,
 		field = ulp_rte_parser_fld_copy(&params->hdr_field[idx],
 						&udp_spec->hdr.src_port,
 						size);
-
+		sport = udp_spec->hdr.src_port;
 		size = sizeof(udp_spec->hdr.dst_port);
 		field = ulp_rte_parser_fld_copy(field,
 						&udp_spec->hdr.dst_port,
 						size);
-		dst_port = udp_spec->hdr.dst_port;
+		dport = udp_spec->hdr.dst_port;
 		size = sizeof(udp_spec->hdr.dgram_len);
 		field = ulp_rte_parser_fld_copy(field,
 						&udp_spec->hdr.dgram_len,
@@ -1232,11 +1232,17 @@ ulp_rte_udp_hdr_handler(const struct rte_flow_item *item,
 	    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_TCP)) {
 		ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_UDP);
 		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4, 1);
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4_SPORT, sport);
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4_DPORT, dport);
+
 	} else {
 		ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_UDP);
 		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4, 1);
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4_SPORT, sport);
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4_DPORT, dport);
+
 		/* Update the field protocol hdr bitmap */
-		ulp_rte_l4_proto_type_update(params, dst_port);
+		ulp_rte_l4_proto_type_update(params, dport);
 	}
 	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L4_HDR_CNT, ++cnt);
 	return BNXT_TF_RC_SUCCESS;
@@ -1252,6 +1258,7 @@ ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item,
 	struct ulp_rte_hdr_field *field;
 	struct ulp_rte_hdr_bitmap *hdr_bitmap = &params->hdr_bitmap;
 	uint32_t idx = params->field_idx;
+	uint16_t dport = 0, sport = 0;
 	uint32_t size;
 	uint32_t cnt;
 
@@ -1266,10 +1273,12 @@ ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item,
 	 * header fields
 	 */
 	if (tcp_spec) {
+		sport = tcp_spec->hdr.src_port;
 		size = sizeof(tcp_spec->hdr.src_port);
 		field = ulp_rte_parser_fld_copy(&params->hdr_field[idx],
 						&tcp_spec->hdr.src_port,
 						size);
+		dport = tcp_spec->hdr.dst_port;
 		size = sizeof(tcp_spec->hdr.dst_port);
 		field = ulp_rte_parser_fld_copy(field,
 						&tcp_spec->hdr.dst_port,
@@ -1343,9 +1352,13 @@ ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item,
 	    ULP_BITMAP_ISSET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_TCP)) {
 		ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_I_TCP);
 		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4, 1);
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4_SPORT, sport);
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_L4_DPORT, dport);
 	} else {
 		ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_O_TCP);
 		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4, 1);
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4_SPORT, sport);
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_L4_DPORT, dport);
 	}
 	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_L4_HDR_CNT, ++cnt);
 	return BNXT_TF_RC_SUCCESS;
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +159 -13

230 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +76 -49

167 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +793 -8

1,084 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +783 -54

1,274 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +1 -0
index 02dfb04558..af28283385 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.21.1 (Apple Git-122.3)

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

#104 lore raw

PATCH v2 39/58 net/bnxt: refactor TRUFLOW processing

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

1. The flow database opcode is updated to split the alloc push resource item so it can be controlled using the control table.

2. The class and action match signatures are populated with pattern ids that are matched against template pattern id to reject any unsupported class and action combinations.

3. The flow DB opcode should be no op when accessing the global registry identifiers.

4. The resource function for branch is changed to control so that it is extended to perform flow database operations and not just branch operations.

5. The conditional goto processing now supports negative numbers to support looping of the mapper tables to support flow ranges and also enable conditional fail goto to support failure path mapper tables.

6. The field mapper opcode is updated to add all ones to fields that support exact match.

7. Added key info and identifier list to whitney action templates The whitney plus templates are updated to use the mapper infrastructure changes.

8. The partition interface table configuration of the default egress rule for the representor interface needs to use the reserved parif interface that is specific to each platform. The pipeline for the representor interface is broken since incorrect parif configuration cause the miss path packets to be dropped.

9. In the mapper table processing, if a failure condition is hit due to invalid memory type then use the conditional goto failure configuration instead of jumping to next table. This causes ipv6 exact match entry to be skipped. This patch fixes that issue.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |    32 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       |     3 +
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |    53 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |   101 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |     7 +
 drivers/net/bnxt/tf_ulp/ulp_matcher.c         |     2 +
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c |   644 +-
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 80798 +++++++++++++++-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  4140 +-
 .../net/bnxt/tf_ulp/ulp_template_db_field.h   |   558 +-
 .../tf_ulp/ulp_template_db_stingray_act.c     |    16 +-
 .../tf_ulp/ulp_template_db_stingray_class.c   |   154 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |   512 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h |     4 +
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c |  4470 +-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 13072 ++-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |     7 +-
 17 files changed, 98370 insertions(+), 6203 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +17 -15
index 2c1a2a7be3..ec272c3a8f 100644
@@ -79,21 +79,23 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 			    struct ulp_rte_parser_params *params,
 			    enum bnxt_ulp_fdb_type flow_type)
 {
-	mapper_cparms->flow_type	= flow_type;
-	mapper_cparms->app_priority	= params->priority;
-	mapper_cparms->dir_attr		= params->dir_attr;
-	mapper_cparms->class_tid	= params->class_id;
-	mapper_cparms->act_tid		= params->act_tmpl;
-	mapper_cparms->func_id		= params->func_id;
-	mapper_cparms->hdr_bitmap	= &params->hdr_bitmap;
-	mapper_cparms->hdr_field	= params->hdr_field;
-	mapper_cparms->comp_fld		= params->comp_fld;
-	mapper_cparms->act		= &params->act_bitmap;
-	mapper_cparms->act_prop		= &params->act_prop;
-	mapper_cparms->flow_id		= params->fid;
-	mapper_cparms->parent_flow	= params->parent_flow;
-	mapper_cparms->parent_fid	= params->parent_fid;
-	mapper_cparms->fld_bitmap	= &params->fld_bitmap;
+	mapper_cparms->flow_type = flow_type;
+	mapper_cparms->app_priority = params->priority;
+	mapper_cparms->dir_attr = params->dir_attr;
+	mapper_cparms->class_tid = params->class_id;
+	mapper_cparms->act_tid = params->act_tmpl;
+	mapper_cparms->func_id = params->func_id;
+	mapper_cparms->hdr_bitmap = &params->hdr_bitmap;
+	mapper_cparms->hdr_field = params->hdr_field;
+	mapper_cparms->comp_fld = params->comp_fld;
+	mapper_cparms->act = &params->act_bitmap;
+	mapper_cparms->act_prop = &params->act_prop;
+	mapper_cparms->flow_id = params->fid;
+	mapper_cparms->parent_flow = params->parent_flow;
+	mapper_cparms->parent_fid = params->parent_fid;
+	mapper_cparms->fld_bitmap = &params->fld_bitmap;
+	mapper_cparms->flow_pattern_id = params->flow_pattern_id;
+	mapper_cparms->act_pattern_id = params->act_pattern_id;
 
 	/* update the signature fields into the computed field list */
 	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_HDR_SIG_ID,
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +3 -0
index f3b8d81766..75640ce092 100644
@@ -360,6 +360,9 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
 		goto err1;
 	}
 
+	BNXT_TF_DBG(DEBUG, "Creating default flow with template id: %u\n",
+		    ulp_class_tid);
+
 	/* Protect flow creation */
 	if (bnxt_ulp_cntxt_acquire_fdb_lock(ulp_ctx)) {
 		BNXT_TF_DBG(ERR, "Flow db lock acquire failed\n");
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +19 -34

160 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.c +77 -24

203 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +7 -0
index b7399b8949..8f0b894d39 100644
@@ -58,6 +58,8 @@ struct bnxt_ulp_mapper_parms {
 	uint8_t					tun_idx;
 	uint32_t				app_priority;
 	uint64_t				shared_hndl;
+	uint32_t				flow_pattern_id;
+	uint32_t				act_pattern_id;
 };
 
 struct bnxt_ulp_mapper_create_parms {
@@ -80,6 +82,11 @@ struct bnxt_ulp_mapper_create_parms {
 	/* if set then create a parent flow */
 	uint32_t			parent_flow;
 	uint8_t				tun_idx;
+
+	/* support pattern based rejection */
+	uint32_t			flow_pattern_id;
+	uint32_t			act_pattern_id;
+
 };
 
 /* Function to initialize any dynamic mapper data. */
drivers/net/bnxt/tf_ulp/ulp_matcher.c +2 -0
index 275214d489..46ac57ac00 100644
@@ -79,6 +79,7 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
 	*class_id = class_match->class_tid;
 	params->hdr_sig_id = class_match->hdr_sig_id;
 	params->flow_sig_id = class_match->flow_sig_id;
+	params->flow_pattern_id = class_match->flow_pattern_id;
 	return BNXT_TF_RC_SUCCESS;
 
 error:
@@ -115,6 +116,7 @@ ulp_matcher_action_match(struct ulp_rte_parser_params *params,
 		goto error;
 	}
 	*act_id = act_match->act_tid;
+	params->act_pattern_id = act_match->act_pattern_id;
 	BNXT_TF_DBG(DEBUG, "Found matching action template %u\n", *act_id);
 	return BNXT_TF_RC_SUCCESS;
 
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +601 -43

792 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +79773 -1025

1,765 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +3992 -148

4,140 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_field.h +453 -105

558 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_act.c +8 -8
index c1b3c7bcd2..d29b7a200f 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c +77 -77

154 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +408 -104

512 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h +4 -0
index befde44a1b..cccdcf5b72 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +4118 -352

4,470 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +8805 -4267

13,072 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +6 -1
index af28283385..20a988a03a 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.21.1 (Apple Git-122.3)

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

#105 lore raw

PATCH v2 40/58 net/bnxt: add partial header field processing

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

For support for wild card TCAM, some of the header fields have to be partially written, hence this new opcode is added.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 64 +++++++++++++------
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    | 13 ++--
 2 files changed, 51 insertions(+), 26 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +44 -20
index c231f765e6..df8041e897 100644
@@ -927,7 +927,7 @@ ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 	uint32_t val_size = 0, field_size = 0;
 	uint64_t hdr_bit, act_bit, regval;
 	uint16_t write_idx = blob->write_idx;
-	uint16_t idx, size_idx, bitlen;
+	uint16_t idx, size_idx, bitlen, offset;
 	uint8_t	*val = NULL;
 	uint8_t tmpval[16];
 	uint8_t bit;
@@ -1340,6 +1340,46 @@ ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 		break;
 	case BNXT_ULP_FIELD_SRC_REJECT:
 		return -EINVAL;
+	case BNXT_ULP_FIELD_SRC_SUB_HF:
+		if (!ulp_operand_read(fld_src_oper,
+				      (uint8_t *)&idx, sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
+			return -EINVAL;
+		}
+		idx = tfp_be_to_cpu_16(idx);
+		/* get the index from the global field list */
+		if (ulp_mapper_glb_field_tbl_get(parms, idx, &bit)) {
+			BNXT_TF_DBG(ERR, "invalid ulp_glb_field_tbl idx %d\n",
+				    idx);
+			return -EINVAL;
+		}
+
+		/* get the offset next */
+		if (!ulp_operand_read(&fld_src_oper[sizeof(uint16_t)],
+				      (uint8_t *)&offset, sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
+			return -EINVAL;
+		}
+		offset = tfp_be_to_cpu_16(offset);
+		if ((offset + bitlen) >
+		    ULP_BYTE_2_BITS(parms->hdr_field[bit].size) ||
+		    ULP_BITS_IS_BYTE_NOT_ALIGNED(offset)) {
+			BNXT_TF_DBG(ERR, "Hdr field[%s] oob\n", name);
+			return -EINVAL;
+		}
+		offset = ULP_BITS_2_BYTE_NR(offset);
+
+		/* write the value into blob */
+		if (is_key)
+			val = &parms->hdr_field[bit].spec[offset];
+		else
+			val = &parms->hdr_field[bit].mask[offset];
+
+		if (!ulp_blob_push(blob, val, bitlen)) {
+			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
+			return -EINVAL;
+		}
+		break;
 	default:
 		BNXT_TF_DBG(ERR, "%s invalid field opcode 0x%x at %d\n",
 			    name, fld_src, write_idx);
@@ -1630,25 +1670,9 @@ ulp_mapper_tcam_tbl_entry_write(struct bnxt_ulp_mapper_parms *parms,
 	return rc;
 }
 
-#define BNXT_ULP_WC_TCAM_SLICE_SIZE 80
 /* internal function to post process the key/mask blobs for wildcard tcam tbl */
-static void ulp_mapper_wc_tcam_tbl_post_process(struct ulp_blob *blob,
-						uint32_t len)
+static void ulp_mapper_wc_tcam_tbl_post_process(struct ulp_blob *blob)
 {
-	uint8_t mode[2] = {0x0, 0x0};
-	uint32_t mode_len = len / BNXT_ULP_WC_TCAM_SLICE_SIZE;
-	uint32_t size, idx;
-
-	/* Add the mode bits to the key and mask*/
-	if (mode_len == 2)
-		mode[1] = 2;
-	else if (mode_len > 2)
-		mode[1] = 3;
-
-	size = BNXT_ULP_WC_TCAM_SLICE_SIZE + ULP_BYTE_2_BITS(sizeof(mode));
-	for (idx = 0; idx < mode_len; idx++)
-		ulp_blob_insert(blob, (size * idx), mode,
-				ULP_BYTE_2_BITS(sizeof(mode)));
 	ulp_blob_perform_64B_word_swap(blob);
 	ulp_blob_perform_64B_byte_swap(blob);
 }
@@ -1736,8 +1760,8 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 
 	/* For wild card tcam perform the post process to swap the blob */
 	if (tbl->resource_type == TF_TCAM_TBL_TYPE_WC_TCAM) {
-		ulp_mapper_wc_tcam_tbl_post_process(&key, tbl->key_bit_size);
-		ulp_mapper_wc_tcam_tbl_post_process(&mask, tbl->key_bit_size);
+		ulp_mapper_wc_tcam_tbl_post_process(&key);
+		ulp_mapper_wc_tcam_tbl_post_process(&mask);
 	}
 
 	if (tbl->tbl_opcode == BNXT_ULP_TCAM_TBL_OPC_ALLOC_WR_REGFILE) {
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +7 -6
index 4a1faacfbe..d42933df66 100644
@@ -278,12 +278,13 @@ enum bnxt_ulp_field_src {
 	BNXT_ULP_FIELD_SRC_ACT_PROP_SZ = 6,
 	BNXT_ULP_FIELD_SRC_GLB_RF = 7,
 	BNXT_ULP_FIELD_SRC_HF = 8,
-	BNXT_ULP_FIELD_SRC_HDR_BIT = 9,
-	BNXT_ULP_FIELD_SRC_ACT_BIT = 10,
-	BNXT_ULP_FIELD_SRC_FIELD_BIT = 11,
-	BNXT_ULP_FIELD_SRC_SKIP = 12,
-	BNXT_ULP_FIELD_SRC_REJECT = 13,
-	BNXT_ULP_FIELD_SRC_LAST = 14
+	BNXT_ULP_FIELD_SRC_SUB_HF = 9,
+	BNXT_ULP_FIELD_SRC_HDR_BIT = 10,
+	BNXT_ULP_FIELD_SRC_ACT_BIT = 11,
+	BNXT_ULP_FIELD_SRC_FIELD_BIT = 12,
+	BNXT_ULP_FIELD_SRC_SKIP = 13,
+	BNXT_ULP_FIELD_SRC_REJECT = 14,
+	BNXT_ULP_FIELD_SRC_LAST = 15
 };
 
 enum bnxt_ulp_generic_tbl_opc {
Signature · 1 line
2.21.1 (Apple Git-122.3)
#106 lore raw

PATCH v2 41/58 net/bnxt: add support for wild card pattern match

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

The computational field is enabled for wild card pattern support. The template checks the computational field to add a flow as wild card entry or exact match entry.

---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c       | 4 ++--
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +2 -2
index 37dedbe243..3c45acd18f 100644
@@ -50,8 +50,8 @@ ulp_rte_parser_field_bitmap_update(struct ulp_rte_parser_params *params,
 		ULP_INDEX_BITMAP_SET(params->fld_bitmap.bits, idx);
 		/* Not exact match */
 		if (!ulp_bitmap_is_ones(field->mask, field->size))
-			ULP_BITMAP_SET(params->fld_bitmap.bits,
-				       BNXT_ULP_MATCH_TYPE_BITMASK_WM);
+			ULP_COMP_FLD_IDX_WR(params,
+					    BNXT_ULP_CF_IDX_WC_MATCH, 1);
 	} else {
 		ULP_INDEX_BITMAP_RESET(params->fld_bitmap.bits, idx);
 	}
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +2 -1
index d42933df66..5e839107a8 100644
@@ -180,7 +180,8 @@ enum bnxt_ulp_cf_idx {
 	BNXT_ULP_CF_IDX_FID = 49,
 	BNXT_ULP_CF_IDX_HDR_SIG_ID = 50,
 	BNXT_ULP_CF_IDX_FLOW_SIG_ID = 51,
-	BNXT_ULP_CF_IDX_LAST = 52
+	BNXT_ULP_CF_IDX_WC_MATCH = 52,
+	BNXT_ULP_CF_IDX_LAST = 53
 };
 
 enum bnxt_ulp_cond_list_opc {
Signature · 1 line
2.21.1 (Apple Git-122.3)
#107 lore raw

PATCH v2 42/58 net/bnxt: add support for GRE flows

In reply to Ajit Khaparde

From: Venkat Duvvuru <[email protected]>

This patch does the following to support GRE flows:
1. RTE_FLOW_ITEM_TYPE_ANY & RTE_FLOW_ITEM_TYPE_GRE processing
2. Calculate the absolute function ID from the logical VF ID passed as part of RTE_FLOW_ACTION_TYPE_VF action.
3. Move bnxt_get_bp API to bnxt_ethdev.c

---
 drivers/net/bnxt/bnxt.h                       |  1 +
 drivers/net/bnxt/bnxt_ethdev.c                | 26 +++++++
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 75 ++++++++++++++++++-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |  9 +++
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |  2 +
 5 files changed, 110 insertions(+), 3 deletions(-)
drivers/net/bnxt/bnxt.h +1 -0
index 532755467f..4286c99079 100644
@@ -1027,6 +1027,7 @@ bnxt_ulp_create_vfr_default_rules(struct rte_eth_dev *vfr_ethdev);
 int32_t
 bnxt_ulp_delete_vfr_default_rules(struct bnxt_representor *vfr);
 uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
+struct bnxt *bnxt_get_bp(uint16_t port);
 uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif,
 		       enum bnxt_ulp_intf_type type);
 uint16_t bnxt_get_fw_func_id(uint16_t port, enum bnxt_ulp_intf_type type);
drivers/net/bnxt/bnxt_ethdev.c +26 -0
index b77f12bbb4..eff4798167 100644
@@ -4866,6 +4866,32 @@ static void bnxt_config_vf_req_fwd(struct bnxt *bp)
 	BNXT_HWRM_CMD_TO_FORWARD(HWRM_OEM_CMD);
 }
 
+struct bnxt *
+bnxt_get_bp(uint16_t port)
+{
+	struct bnxt *bp;
+	struct rte_eth_dev *dev;
+
+	if (!rte_eth_dev_is_valid_port(port)) {
+		PMD_DRV_LOG(ERR, "Invalid port %d\n", port);
+		return NULL;
+	}
+
+	dev = &rte_eth_devices[port];
+	if (!is_bnxt_supported(dev)) {
+		PMD_DRV_LOG(ERR, "Device %d not supported\n", port);
+		return NULL;
+	}
+
+	bp = (struct bnxt *)dev->data->dev_private;
+	if (!BNXT_TRUFLOW_EN(bp)) {
+		PMD_DRV_LOG(ERR, "TRUFLOW not enabled\n");
+		return NULL;
+	}
+
+	return bp;
+}
+
 uint16_t
 bnxt_get_svif(uint16_t port_id, bool func_svif,
 	      enum bnxt_ulp_intf_type type)
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +72 -3

110 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +9 -0
index 27a5131bb3..d78a333f3b 100644
@@ -126,6 +126,15 @@ int32_t
 ulp_rte_vxlan_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,
+			struct ulp_rte_parser_params *params);
+
+int32_t
+ulp_rte_item_any_handler(const struct rte_flow_item *item __rte_unused,
+			 struct ulp_rte_parser_params *params __rte_unused);
+
 /* 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_struct.h +2 -0
index 20a988a03a..0a5bb1762c 100644
@@ -27,6 +27,7 @@
 #define BNXT_ULP_PROTO_HDR_UDP_NUM	4
 #define BNXT_ULP_PROTO_HDR_TCP_NUM	9
 #define BNXT_ULP_PROTO_HDR_VXLAN_NUM	4
+#define BNXT_ULP_PROTO_HDR_GRE_NUM	6
 #define BNXT_ULP_PROTO_HDR_MAX		128
 #define BNXT_ULP_PROTO_HDR_FIELD_SVIF_IDX	1
 
@@ -76,6 +77,7 @@ struct ulp_rte_parser_params {
 	uint32_t			parent_flow;
 	uint32_t			parent_fid;
 	uint16_t			func_id;
+	uint16_t			port_id;
 	uint32_t			class_id;
 	uint32_t			act_tmpl;
 	struct bnxt_ulp_context		*ulp_ctx;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#108 lore raw

PATCH v2 43/58 net/bnxt: enable extended exact match support

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

The templates are updated to enable the extended exact match table support. As part of this change, the action record size of the action has to be calculated dynamically so it can be included in the match table.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  12 +
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c |  87 +-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  15 +-
 .../net/bnxt/tf_ulp/ulp_template_db_field.h   |   2 +
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c | 712 ++++++-------
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c | 141 ++-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 936 +++++++++++++-----
 7 files changed, 1283 insertions(+), 622 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +12 -0
index df8041e897..3d7bf2f264 100644
@@ -2042,6 +2042,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	bool alloc = false;
 	bool write = false;
 	bool search = false;
+	uint64_t act_rec_size;
 
 	/* use the max size if encap is enabled */
 	if (tbl->encap_num_fields)
@@ -2286,6 +2287,17 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 				    sparms.idx, rc);
 			goto error;
 		}
+
+		/* Calculate action record size */
+		if (tbl->resource_type == TF_TBL_TYPE_EXT) {
+			act_rec_size = (ULP_BITS_2_BYTE_NR(tmplen) + 15) / 16;
+			act_rec_size--;
+			if (ulp_regfile_write(parms->regfile,
+					      BNXT_ULP_RF_IDX_ACTION_REC_SIZE,
+					      tfp_cpu_to_be_64(act_rec_size)))
+				BNXT_TF_DBG(ERR,
+					    "Failed write the act rec size\n");
+		}
 	}
 
 	/* Link the resource to the flow in the flow db */
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +86 -1

603 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +9 -6
index 5e839107a8..6c4950d649 100644
@@ -3,12 +3,12 @@
  * All rights reserved.
  */
 
-/* date: Thu Dec 17 19:43:07 2020 */
+/* date: Tue Jan 26 15:51:49 2021 */
 
 #ifndef ULP_TEMPLATE_DB_H_
 #define ULP_TEMPLATE_DB_H_
 
-#define BNXT_ULP_REGFILE_MAX_SZ 32
+#define BNXT_ULP_REGFILE_MAX_SZ 34
 #define BNXT_ULP_MAX_NUM_DEVICES 4
 #define BNXT_ULP_LOG2_MAX_NUM_DEV 2
 #define BNXT_ULP_GEN_TBL_MAX_SZ 6
@@ -30,13 +30,13 @@
 #define BNXT_ULP_GLB_TEMPLATE_TBL_MAX_SZ 1
 #define BNXT_ULP_GLB_FIELD_TBL_SHIFT 7
 #define BNXT_ULP_HDR_SIG_ID_SHIFT 4
-#define BNXT_ULP_GLB_FIELD_TBL_SIZE 5593
+#define BNXT_ULP_GLB_FIELD_TBL_SIZE 5595
 #define ULP_WH_PLUS_CLASS_TMPL_LIST_SIZE 8
 #define ULP_WH_PLUS_CLASS_TBL_LIST_SIZE 63
-#define ULP_WH_PLUS_CLASS_KEY_INFO_LIST_SIZE 412
+#define ULP_WH_PLUS_CLASS_KEY_INFO_LIST_SIZE 410
 #define ULP_WH_PLUS_CLASS_IDENT_LIST_SIZE 17
 #define ULP_WH_PLUS_CLASS_RESULT_FIELD_LIST_SIZE 503
-#define ULP_WH_PLUS_CLASS_COND_LIST_SIZE 16
+#define ULP_WH_PLUS_CLASS_COND_LIST_SIZE 18
 #define ULP_STINGRAY_CLASS_TMPL_LIST_SIZE 7
 #define ULP_STINGRAY_CLASS_TBL_LIST_SIZE 38
 #define ULP_STINGRAY_CLASS_KEY_INFO_LIST_SIZE 192
@@ -392,7 +392,9 @@ enum bnxt_ulp_rf_idx {
 	BNXT_ULP_RF_IDX_HDR_SIG_ID = 29,
 	BNXT_ULP_RF_IDX_FLOW_SIG_ID = 30,
 	BNXT_ULP_RF_IDX_RID = 31,
-	BNXT_ULP_RF_IDX_LAST = 32
+	BNXT_ULP_RF_IDX_WC_KEY_ID_0 = 32,
+	BNXT_ULP_RF_IDX_EM_KEY_ID_0 = 33,
+	BNXT_ULP_RF_IDX_LAST = 34
 };
 
 enum bnxt_ulp_tcam_tbl_opc {
@@ -4941,4 +4943,5 @@ enum bnxt_ulp_df_tpl {
 	BNXT_ULP_DF_TPL_VF_TO_VFREP = 6,
 	BNXT_ULP_DF_TPL_LOOPBACK_ACTION_REC = 7
 };
+
 #endif
drivers/net/bnxt/tf_ulp/ulp_template_db_field.h +2 -0
index a6a4b472f4..0823a1300c 100644
@@ -17,6 +17,8 @@ enum bnxt_ulp_glb_hf {
 	BNXT_ULP_GLB_HF_ID_I_ETH_SMAC,
 	BNXT_ULP_GLB_HF_ID_O_ETH_TYPE,
 	BNXT_ULP_GLB_HF_ID_I_ETH_TYPE,
+	BNXT_ULP_GLB_HF_ID_T_GRE_VER,
+	BNXT_ULP_GLB_HF_ID_T_GRE_PROTO_TYPE,
 	BNXT_ULP_GLB_HF_ID_O_IPV4_VER,
 	BNXT_ULP_GLB_HF_ID_I_IPV4_VER,
 	BNXT_ULP_GLB_HF_ID_O_IPV4_TOS,
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +356 -356

832 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +138 -3

969 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +680 -256

519 lines not on this page · raw message

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#109 lore raw

PATCH v2 44/58 net/bnxt: refactor ULP mapper

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

1. The internal and external exact match table resource types is combined since the resource handle contains the encoded type whether it is internal or external exact match entry.

2. When a flow doesn't hit the offloaded rules, the default action is to send it to the kernel (L2 driver interface). In order to do that, TRUFLOW must know the kernel interface's (PF's) default vnic id. This patch fetches the PF's default vnic id from the dpdk core and stores it in port database. It also stores the mac addr for the future usage. Renamed compute field for layer 4 port enums. Added support for port database opcode that can get port details like mac address which can then be populated in the l2 context entry.

3. Both active and default bit set need to considered to check if a specific flow type is enabled or not.

4. ulp mapper fetches the dpdk port id from the compute field index BNXT_ULP_CF_IDX_DEV_PORT_ID which is used to get the interface’s mac address eventually. However, the compute field array is not populated with dpdk port id at the index BNXT_ULP_CF_IDX_DEV_PORT_ID. The problem fixed by populating the compute field array correctly.

5. Some dpdk applications may accumulate the flow counters while some may not. In cases where the application is accumulating the counters the PMD need not do the accumulation itself and viceversa to report the correct flow counters.

6. Pointer to bp is added to open session parms to support shared session.

---
 drivers/net/bnxt/bnxt.h                       |   6 +
 drivers/net/bnxt/bnxt_ethdev.c                |  86 +++++++
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |   5 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |   1 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |   2 +
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c          |  23 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |  95 +++++---
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h         |   3 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  52 +++-
 drivers/net/bnxt/tf_ulp/ulp_port_db.c         |  37 +++
 drivers/net/bnxt/tf_ulp/ulp_port_db.h         |  15 ++
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 104 +++++++-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |   8 +
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  59 +++--
 .../tf_ulp/ulp_template_db_stingray_class.c   |   4 +-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    |  48 ++--
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   1 +
 drivers/net/bnxt/tf_ulp/ulp_tun.c             | 223 +++++++++++++-----
 drivers/net/bnxt/tf_ulp/ulp_tun.h             |  42 ++--
 19 files changed, 625 insertions(+), 189 deletions(-)
drivers/net/bnxt/bnxt.h +6 -0
index 4286c99079..e8a6a50eaa 100644
@@ -711,8 +711,11 @@ struct bnxt {
 	uint32_t			flags2;
 #define BNXT_FLAGS2_PTP_TIMESYNC_ENABLED	BIT(0)
 #define BNXT_FLAGS2_PTP_ALARM_SCHEDULED		BIT(1)
+#define	BNXT_FLAGS2_ACCUM_STATS_EN		BIT(2)
 #define BNXT_P5_PTP_TIMESYNC_ENABLED(bp)	\
 	((bp)->flags2 & BNXT_FLAGS2_PTP_TIMESYNC_ENABLED)
+#define	BNXT_ACCUM_STATS_EN(bp)			\
+	((bp)->flags2 & BNXT_FLAGS2_ACCUM_STATS_EN)
 
 	uint16_t		chip_num;
 #define CHIP_NUM_58818		0xd818
@@ -1026,7 +1029,10 @@ int32_t
 bnxt_ulp_create_vfr_default_rules(struct rte_eth_dev *vfr_ethdev);
 int32_t
 bnxt_ulp_delete_vfr_default_rules(struct bnxt_representor *vfr);
+void bnxt_get_iface_mac(uint16_t port, enum bnxt_ulp_intf_type type,
+			uint8_t *mac, uint8_t *parent_mac);
 uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
+uint16_t bnxt_get_parent_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
 struct bnxt *bnxt_get_bp(uint16_t port);
 uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif,
 		       enum bnxt_ulp_intf_type type);
drivers/net/bnxt/bnxt_ethdev.c +86 -0

122 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/bnxt_ulp.c +5 -0
index 0975a4689f..f28c7a5a38 100644
@@ -287,6 +287,7 @@ ulp_ctx_session_open(struct bnxt *bp,
 		return rc;
 	}
 
+	params.bp = bp;
 	rc = tf_open_session(&bp->tfp, &params);
 	if (rc) {
 		BNXT_TF_DBG(ERR, "Failed to open TF session - %s, rc = %d\n",
@@ -1071,6 +1072,10 @@ bnxt_ulp_port_init(struct bnxt *bp)
 	}
 	/* create the default rules */
 	bnxt_ulp_create_df_rules(bp);
+
+	if (BNXT_ACCUM_STATS_EN(bp))
+		bp->ulp_ctx->cfg_data->accum_stats = true;
+
 	BNXT_TF_DBG(DEBUG, "BNXT Port:%d ULP port init\n",
 		    bp->eth_dev->data->port_id);
 	return rc;
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +1 -0
index 96aef28b92..a295d94bb4 100644
@@ -67,6 +67,7 @@ struct bnxt_ulp_data {
 #define	BNXT_ULP_TUN_ENTRY_INVALID	-1
 #define	BNXT_ULP_MAX_TUN_CACHE_ENTRIES	16
 	struct bnxt_tun_cache_entry	tun_tbl[BNXT_ULP_MAX_TUN_CACHE_ENTRIES];
+	bool				accum_stats;
 };
 
 struct bnxt_ulp_context {
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +2 -0
index ec272c3a8f..b8af54ef6a 100644
@@ -143,6 +143,8 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev,
 	/* copy the device port id and direction for further processing */
 	ULP_COMP_FLD_IDX_WR(&params, BNXT_ULP_CF_IDX_INCOMING_IF,
 			    dev->data->port_id);
+	ULP_COMP_FLD_IDX_WR(&params, BNXT_ULP_CF_IDX_DEV_PORT_ID,
+			    dev->data->port_id);
 	ULP_COMP_FLD_IDX_WR(&params, BNXT_ULP_CF_IDX_SVIF_FLAG,
 			    BNXT_ULP_INVALID_SVIF_VAL);
 
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +16 -7
index de21fc0e20..65029139e6 100644
@@ -317,8 +317,18 @@ static int ulp_get_single_flow_stat(struct bnxt_ulp_context *ctxt,
 	/* TBD - Get PKT/BYTE COUNT SHIFT/MASK from Template */
 	sw_cntr_indx = hw_cntr_id - fc_info->shadow_hw_tbl[dir].start_idx;
 	sw_acc_tbl_entry = &fc_info->sw_acc_tbl[dir][sw_cntr_indx];
-	sw_acc_tbl_entry->pkt_count = FLOW_CNTR_PKTS(stats, dparms);
-	sw_acc_tbl_entry->byte_count = FLOW_CNTR_BYTES(stats, dparms);
+	/* Some dpdk applications may accumulate the flow counters while some
+	 * may not. In cases where the application is accumulating the counters
+	 * the PMD need not do the accumulation itself and viceversa to report
+	 * the correct flow counters.
+	 */
+	if (ctxt->cfg_data->accum_stats) {
+		sw_acc_tbl_entry->pkt_count += FLOW_CNTR_PKTS(stats, dparms);
+		sw_acc_tbl_entry->byte_count += FLOW_CNTR_BYTES(stats, dparms);
+	} else {
+		sw_acc_tbl_entry->pkt_count = FLOW_CNTR_PKTS(stats, dparms);
+		sw_acc_tbl_entry->byte_count = FLOW_CNTR_BYTES(stats, dparms);
+	}
 
 	/* Update the parent counters if it is child flow */
 	if (sw_acc_tbl_entry->parent_flow_id) {
@@ -628,11 +638,10 @@ int ulp_fc_mgr_query_count_get(struct bnxt_ulp_context *ctxt,
 		pthread_mutex_unlock(&ulp_fc_info->fc_lock);
 	} else if (params.resource_sub_type ==
 			BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT_ACC) {
-		/* Get the stats from the parent child table */
-		ulp_flow_db_parent_flow_count_get(ctxt,
-						  flow_id,
-						  &count->hits,
-						  &count->bytes);
+		/* Get stats from the parent child table */
+		ulp_flow_db_parent_flow_count_get(ctxt, flow_id,
+						  &count->hits, &count->bytes,
+						  count->reset);
 		count->hits_set = 1;
 		count->bytes_set = 1;
 	} else {
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +59 -36

242 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_flow_db.h +2 -1
index 14369271ff..62c914833b 100644
@@ -390,7 +390,8 @@ int32_t
 ulp_flow_db_parent_flow_count_get(struct bnxt_ulp_context *ulp_ctxt,
 				  uint32_t parent_fid,
 				  uint64_t *packet_count,
-				  uint64_t *byte_count);
+				  uint64_t *byte_count,
+				  uint8_t count_reset);
 
 /*
  * reset the parent accumulation counters
drivers/net/bnxt/tf_ulp/ulp_mapper.c +43 -9

100 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_port_db.c +37 -0
index cc66c78312..ee749933bd 100644
@@ -182,6 +182,13 @@ int32_t	ulp_port_db_dev_port_intf_update(struct bnxt_ulp_context *ulp_ctxt,
 		func->ifindex = ifindex;
 	}
 
+	/* When there is no match, the default action is to send the packet to
+	 * the kernel. And to send it to the kernel, we need the PF's vnic id.
+	 */
+	func->func_parent_vnic = bnxt_get_parent_vnic_id(port_id, intf->type);
+	bnxt_get_iface_mac(port_id, intf->type, func->func_mac,
+			   func->func_parent_mac);
+
 	port_data = &port_db->phy_port_list[func->phy_port_id];
 	if (!port_data->port_valid) {
 		port_data->port_svif =
@@ -579,3 +586,33 @@ ulp_port_db_port_func_id_get(struct bnxt_ulp_context *ulp_ctxt,
 	}
 	return 0;
 }
+
+/*
+ * Api to get the parent mac address for a given port id.
+ *
+ * ulp_ctxt [in] Ptr to ulp context
+ * port_id [in].device port id
+ * mac_addr [out] mac address
+ *
+ * Returns 0 on success or negative number on failure.
+ */
+int32_t
+ulp_port_db_parent_mac_addr_get(struct bnxt_ulp_context *ulp_ctxt,
+				uint32_t port_id, uint8_t **mac_addr)
+{
+	struct bnxt_ulp_port_db *port_db;
+	uint16_t func_id;
+
+	port_db = bnxt_ulp_cntxt_ptr2_port_db_get(ulp_ctxt);
+	if (ulp_port_db_port_func_id_get(ulp_ctxt, port_id, &func_id)) {
+		BNXT_TF_DBG(ERR, "Invalid port_id %x\n", port_id);
+		return -EINVAL;
+	}
+
+	if (!port_db->ulp_func_id_tbl[func_id].func_valid) {
+		BNXT_TF_DBG(ERR, "Invalid func_id %x\n", func_id);
+		return -ENOENT;
+	}
+	*mac_addr = port_db->ulp_func_id_tbl[func_id].func_parent_mac;
+	return 0;
+}
drivers/net/bnxt/tf_ulp/ulp_port_db.h +15 -0
index ae2b71df25..9d0e613fc8 100644
@@ -46,6 +46,9 @@ struct ulp_func_if_info {
 	uint16_t		func_spif;
 	uint16_t		func_parif;
 	uint16_t		func_vnic;
+	uint8_t			func_mac[RTE_ETHER_ADDR_LEN];
+	uint16_t		func_parent_vnic;
+	uint8_t			func_parent_mac[RTE_ETHER_ADDR_LEN];
 	uint16_t		phy_port_id;
 	uint16_t		ifindex;
 };
@@ -272,4 +275,16 @@ int32_t
 ulp_port_db_port_func_id_get(struct bnxt_ulp_context *ulp_ctxt,
 			     uint16_t port_id, uint16_t *func_id);
 
+/*
+ * Api to get the parent mac address for a given port id.
+ *
+ * ulp_ctxt [in] Ptr to ulp context
+ * port_id [in].device port id
+ * mac_addr [out] mac address
+ *
+ * Returns 0 on success or negative number on failure.
+ */
+int32_t
+ulp_port_db_parent_mac_addr_get(struct bnxt_ulp_context *ulp_ctxt,
+				uint32_t port_id, uint8_t **mac_addr);
 #endif /* _ULP_PORT_DB_H_ */
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +91 -13

184 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +8 -0
index d78a333f3b..24e9ae985c 100644
@@ -245,4 +245,12 @@ int32_t
 ulp_rte_jump_act_handler(const struct rte_flow_action *action_item,
 			 struct ulp_rte_parser_params *params);
 
+int32_t
+ulp_rte_sample_act_handler(const struct rte_flow_action *action_item,
+			   struct ulp_rte_parser_params *params);
+
+int32_t
+ulp_rte_shared_act_handler(const struct rte_flow_action *action_item,
+			   struct ulp_rte_parser_params *params);
+
 #endif /* _ULP_RTE_PARSER_H_ */
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +41 -18

89 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c +2 -2
index df09de929e..320a89a5d9 100644
@@ -205,7 +205,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_class_tbl_list[] = {
 	.encap_num_fields = 0
 	},
 	{ /* class_tid: 1, stingray, table: em.int_0 */
-	.resource_func = BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE,
+	.resource_func = BNXT_ULP_RESOURCE_FUNC_EM_TABLE,
 	.resource_type = TF_MEM_INTERNAL,
 	.direction = TF_DIR_RX,
 	.mem_type_opcode = BNXT_ULP_MEM_TYPE_OPC_EXECUTE_IF_INT,
@@ -228,7 +228,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_stingray_class_tbl_list[] = {
 	.encap_num_fields = 0
 	},
 	{ /* class_tid: 1, stingray, table: eem.ext_0 */
-	.resource_func = BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE,
+	.resource_func = BNXT_ULP_RESOURCE_FUNC_EM_TABLE,
 	.resource_type = TF_MEM_EXTERNAL,
 	.direction = TF_DIR_RX,
 	.mem_type_opcode = BNXT_ULP_MEM_TYPE_OPC_EXECUTE_IF_EXT,
drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +24 -24

144 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +1 -0
index 0a5bb1762c..e3e9a4ef1c 100644
@@ -63,6 +63,7 @@ struct ulp_rte_act_prop {
 
 /* Structure to be used for passing all the parser functions */
 struct ulp_rte_parser_params {
+	STAILQ_ENTRY(ulp_rte_parser_params)  next;
 	struct ulp_rte_hdr_bitmap	hdr_bitmap;
 	struct ulp_rte_hdr_bitmap	hdr_fp_bit;
 	struct ulp_rte_field_bitmap	fld_bitmap;
drivers/net/bnxt/tf_ulp/ulp_tun.c +162 -61

312 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_tun.h +24 -18

93 lines not on this page · raw message

Signature · 1 line
2.21.1 (Apple Git-122.3)
#110 lore raw

PATCH v2 45/58 net/bnxt: add support for generic hash table

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Added support for generic table to enable search of keys that are larger than 16 bits using hash table.

---
 drivers/net/bnxt/tf_ulp/meson.build           |     1 +
 drivers/net/bnxt/tf_ulp/ulp_gen_hash.c        |   369 +
 drivers/net/bnxt/tf_ulp/ulp_gen_hash.h        |   166 +
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c         |   130 +-
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h         |    30 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |    90 +-
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 17724 +++++++++-------
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   159 +-
 .../tf_ulp/ulp_template_db_stingray_class.c   |     6 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |    54 +-
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c |     2 +
 .../tf_ulp/ulp_template_db_wh_plus_class.c    |   882 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |     5 +
 drivers/net/bnxt/tf_ulp/ulp_utils.c           |     8 +
 drivers/net/bnxt/tf_ulp/ulp_utils.h           |     3 +
 15 files changed, 11669 insertions(+), 7960 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_gen_hash.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_gen_hash.h
drivers/net/bnxt/tf_ulp/meson.build +1 -0
index 701a510f27..c7ec5a3161 100644
@@ -23,6 +23,7 @@ sources += files(
         'ulp_fc_mgr.c',
         'ulp_tun.c',
         'ulp_gen_tbl.c',
+	'ulp_gen_hash.c',
 	'ulp_rte_handler_tbl.c',
         'ulp_template_db_wh_plus_act.c',
         'ulp_template_db_wh_plus_class.c',
drivers/net/bnxt/tf_ulp/ulp_gen_hash.c new file +369 -0

369 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_gen_hash.h new file +166 -0

166 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c +111 -19

201 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h +23 -7
index 6236dc3ca2..7f4a877e9a 100644
@@ -6,6 +6,8 @@
 #ifndef _ULP_GEN_TBL_H_
 #define _ULP_GEN_TBL_H_
 
+#include "ulp_gen_hash.h"
+
 /* Macros for reference count manipulation */
 #define ULP_GEN_TBL_REF_CNT_INC(entry) {*(entry)->ref_count += 1; }
 #define ULP_GEN_TBL_REF_CNT_DEC(entry) {*(entry)->ref_count -= 1; }
@@ -16,9 +18,9 @@
 
 /* Structure to pass the generic table values across APIs */
 struct ulp_mapper_gen_tbl_entry {
-	uint32_t		*ref_count;
-	uint32_t		byte_data_size;
-	uint8_t			*byte_data;
+	uint32_t			*ref_count;
+	uint32_t			byte_data_size;
+	uint8_t				*byte_data;
 	enum bnxt_ulp_byte_order	byte_order;
 };
 
@@ -39,9 +41,11 @@ struct ulp_mapper_gen_tbl_cont {
 
 /* Structure to store the generic tbl container */
 struct ulp_mapper_gen_tbl_list {
+	const char			*gen_tbl_name;
 	struct ulp_mapper_gen_tbl_cont	container;
 	uint32_t			mem_data_size;
 	uint8_t				*mem_data;
+	struct ulp_gen_hash_tbl		*hash_tbl;
 };
 
 /* Forward declaration */
@@ -73,16 +77,14 @@ ulp_mapper_generic_tbl_list_deinit(struct bnxt_ulp_mapper_data *mapper_data);
 /*
  * Get the generic table list entry
  *
- * ulp_ctxt [in] - Ptr to ulp_context
- * tbl_idx [in] -  Table index to the generic table list
+ * tbl_list [in] - Ptr to generic table
  * key [in] - Key index to the table
  * entry [out] - output will include the entry if found
  *
  * returns 0 on success.
  */
 int32_t
-ulp_mapper_gen_tbl_entry_get(struct bnxt_ulp_context *ulp,
-			     uint32_t tbl_idx,
+ulp_mapper_gen_tbl_entry_get(struct ulp_mapper_gen_tbl_list *tbl_list,
 			     uint32_t key,
 			     struct ulp_mapper_gen_tbl_entry *entry);
 
@@ -140,4 +142,18 @@ int32_t
 ulp_mapper_gen_tbl_res_free(struct bnxt_ulp_context *ulp_ctx,
 			    struct ulp_flow_db_res_params *res);
 
+/*
+ * Write the generic table list hash entry
+ *
+ * tbl_list [in] - pointer to the generic table list
+ * hash_entry [in] -  Hash table entry
+ * gen_tbl_ent [out] - generic table entry
+ *
+ * returns 0 on success.
+ */
+int32_t
+ulp_mapper_gen_tbl_hash_entry_add(struct ulp_mapper_gen_tbl_list *tbl_list,
+				  struct ulp_gen_hash_entry_params *hash_entry,
+				  struct ulp_mapper_gen_tbl_entry *gen_tbl_ent);
+
 #endif /* _ULP_EN_TBL_H_ */
drivers/net/bnxt/tf_ulp/ulp_mapper.c +67 -23

173 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +10048 -7676

2,017 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +147 -12

159 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c +3 -3
index 320a89a5d9..c2cb452770 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +49 -5

54 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +2 -0
index c3109cd85b..d871c531c4 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +667 -215

882 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +5 -0
index e3e9a4ef1c..cd954578e7 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.c +8 -0
index 8e3a920ab4..095a66a0c7 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.h +3 -0
index 9c259a7021..bdad10db15 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.21.1 (Apple Git-122.3)

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

#111 lore raw

PATCH v2 46/58 net/bnxt: add support for Thor platform

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

1. Add templates to support Thor platform.
2. Flow counter manager is not enabled if no flow counters are configured.
3. Mark database is not enabled if mark action is not supported.
4. Removed application to port default flow.
5. Add allocate and write for the global registry file.
6. Multiple default flow templates are combined to one.
7. Remove default loopback action record, this is required in order to support multiple platforms.
8. Enable port table support in the generic table.
9. remove global template table in order to support multiple platforms.
10. Add support to get parent VNIC from port table database.
11. VF representor action mark is made optional since not all configurations need representor support.
12. Add layer 4 ports to computational fields.
13. Update templates to support the above changes.
14. Add support for wildcard.

---
 drivers/net/bnxt/meson.build                  |     2 +
 drivers/net/bnxt/tf_core/tf_core.h            |     8 -
 drivers/net/bnxt/tf_ulp/bnxt_tf_common.h      |     2 -
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |    99 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |     7 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |     4 +
 drivers/net/bnxt/tf_ulp/meson.build           |     4 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       |    65 +-
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c          |    18 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |     9 +-
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c         |    24 +-
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h         |    14 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |   408 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |     7 +
 drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c        |    10 +-
 drivers/net/bnxt/tf_ulp/ulp_port_db.c         |    86 +-
 drivers/net/bnxt/tf_ulp/ulp_port_db.h         |    29 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c |    16 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |   150 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |     5 +
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 99768 +++++++++-------
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  8939 +-
 .../net/bnxt/tf_ulp/ulp_template_db_field.h   |   575 +-
 .../tf_ulp/ulp_template_db_stingray_act.c     |   709 -
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |   752 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h |    42 +
 .../bnxt/tf_ulp/ulp_template_db_thor_act.c    |   229 +
 ...y_class.c => ulp_template_db_thor_class.c} |  5954 +-
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c |    71 +-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    |  5399 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |    12 +
 drivers/net/bnxt/tf_ulp/ulp_tun.h             |     4 -
 drivers/net/bnxt/tf_ulp/ulp_utils.c           |   187 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.h           |    64 +-
 34 files changed, 68763 insertions(+), 54909 deletions(-)
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_act.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_thor_act.c
 rename drivers/net/bnxt/tf_ulp/{ulp_template_db_stingray_class.c => ulp_template_db_thor_class.c} (55%)
drivers/net/bnxt/meson.build +2 -0
index e8a25beba0..12ecd37d54 100644
@@ -8,7 +8,9 @@ if is_windows
     subdir_done()
 endif
 
+headers = files('rte_pmd_bnxt.h')
 cflags_options = [
+        '-DRTE_LIBRTE_BNXT_TF',
         '-DSUPPORT_CFA_HW_ALL=1',
 ]
 
drivers/net/bnxt/tf_core/tf_core.h +0 -8
index 0b06bb2bb5..be5725a66a 100644
@@ -1104,10 +1104,6 @@ struct tf_alloc_tbl_scope_parms {
 	 * [in] Number of flows * 1000. If set, rx_mem_size_in_mb must equal 0.
 	 */
 	uint32_t rx_num_flows_in_k;
-	/**
-	 * [in] SR2 only receive table access interface id
-	 */
-	uint32_t rx_tbl_if_id;
 	/**
 	 * [in] All Maximum key size required.
 	 */
@@ -1126,10 +1122,6 @@ struct tf_alloc_tbl_scope_parms {
 	 * [in] Number of flows * 1000
 	 */
 	uint32_t tx_num_flows_in_k;
-	/**
-	 * [in] SR2 only receive table access interface id
-	 */
-	uint32_t tx_tbl_if_id;
 	/**
 	 * [in] Flush pending HW cached flows every 1/10th of value
 	 * set in seconds, both idle and active flows are flushed
drivers/net/bnxt/tf_ulp/bnxt_tf_common.h +0 -2
index 7b405f4dc3..f59da41e54 100644
@@ -23,12 +23,10 @@
 #define	BNXT_ULP_DFLT_RX_MAX_ACTN_ENTRY		256
 #define	BNXT_ULP_DFLT_RX_MEM			0
 #define	BNXT_ULP_RX_NUM_FLOWS			32
-#define	BNXT_ULP_RX_TBL_IF_ID			0
 #define	BNXT_ULP_DFLT_TX_MAX_KEY		512
 #define	BNXT_ULP_DFLT_TX_MAX_ACTN_ENTRY		256
 #define	BNXT_ULP_DFLT_TX_MEM			0
 #define	BNXT_ULP_TX_NUM_FLOWS			32
-#define	BNXT_ULP_TX_TBL_IF_ID			0
 
 enum bnxt_tf_rc {
 	BNXT_TF_RC_PARSE_ERR	= -2,
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +90 -9

183 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/bnxt_ulp.h +3 -4
index a295d94bb4..854eca24c3 100644
@@ -10,6 +10,7 @@
 #include <stdbool.h>
 #include <sys/queue.h>
 
+#include "rte_version.h"
 #include "rte_ethdev.h"
 
 #include "ulp_template_db_enum.h"
@@ -38,14 +39,12 @@ enum bnxt_ulp_flow_mem_type {
 };
 
 struct bnxt_ulp_df_rule_info {
-	uint32_t			port_to_app_flow_id;
-	uint32_t			app_to_port_flow_id;
+	uint32_t			def_port_flow_id;
 	uint8_t				valid;
 };
 
 struct bnxt_ulp_vfr_rule_info {
-	uint32_t			rep2vf_flow_id;
-	uint32_t			vf2rep_flow_id;
+	uint32_t			vfr_flow_id;
 	uint16_t			parent_port_id;
 	uint8_t				valid;
 };
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +4 -0
index b8af54ef6a..63fb4b5973 100644
@@ -70,8 +70,10 @@ bnxt_ulp_set_dir_attributes(struct ulp_rte_parser_params *params,
 		params->dir_attr |= BNXT_ULP_FLOW_ATTR_EGRESS;
 	if (attr->ingress)
 		params->dir_attr |= BNXT_ULP_FLOW_ATTR_INGRESS;
+#if RTE_VERSION_NUM(17, 11, 10, 16) < RTE_VERSION
 	if (attr->transfer)
 		params->dir_attr |= BNXT_ULP_FLOW_ATTR_TRANSFER;
+#endif
 }
 
 void
@@ -79,6 +81,7 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 			    struct ulp_rte_parser_params *params,
 			    enum bnxt_ulp_fdb_type flow_type)
 {
+	memset(mapper_cparms, 0, sizeof(*mapper_cparms));
 	mapper_cparms->flow_type = flow_type;
 	mapper_cparms->app_priority = params->priority;
 	mapper_cparms->dir_attr = params->dir_attr;
@@ -186,6 +189,7 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev,
 	params.fid = fid;
 	params.func_id = func_id;
 	params.priority = attr->priority;
+	params.port_id = dev->data->port_id;
 	/* Perform the rte flow post process */
 	ret = bnxt_ulp_rte_parser_post_process(&params);
 	if (ret == BNXT_TF_RC_ERROR)
drivers/net/bnxt/tf_ulp/meson.build +2 -2
index c7ec5a3161..1bb93d4938 100644
@@ -27,5 +27,5 @@ sources += files(
 	'ulp_rte_handler_tbl.c',
         'ulp_template_db_wh_plus_act.c',
         'ulp_template_db_wh_plus_class.c',
-        'ulp_template_db_stingray_act.c',
-        'ulp_template_db_stingray_class.c')
+	'ulp_template_db_thor_act.c',
+	'ulp_template_db_thor_class.c')
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +19 -46

129 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +15 -3
index 65029139e6..a25893c63c 100644
@@ -80,6 +80,12 @@ ulp_fc_mgr_init(struct bnxt_ulp_context *ctxt)
 		return -EINVAL;
 	}
 
+	if (!dparms->flow_count_db_entries) {
+		BNXT_TF_DBG(DEBUG, "flow counter support is not enabled\n");
+		bnxt_ulp_cntxt_ptr2_fc_info_set(ctxt, NULL);
+		return 0;
+	}
+
 	ulp_fc_info = rte_zmalloc("ulp_fc_info", sizeof(*ulp_fc_info), 0);
 	if (!ulp_fc_info)
 		goto error;
@@ -169,7 +175,10 @@ bool ulp_fc_mgr_thread_isstarted(struct bnxt_ulp_context *ctxt)
 
 	ulp_fc_info = bnxt_ulp_cntxt_ptr2_fc_info_get(ctxt);
 
-	return !!(ulp_fc_info->flags & ULP_FLAG_FC_THREAD);
+	if (ulp_fc_info)
+		return !!(ulp_fc_info->flags & ULP_FLAG_FC_THREAD);
+
+	return false;
 }
 
 /*
@@ -186,7 +195,7 @@ ulp_fc_mgr_thread_start(struct bnxt_ulp_context *ctxt)
 
 	ulp_fc_info = bnxt_ulp_cntxt_ptr2_fc_info_get(ctxt);
 
-	if (!(ulp_fc_info->flags & ULP_FLAG_FC_THREAD)) {
+	if (ulp_fc_info && !(ulp_fc_info->flags & ULP_FLAG_FC_THREAD)) {
 		rte_eal_alarm_set(US_PER_S * ULP_FC_TIMER,
 				  ulp_fc_mgr_alarm_cb,
 				  (void *)ctxt);
@@ -459,7 +468,10 @@ bool ulp_fc_mgr_start_idx_isset(struct bnxt_ulp_context *ctxt, enum tf_dir dir)
 
 	ulp_fc_info = bnxt_ulp_cntxt_ptr2_fc_info_get(ctxt);
 
-	return ulp_fc_info->shadow_hw_tbl[dir].start_idx_is_set;
+	if (ulp_fc_info)
+		return ulp_fc_info->shadow_hw_tbl[dir].start_idx_is_set;
+
+	return false;
 }
 
 /*
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +7 -2
index 47c8c48456..8a6a925559 100644
@@ -522,7 +522,9 @@ ulp_flow_db_init(struct bnxt_ulp_context *ulp_ctxt)
 	bnxt_ulp_cntxt_ptr2_flow_db_set(ulp_ctxt, flow_db);
 
 	/* Determine the number of flows based on EM type */
-	bnxt_ulp_cntxt_mem_type_get(ulp_ctxt, &mtype);
+	if (bnxt_ulp_cntxt_mem_type_get(ulp_ctxt, &mtype))
+		goto error_free;
+
 	if (mtype == BNXT_ULP_FLOW_MEM_TYPE_INT)
 		num_flows = dparms->int_flow_db_num_entries;
 	else
@@ -676,6 +678,7 @@ ulp_flow_db_resource_add(struct bnxt_ulp_context *ulp_ctxt,
 	struct bnxt_ulp_flow_db *flow_db;
 	struct bnxt_ulp_flow_tbl *flow_tbl;
 	struct ulp_fdb_resource_info *resource, *fid_resource;
+	struct bnxt_ulp_fc_info *ulp_fc_info;
 	uint32_t idx;
 
 	flow_db = bnxt_ulp_cntxt_ptr2_flow_db_get(ulp_ctxt);
@@ -728,9 +731,11 @@ ulp_flow_db_resource_add(struct bnxt_ulp_context *ulp_ctxt,
 		ulp_flow_db_res_params_to_info(fid_resource, params);
 	}
 
+	ulp_fc_info = bnxt_ulp_cntxt_ptr2_fc_info_get(ulp_ctxt);
 	if (params->resource_type == TF_TBL_TYPE_ACT_STATS_64 &&
 	    params->resource_sub_type ==
-	    BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT) {
+	    BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT &&
+	    ulp_fc_info) {
 		/* Store the first HW counter ID for this table */
 		if (!ulp_fc_mgr_start_idx_isset(ulp_ctxt, params->direction))
 			ulp_fc_mgr_start_idx_set(ulp_ctxt, params->direction,
drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c +22 -2
index 1dc634d628..5c94e2f5d0 100644
@@ -246,8 +246,28 @@ ulp_mapper_gen_tbl_entry_data_get(struct ulp_mapper_gen_tbl_entry *entry,
 	return 0;
 }
 
-/*
- * Free the generic table list entry
+/* Free the generic table list entry
+ *
+ * ulp_ctx [in] - Pointer to the ulp context
+ * tbl_idx [in] - Index of the generic table
+ * ckey [in] - Key for the entry in the table
+ *
+ * returns 0 on success
+ */
+int32_t
+ulp_mapper_gen_tbl_entry_free(struct bnxt_ulp_context *ulp_ctx,
+			      uint32_t tbl_idx, uint32_t ckey)
+{
+	struct ulp_flow_db_res_params res;
+
+	res.direction = tbl_idx & 0x1;
+	res.resource_sub_type = tbl_idx >> 1;
+	res.resource_hndl = ckey;
+
+	return ulp_mapper_gen_tbl_res_free(ulp_ctx, &res);
+}
+
+/* Free the generic table list resource
  *
  * ulp_ctx [in] - Pointer to the ulp context
  * res [in] - Pointer to flow db resource entry
drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h +13 -1
index 7f4a877e9a..f245825142 100644
@@ -131,7 +131,7 @@ ulp_mapper_gen_tbl_entry_data_get(struct ulp_mapper_gen_tbl_entry *entry,
 				  uint32_t data_size);
 
 /*
- * Free the generic table list entry
+ * Free the generic table list resource
  *
  * ulp_ctx [in] - Pointer to the ulp context
  * res [in] - Pointer to flow db resource entry
@@ -142,6 +142,18 @@ int32_t
 ulp_mapper_gen_tbl_res_free(struct bnxt_ulp_context *ulp_ctx,
 			    struct ulp_flow_db_res_params *res);
 
+/* Free the generic table list entry
+ *
+ * ulp_ctx [in] - Pointer to the ulp context
+ * tbl_idx [in] - Index of the generic table
+ * ckey [in] - Key for the entry in the table
+ *
+ * returns 0 on success
+ */
+int32_t
+ulp_mapper_gen_tbl_entry_free(struct bnxt_ulp_context *ulp_ctx,
+			      uint32_t tbl_idx, uint32_t ckey);
+
 /*
  * Write the generic table list hash entry
  *
drivers/net/bnxt/tf_ulp/ulp_mapper.c +228 -180

606 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +7 -0
index 8f0b894d39..8652dd203c 100644
@@ -82,6 +82,7 @@ struct bnxt_ulp_mapper_create_parms {
 	/* if set then create a parent flow */
 	uint32_t			parent_flow;
 	uint8_t				tun_idx;
+	uint64_t			shared_hndl;
 
 	/* support pattern based rejection */
 	uint32_t			flow_pattern_id;
@@ -120,4 +121,10 @@ ulp_mapper_resources_free(struct bnxt_ulp_context *ulp_ctx,
 			  enum bnxt_ulp_fdb_type flow_type,
 			  uint32_t fid);
 
+int32_t
+ulp_mapper_get_shared_fid(struct bnxt_ulp_context *ulp,
+			  uint32_t id,
+			  uint16_t key,
+			  uint32_t *fid);
+
 #endif /* _ULP_MAPPER_H_ */
drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c +7 -3
index 06ad5a94e2..271520e1d3 100644
@@ -73,6 +73,12 @@ ulp_mark_db_init(struct bnxt_ulp_context *ctxt)
 		return -EINVAL;
 	}
 
+	if (!dparms->mark_db_lfid_entries || !dparms->mark_db_gfid_entries) {
+		BNXT_TF_DBG(DEBUG, "mark Table is not allocated\n");
+		bnxt_ulp_cntxt_ptr2_mark_db_set(ctxt, NULL);
+		return 0;
+	}
+
 	mark_tbl = rte_zmalloc("ulp_rx_mark_tbl_ptr",
 			       sizeof(struct bnxt_ulp_mark_tbl), 0);
 	if (!mark_tbl)
@@ -182,10 +188,8 @@ ulp_mark_db_mark_get(struct bnxt_ulp_context *ctxt,
 		return -EINVAL;
 
 	mtbl = bnxt_ulp_cntxt_ptr2_mark_db_get(ctxt);
-	if (!mtbl) {
-		BNXT_TF_DBG(ERR, "Unable to get Mark Table\n");
+	if (!mtbl)
 		return -EINVAL;
-	}
 
 	idx = ulp_mark_db_idx_get(is_gfid, fid, mtbl);
 
drivers/net/bnxt/tf_ulp/ulp_port_db.c +74 -12

116 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_port_db.h +28 -1
index 9d0e613fc8..740c186e12 100644
@@ -279,7 +279,7 @@ ulp_port_db_port_func_id_get(struct bnxt_ulp_context *ulp_ctxt,
  * Api to get the parent mac address for a given port id.
  *
  * ulp_ctxt [in] Ptr to ulp context
- * port_id [in].device port id
+ * port_id [in] device port id
  * mac_addr [out] mac address
  *
  * Returns 0 on success or negative number on failure.
@@ -287,4 +287,31 @@ ulp_port_db_port_func_id_get(struct bnxt_ulp_context *ulp_ctxt,
 int32_t
 ulp_port_db_parent_mac_addr_get(struct bnxt_ulp_context *ulp_ctxt,
 				uint32_t port_id, uint8_t **mac_addr);
+
+/*
+ * Api to get the mac address for a given port id.
+ *
+ * ulp_ctxt [in] Ptr to ulp context
+ * port_id [in] device port id
+ * mac_addr [out] mac address
+ *
+ * Returns 0 on success or negative number on failure.
+ */
+int32_t
+ulp_port_db_drv_mac_addr_get(struct bnxt_ulp_context *ulp_ctxt,
+			     uint32_t port_id, uint8_t **mac_addr);
+
+/*
+ * Api to get the parent vnic for a given port id.
+ *
+ * ulp_ctxt [in] Ptr to ulp context
+ * port_id [in] device port id
+ * vnic [out] parent vnic
+ *
+ * Returns 0 on success or negative number on failure.
+ */
+int32_t
+ulp_port_db_parent_vnic_get(struct bnxt_ulp_context *ulp_ctxt,
+			    uint32_t port_id, uint8_t **vnic);
+
 #endif /* _ULP_PORT_DB_H_ */
drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c +10 -6
index 8054bac189..7bd499faa6 100644
@@ -208,6 +208,10 @@ struct bnxt_ulp_rte_act_info ulp_act_info[] = {
 	[RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK] = {
 	.act_type                = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
 	.proto_act_func          = NULL
+	},
+	[RTE_FLOW_ACTION_TYPE_SAMPLE] = {
+	.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,
+	.proto_act_func          = ulp_rte_sample_act_handler
 	}
 };
 
@@ -230,8 +234,8 @@ struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {
 	.proto_hdr_func          = NULL
 	},
 	[RTE_FLOW_ITEM_TYPE_ANY] = {
-	.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
-	.proto_hdr_func          = NULL
+	.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,
+	.proto_hdr_func          = ulp_rte_item_any_handler
 	},
 	[RTE_FLOW_ITEM_TYPE_PF] = {
 	.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,
@@ -270,8 +274,8 @@ struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {
 	.proto_hdr_func          = ulp_rte_ipv6_hdr_handler
 	},
 	[RTE_FLOW_ITEM_TYPE_ICMP] = {
-	.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
-	.proto_hdr_func          = NULL
+	.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,
+	.proto_hdr_func          = ulp_rte_icmp_hdr_handler
 	},
 	[RTE_FLOW_ITEM_TYPE_UDP] = {
 	.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,
@@ -302,8 +306,8 @@ struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {
 	.proto_hdr_func          = NULL
 	},
 	[RTE_FLOW_ITEM_TYPE_GRE] = {
-	.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_hdr_handler
 	},
 	[RTE_FLOW_ITEM_TYPE_FUZZY] = {
 	.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +134 -16

262 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +5 -0
index 24e9ae985c..664878401a 100644
@@ -135,6 +135,11 @@ int32_t
 ulp_rte_item_any_handler(const struct rte_flow_item *item __rte_unused,
 			 struct ulp_rte_parser_params *params __rte_unused);
 
+/* Function to handle the parsing of RTE Flow item ICMP Header. */
+int32_t
+ulp_rte_icmp_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_class.c +55906 -43862

1,352 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +4767 -4172

8,939 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_field.h +301 -274

575 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_act.c deleted +0 -709

709 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +399 -353

752 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h +42 -0

42 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_thor_act.c new file +229 -0

229 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_thor_class.c renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c +2711 -3243

5,954 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +53 -18

71 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +3431 -1968

5,399 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +12 -0
index cd954578e7..cb4df05604 100644

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

drivers/net/bnxt/tf_ulp/ulp_tun.h +0 -4
index 2516eaca2c..898071bfe7 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.c +179 -8

187 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_utils.h +63 -1

64 lines not on this page · raw message

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#112 lore raw

PATCH v2 47/58 net/bnxt: refactor flow parser in ULP

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

1. Remove Ether type, VLAN type and IP proto type from pattern matching, since the header bits can be used for matching. This reduces the class template signatures by a factor of 8.

2. Remove the wild card bit in the pattern matching since same template can be used for both exact and wild card entries.

3. The action record pointers have to use higher range to not collide with the firmware action record pointers. Hence reduced the number of action record pointers for Whitney platform.

4. The conditional update opcode provide functionality to reject flows for instance reject flows that do not adhere to flow signature match.

5. Added check to not populate protocol specifications if the protocol mask is null or zero.

6. Check that field array is not overrun.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |     4 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |   193 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |     2 +-
 drivers/net/bnxt/tf_ulp/ulp_matcher.c         |     4 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |   926 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |     7 +
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 96163 ++--------------
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  5305 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |    31 +-
 .../bnxt/tf_ulp/ulp_template_db_thor_act.c    |     1 -
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c |   218 +-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    |   300 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |    13 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.c           |     2 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.h           |     2 +-
 15 files changed, 8490 insertions(+), 94681 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +2 -2
index 141bc0c784..dd992a246b 100644
@@ -94,7 +94,7 @@ bnxt_ulp_tf_session_resources_get(struct bnxt *bp,
 
 		/* Table Types */
 		res->tbl_cnt[TF_DIR_RX].cnt[TF_TBL_TYPE_FULL_ACT_RECORD] = 8192;
-		res->tbl_cnt[TF_DIR_RX].cnt[TF_TBL_TYPE_ACT_STATS_64] = 16384;
+		res->tbl_cnt[TF_DIR_RX].cnt[TF_TBL_TYPE_ACT_STATS_64] = 8192;
 		res->tbl_cnt[TF_DIR_RX].cnt[TF_TBL_TYPE_ACT_MODIFY_IPV4] = 1023;
 
 		/* ENCAP */
@@ -130,7 +130,7 @@ bnxt_ulp_tf_session_resources_get(struct bnxt *bp,
 
 		/* Table Types */
 		res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_FULL_ACT_RECORD] = 8192;
-		res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_STATS_64] = 16384;
+		res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_STATS_64] = 8192;
 		res->tbl_cnt[TF_DIR_TX].cnt[TF_TBL_TYPE_ACT_MODIFY_IPV4] = 1023;
 
 		/* ENCAP */
drivers/net/bnxt/tf_ulp/ulp_mapper.c +149 -44

241 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +1 -1
index 8652dd203c..9432462404 100644
@@ -26,7 +26,7 @@ struct bnxt_ulp_mapper_glb_resource_entry {
 
 struct bnxt_ulp_mapper_data {
 	struct bnxt_ulp_mapper_glb_resource_entry
-		glb_res_tbl[TF_DIR_MAX][BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ];
+		glb_res_tbl[TF_DIR_MAX][BNXT_ULP_GLB_RF_IDX_LAST];
 	struct ulp_mapper_gen_tbl_list gen_tbl_list[BNXT_ULP_GEN_TBL_MAX_SZ];
 };
 
drivers/net/bnxt/tf_ulp/ulp_matcher.c +2 -2
index 46ac57ac00..8040fb7515 100644
@@ -52,7 +52,7 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
 
 	/* calculate the hash of the given flow */
 	class_hid = ulp_matcher_class_hash_calculate(params->hdr_bitmap.bits,
-						     params->fld_bitmap.bits);
+						     params->fld_s_bitmap.bits);
 
 	/* validate the calculate hash values */
 	if (class_hid >= BNXT_ULP_CLASS_SIG_TBL_MAX_SZ)
@@ -66,7 +66,7 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
 		BNXT_TF_DBG(DEBUG, "Proto Header does not match\n");
 		goto error;
 	}
-	if (ULP_BITMAP_CMP(&params->fld_bitmap, &class_match->field_sig)) {
+	if (ULP_BITMAP_CMP(&params->fld_s_bitmap, &class_match->field_sig)) {
 		BNXT_TF_DBG(DEBUG, "Field signature does not match\n");
 		goto error;
 	}
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +445 -481

1,141 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +7 -0
index 664878401a..66abe8e656 100644
@@ -36,6 +36,13 @@
 #define	BNXT_ULP_PARSER_IPV6_TC			0x0ff00000
 #define	BNXT_ULP_PARSER_IPV6_FLOW_LABEL		0x000fffff
 
+enum bnxt_ulp_prsr_action {
+	ULP_PRSR_ACT_DEFAULT = 0,
+	ULP_PRSR_ACT_MATCH_IGNORE = 1,
+	ULP_PRSR_ACT_MASK_IGNORE = 2,
+	ULP_PRSR_ACT_SPEC_IGNORE = 4
+};
+
 void
 bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 			    struct ulp_rte_parser_params *params,
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +6875 -89288

1,565 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +722 -4583

5,305 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +30 -1
index e9799d0b90..dd23635c57 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_db_thor_act.c +0 -1
index d0d96f32d4..e5a401e3f8 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +108 -110

218 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +135 -165

300 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +12 -1
index cb4df05604..d18f6cab73 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.c +1 -1
index 5dc710338a..329799ea6a 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.h +1 -1
index a30361b8ae..5dd22cf8c3 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.21.1 (Apple Git-122.3)

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

#113 lore raw

PATCH v2 48/58 net/bnxt: add shared session support to ULP

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Shared session permits cooperative sharing of prescribed resources between applications.

- devargs added for app-id in order to enable sharing session resources across applications
- shared session management added
- TRUFLOW resource reservations are now app ID and device dependent

---
 drivers/net/bnxt/bnxt.h                       |    2 +
 drivers/net/bnxt/bnxt_ethdev.c                |   50 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |  645 +++--
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |   39 +
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  186 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |    1 +
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   13 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c | 2177 +++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   33 +
 9 files changed, 2909 insertions(+), 237 deletions(-)
drivers/net/bnxt/bnxt.h +2 -0
index e8a6a50eaa..376f3173e8 100644
@@ -874,9 +874,11 @@ struct bnxt {
 	uint16_t		port_svif;
 
 	struct tf		tfp;
+	struct tf		tfp_shared;
 	struct bnxt_ulp_context	*ulp_ctx;
 	struct bnxt_flow_stat_info *flow_stat;
 	uint16_t		max_num_kflows;
+	uint8_t			app_id;
 	uint16_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 +50 -0

80 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/bnxt_ulp.c +428 -217

723 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/bnxt_ulp.h +39 -0
index 854eca24c3..648fb2ab37 100644
@@ -29,7 +29,13 @@
 
 /* defines for the ulp_flags */
 #define BNXT_ULP_VF_REP_ENABLED		0x1
+#define BNXT_ULP_SHARED_SESSION_ENABLED	0x2
+#define BNXT_ULP_APP_DEV_UNSUPPORTED	0x4
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
+#define ULP_SHARED_SESSION_IS_ENABLED(flag) ((flag) &\
+					     BNXT_ULP_SHARED_SESSION_ENABLED)
+#define ULP_APP_DEV_UNSUPPORTED_ENABLED(flag)	((flag) &\
+						 BNXT_ULP_APP_DEV_UNSUPPORTED)
 
 enum bnxt_ulp_flow_mem_type {
 	BNXT_ULP_FLOW_MEM_TYPE_INT = 0,
@@ -67,11 +73,13 @@ struct bnxt_ulp_data {
 #define	BNXT_ULP_MAX_TUN_CACHE_ENTRIES	16
 	struct bnxt_tun_cache_entry	tun_tbl[BNXT_ULP_MAX_TUN_CACHE_ENTRIES];
 	bool				accum_stats;
+	uint8_t				app_id;
 };
 
 struct bnxt_ulp_context {
 	struct bnxt_ulp_data	*cfg_data;
 	struct tf		*g_tfp;
+	struct tf		*g_shared_tfp;
 };
 
 struct bnxt_ulp_pci_info {
@@ -86,6 +94,7 @@ struct bnxt_ulp_session_state {
 	struct bnxt_ulp_pci_info		pci_info;
 	struct bnxt_ulp_data			*cfg_data;
 	struct tf				*g_tfp;
+	struct tf				g_shared_tfp;
 	uint32_t				session_opened;
 };
 
@@ -135,6 +144,14 @@ int32_t
 bnxt_ulp_cntxt_tbl_scope_id_get(struct bnxt_ulp_context *ulp_ctx,
 				uint32_t *tbl_scope_id);
 
+/* Function to set the tfp session details in the ulp context. */
+int32_t
+bnxt_ulp_cntxt_shared_tfp_set(struct bnxt_ulp_context *ulp, struct tf *tfp);
+
+/* Function to get the tfp session details from ulp context. */
+struct tf *
+bnxt_ulp_cntxt_shared_tfp_get(struct bnxt_ulp_context *ulp);
+
 /* Function to set the tfp session details in the ulp context. */
 int32_t
 bnxt_ulp_cntxt_tfp_set(struct bnxt_ulp_context *ulp, struct tf *tfp);
@@ -233,4 +250,26 @@ bnxt_ulp_cntxt_release_fdb_lock(struct bnxt_ulp_context	*ulp_ctx);
 int32_t
 ulp_post_process_tun_flow(struct ulp_rte_parser_params *params);
 
+struct bnxt_ulp_glb_resource_info *
+bnxt_ulp_app_glb_resource_info_list_get(uint32_t *num_entries);
+
+int32_t
+bnxt_ulp_cntxt_app_id_set(struct bnxt_ulp_context *ulp_ctx, uint8_t app_id);
+
+int32_t
+bnxt_ulp_cntxt_app_id_get(struct bnxt_ulp_context *ulp_ctx, uint8_t *app_id);
+
+bool
+bnxt_ulp_cntxt_shared_session_enabled(struct bnxt_ulp_context *ulp_ctx);
+
+struct bnxt_ulp_app_capabilities_info *
+bnxt_ulp_app_cap_list_get(uint32_t *num_entries);
+
+int32_t
+bnxt_ulp_cntxt_app_caps_init(struct bnxt_ulp_context *ulp_ctx,
+			     uint8_t app_id, uint32_t dev_id);
+
+struct bnxt_ulp_resource_resv_info *
+bnxt_ulp_resource_resv_list_get(uint32_t *num_entries);
+
 #endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/ulp_mapper.c +169 -17

310 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +1 -0
index 9432462404..6e4d9e8522 100644
@@ -22,6 +22,7 @@ struct bnxt_ulp_mapper_glb_resource_entry {
 	enum bnxt_ulp_resource_func	resource_func;
 	uint32_t			resource_type; /* TF_ enum type */
 	uint64_t			resource_hndl;
+	bool				shared;
 };
 
 struct bnxt_ulp_mapper_data {
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +10 -3
index ca019bbe93..5c8893c129 100644
@@ -26,8 +26,10 @@
 #define BNXT_ULP_ACT_HID_SHFTR 27
 #define BNXT_ULP_ACT_HID_SHFTL 26
 #define BNXT_ULP_ACT_HID_MASK 2047
-#define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 11
-#define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 10
+#define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 33
+#define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 27
+#define BNXT_ULP_RESOURCE_RESV_LIST_MAX_SZ 219
+#define BNXT_ULP_APP_CAP_TBL_MAX_SZ 2
 #define BNXT_ULP_COND_GOTO_REJECT 1023
 #define BNXT_ULP_COND_GOTO_RF 0x10000
 #define BNXT_ULP_GLB_FIELD_TBL_SHIFT 7
@@ -348,7 +350,8 @@ enum bnxt_ulp_glb_rf_idx {
 	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_PROFILE_ID_0 = 9,
 	BNXT_ULP_GLB_RF_IDX_APP_GLB_EM_KEY_ID_0 = 10,
 	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_KEY_ID_0 = 11,
-	BNXT_ULP_GLB_RF_IDX_LAST = 12
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_L2_CNTXT_ID_1 = 12,
+	BNXT_ULP_GLB_RF_IDX_LAST = 13
 };
 
 enum bnxt_ulp_hdr_type {
@@ -476,6 +479,10 @@ enum bnxt_ulp_template_type {
 	BNXT_ULP_TEMPLATE_TYPE_LAST = 2
 };
 
+enum bnxt_ulp_app_cap {
+	BNXT_ULP_APP_CAP_SHARED_EN = 0x00000001
+};
+
 enum bnxt_ulp_fdb_resource_flags {
 	BNXT_ULP_FDB_RESOURCE_FLAGS_DIR_INGR = 0x00,
 	BNXT_ULP_FDB_RESOURCE_FLAGS_DIR_EGR = 0x01
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +2177 -0

1,765 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +33 -0
index d18f6cab73..ee5fbdedaa 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.21.1 (Apple Git-122.3)

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