Skip to contentSkip to conversation

bnxt patches

PATCH New Somnath Kotur 4 participants 102 messages Jul 23, 2020 – Jul 28, 2020 Page 1 of 2

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

cover bnxt patches

Some fixes, cleanups and changes to augment pre-existing support in infrastructure

Please apply

Kishore Padmanabha (7):
net/bnxt: nat global registers support
net/bnxt: parif for offload miss rules
net/bnxt: nat template changes
net/bnxt: configure parif for the egress rules net/bnxt: ignore VLAN priority mask
net/bnxt: add egress template with VLAN tag match net/bnxt: tcam table processing support for search and alloc

Mike Baucom (9):
net/bnxt: add shadow tcam capability with search net/bnxt: ulp mapper changes to use tcam search net/bnxt: add tf hash API
net/bnxt: modify tf shadow tcam to use common tf hash net/bnxt: added shadow table capability with search net/bnxt: ulp mapper changes to use tbl search net/bnxt: shadow tcam and tbl reference count modification net/bnxt: added templates for search before alloc net/bnxt: enabled shadow tables during session open

Somnath Kotur (1):
net/bnxt: cleanup of VF-representor dev ops

Venkat Duvvuru (3):
net/bnxt: skip mark id injection into mbuf net/bnxt: fix port default rule create and destroy net/bnxt: delete VF FW rules when a representor is created

 drivers/net/bnxt/bnxt.h                         |   6 +-
 drivers/net/bnxt/bnxt_ethdev.c                  |  81 +--
 drivers/net/bnxt/bnxt_hwrm.c                    |  49 ++
 drivers/net/bnxt/bnxt_hwrm.h                    |   2 +
 drivers/net/bnxt/bnxt_reps.c                    |  94 +--
 drivers/net/bnxt/bnxt_rxr.c                     |   3 +
 drivers/net/bnxt/bnxt_txq.h                     |   1 -
 drivers/net/bnxt/bnxt_txr.c                     |   6 +-
 drivers/net/bnxt/hsi_struct_def_dpdk.h          | 138 ++++
 drivers/net/bnxt/meson.build                    |   1 +
 drivers/net/bnxt/tf_core/Makefile               |   1 +
 drivers/net/bnxt/tf_core/tf_core.c              | 139 +++-
 drivers/net/bnxt/tf_core/tf_core.h              | 174 +++++
 drivers/net/bnxt/tf_core/tf_device_p4.c         |   4 +-
 drivers/net/bnxt/tf_core/tf_hash.c              | 106 +++
 drivers/net/bnxt/tf_core/tf_hash.h              |  27 +
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c        | 766 +++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.h        | 124 ++--
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c       | 818 +++++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h       | 258 ++++----
 drivers/net/bnxt/tf_core/tf_tbl.c               | 246 ++++++-
 drivers/net/bnxt/tf_core/tf_tbl.h               |  22 +-
 drivers/net/bnxt/tf_core/tf_tcam.c              | 300 ++++++++-
 drivers/net/bnxt/tf_core/tf_tcam.h              |  31 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c              |  97 ++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h              |  18 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c         | 127 +++-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c           |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h           |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c            | 505 ++++++++++-----
 drivers/net/bnxt/tf_ulp/ulp_port_db.c           |   2 +
 drivers/net/bnxt/tf_ulp/ulp_port_db.h           |   1 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c        |  81 +++
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c   | 434 ++++++++-----
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c | 556 ++++++++++++++--
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h  |  73 ++-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c   |   4 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h   |   8 +-
 38 files changed, 4457 insertions(+), 850 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/20 net/bnxt: add shadow tcam capability with search

From: Mike Baucom <[email protected]>

- Add TCAM shadow tables for searching
- Add Search API to allow reuse of TCAM entries

---
 drivers/net/bnxt/tf_core/tf_core.c        |  73 +++
 drivers/net/bnxt/tf_core/tf_core.h        | 101 ++++
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   2 +-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 885 +++++++++++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h | 258 ++++-----
 drivers/net/bnxt/tf_core/tf_tcam.c        | 300 +++++++++-
 drivers/net/bnxt/tf_core/tf_tcam.h        |  31 +-
 7 files changed, 1449 insertions(+), 201 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +73 -0
index 97e7952..ca3280b 100644
@@ -608,6 +608,79 @@ tf_search_identifier(struct tf *tfp,
 }
 
 int
+tf_search_tcam_entry(struct tf *tfp,
+		     struct tf_search_tcam_entry_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+	struct tf_tcam_alloc_search_parms sparms;
+
+	TF_CHECK_PARMS2(tfp, parms);
+
+	memset(&sparms, 0, sizeof(struct tf_tcam_alloc_search_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_alloc_search_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;
+	}
+
+	sparms.dir = parms->dir;
+	sparms.type = parms->tcam_tbl_type;
+	sparms.key = parms->key;
+	sparms.key_size = TF_BITS2BYTES_WORD_ALIGN(parms->key_sz_in_bits);
+	sparms.mask = parms->mask;
+	sparms.priority = parms->priority;
+	sparms.alloc = parms->alloc;
+
+	/* Result is an in/out and so no need to copy during outputs */
+	sparms.result = parms->result;
+	sparms.result_size =
+		TF_BITS2BYTES_WORD_ALIGN(parms->result_sz_in_bits);
+
+	rc = dev->ops->tf_dev_alloc_search_tcam(tfp, &sparms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: TCAM allocation failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Copy the outputs */
+	parms->hit = sparms.hit;
+	parms->search_status = sparms.search_status;
+	parms->ref_cnt = sparms.ref_cnt;
+	parms->idx = sparms.idx;
+
+	return 0;
+}
+
+int
 tf_alloc_tcam_entry(struct tf *tfp,
 		    struct tf_alloc_tcam_entry_parms *parms)
 {
drivers/net/bnxt/tf_core/tf_core.h +101 -0

119 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device_p4.c +1 -1
index f38c38e..afb6098 100644
@@ -133,7 +133,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_alloc_search_tcam = NULL,
+	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
 	.tf_dev_get_tcam = NULL,
 	.tf_dev_insert_int_em_entry = tf_em_insert_int_entry,
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +863 -22

924 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tcam.h +107 -151

339 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.c +281 -19

445 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.h +23 -8
index ee5bacc..4722ce0 100644
@@ -104,19 +104,19 @@ struct tf_tcam_alloc_search_parms {
 	 */
 	enum tf_tcam_tbl_type type;
 	/**
-	 * [in] Enable search for matching entry
+	 * [in] Type of HCAPI
 	 */
-	uint8_t search_enable;
+	uint16_t hcapi_type;
 	/**
-	 * [in] Key data to match on (if search)
+	 * [in] Key data to match on
 	 */
 	uint8_t *key;
 	/**
-	 * [in] key size (if search)
+	 * [in] key size in bits
 	 */
 	uint16_t key_size;
 	/**
-	 * [in] Mask data to match on (if search)
+	 * [in] Mask data to match on
 	 */
 	uint8_t *mask;
 	/**
@@ -124,16 +124,31 @@ struct tf_tcam_alloc_search_parms {
 	 */
 	uint32_t priority;
 	/**
-	 * [out] If search, set if matching entry found
+	 * [in] Allocate on miss.
+	 */
+	uint8_t alloc;
+	/**
+	 * [out] Set if matching entry found
 	 */
 	uint8_t hit;
 	/**
+	 * [out] Search result status (hit, miss, reject)
+	 */
+	enum tf_tcam_search_status search_status;
+	/**
 	 * [out] Current refcnt after allocation
 	 */
 	uint16_t ref_cnt;
 	/**
-	 * [out] Idx allocated
-	 *
+	 * [inout] The result data from the search is copied here
+	 */
+	uint8_t *result;
+	/**
+	 * [inout] result size in bits for the result data
+	 */
+	uint16_t result_size;
+	/**
+	 * [out] Index found
 	 */
 	uint16_t idx;
 };
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/20 net/bnxt: nat global registers support

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

Add support to enable or disable the NAT global registers. The NAT feature is enabled in hardware during initialization and disabled at deinitialization of the application.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 83 ++++++++++++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h |  4 ++
 2 files changed, 87 insertions(+)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +83 -0
index 0869231..7c65a4b 100644
@@ -597,6 +597,52 @@ ulp_session_deinit(struct bnxt_ulp_session_state *session)
 }
 
 /*
+ * Internal api to enable NAT feature.
+ * Set set_flag to 1 to set the value or zero to reset the value.
+ * returns 0 on success.
+ */
+static int32_t
+bnxt_ulp_global_cfg_update(struct bnxt *bp,
+			   enum tf_dir dir,
+			   enum tf_global_config_type type,
+			   uint32_t offset,
+			   uint32_t value,
+			   uint32_t set_flag)
+{
+	uint32_t global_cfg = 0;
+	int rc;
+	struct tf_global_cfg_parms parms;
+
+	/* Initialize the params */
+	parms.dir = dir,
+	parms.type = type,
+	parms.offset = offset,
+	parms.config = (uint8_t *)&global_cfg,
+	parms.config_sz_in_bytes = sizeof(global_cfg);
+
+	rc = tf_get_global_cfg(&bp->tfp, &parms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to get global cfg 0x%x rc:%d\n",
+			    type, rc);
+		return rc;
+	}
+
+	if (set_flag)
+		global_cfg |= value;
+	else
+		global_cfg &= ~value;
+
+	/* SET the register RE_CFA_REG_ACT_TECT */
+	rc = tf_set_global_cfg(&bp->tfp, &parms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set global cfg 0x%x rc:%d\n",
+			    type, rc);
+		return rc;
+	}
+	return rc;
+}
+
+/*
  * When a port is initialized by dpdk. This functions is called
  * and this function initializes the ULP context and rest of the
  * infrastructure associated with it.
@@ -732,6 +778,29 @@ bnxt_ulp_init(struct bnxt *bp)
 		goto jump_to_error;
 	}
 
+	/*
+	 * Enable NAT feature. Set the global configuration register
+	 * Tunnel encap to enable NAT with the reuse of existing inner
+	 * L2 header smac and dmac
+	 */
+	rc = bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,
+					TF_TUNNEL_ENCAP_NAT,
+					(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					BNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set rx global configuration\n");
+		goto jump_to_error;
+	}
+
+	rc = bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,
+					TF_TUNNEL_ENCAP_NAT,
+					(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					BNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set tx global configuration\n");
+		goto jump_to_error;
+	}
+
 	return rc;
 
 jump_to_error:
@@ -785,6 +854,19 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	/* Delete the Port database */
 	ulp_port_db_deinit(bp->ulp_ctx);
 
+	/* Disable NAT feature */
+	(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,
+					 TF_TUNNEL_ENCAP_NAT,
+					 (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),
+					 0);
+
+	(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,
+					 TF_TUNNEL_ENCAP_NAT,
+					 (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),
+					 0);
+
 	/* Delete the ulp context and tf session */
 	ulp_ctx_detach(bp, session);
 
@@ -942,6 +1024,7 @@ bnxt_ulp_eth_dev_ptr2_cntxt_get(struct rte_eth_dev	*dev)
 
 	if (BNXT_ETH_DEV_IS_REPRESENTOR(dev)) {
 		struct bnxt_vf_representor *vfr = dev->data->dev_private;
+
 		bp = vfr->parent_dev->data->dev_private;
 	}
 
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +4 -0
index f9e5e2b..7c95ead 100644
@@ -14,6 +14,10 @@
 
 #include "ulp_template_db_enum.h"
 
+/* NAT defines to reuse existing inner L2 SMAC and DMAC */
+#define BNXT_ULP_NAT_INNER_L2_HEADER_SMAC	0x2000
+#define BNXT_ULP_NAT_INNER_L2_HEADER_DMAC	0x100
+
 /* defines for the ulp_flags */
 #define BNXT_ULP_VF_REP_ENABLED		0x1
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/20 net/bnxt: parif for offload miss rules

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

For the offload miss rules, the parif miss path needs to be considered. The higher parif are reserved for handling this.

---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c  |  4 ++--
 drivers/net/bnxt/tf_ulp/ulp_port_db.h    |  1 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 40 ++++++++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +2 -2
index 4d4f7c4..d86e4c9 100644
@@ -12,8 +12,6 @@
 #include "ulp_flow_db.h"
 #include "ulp_mapper.h"
 
-#define BNXT_ULP_FREE_PARIF_BASE 11
-
 struct bnxt_ulp_def_param_handler {
 	int32_t (*vfr_func)(struct bnxt_ulp_context *ulp_ctx,
 			    struct ulp_tlv_param *param,
@@ -85,6 +83,8 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx,
 
 	if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
 		idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF;
+		/* Parif needs to be reset to a free partition */
+		parif += BNXT_ULP_FREE_PARIF_BASE;
 	} else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) {
 		idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF;
 		/* Parif needs to be reset to a free partition */
drivers/net/bnxt/tf_ulp/ulp_port_db.h +1 -0
index 393d01b..2b323d1 100644
@@ -10,6 +10,7 @@
 
 #define BNXT_PORT_DB_MAX_INTF_LIST		256
 #define BNXT_PORT_DB_MAX_FUNC			2048
+#define BNXT_ULP_FREE_PARIF_BASE		11
 
 enum bnxt_ulp_svif_type {
 	BNXT_ULP_DRV_FUNC_SVIF = 0,
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +40 -0
index 3891bcd..39f801b 100644
@@ -159,6 +159,43 @@ bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[],
 }
 
 /*
+ * Function to handle the post processing of the computed
+ * fields for the interface.
+ */
+static void
+bnxt_ulp_comp_fld_intf_update(struct ulp_rte_parser_params *params)
+{
+	uint32_t ifindex;
+	uint16_t port_id, parif;
+	enum bnxt_ulp_direction_type dir;
+
+	/* get the direction details */
+	dir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);
+
+	if (dir == BNXT_ULP_DIR_INGRESS) {
+		/* read the port id details */
+		port_id = ULP_COMP_FLD_IDX_RD(params,
+					      BNXT_ULP_CF_IDX_INCOMING_IF);
+		if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx,
+						      port_id,
+						      &ifindex)) {
+			BNXT_TF_DBG(ERR, "ParseErr:Portid is not valid\n");
+			return;
+		}
+		/* Set port PARIF */
+		if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
+					  BNXT_ULP_PHY_PORT_PARIF, &parif)) {
+			BNXT_TF_DBG(ERR, "ParseErr:ifindex is not valid\n");
+			return;
+		}
+		/* Parif needs to be reset to a free partition */
+		parif += BNXT_ULP_FREE_PARIF_BASE;
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_PHY_PORT_PARIF,
+				    parif);
+	}
+}
+
+/*
  * Function to handle the post processing of the parsing details
  */
 int32_t
@@ -213,6 +250,9 @@ bnxt_ulp_rte_parser_post_process(struct ulp_rte_parser_params *params)
 	/* Merge the hdr_fp_bit into the proto header bit */
 	params->hdr_bitmap.bits |= params->hdr_fp_bit.bits;
 
+	/* Update the computed interface parameters */
+	bnxt_ulp_comp_fld_intf_update(params);
+
 	/* TBD: Handle the flow rejection scenarios */
 	return 0;
 }
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/20 net/bnxt: ulp mapper changes to use tcam search

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

modified ulp mappper to use the new tf_search_tcam_entry API. When search before allocation is requested, mapper calls tc_search_tcam_entry with the alloc flag.

- On HIT, the result and tcam index is returned.
- On MISS, the tcam index is returned but the result is created and the tcam entry is set.
- On REJECT, the flow request is rejected.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c | 106 +++++++++++++++++++++++------------
 1 file changed, 71 insertions(+), 35 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +71 -35
index 6a727ed..2d3373d 100644
@@ -690,7 +690,7 @@ ulp_mapper_ident_extract(struct bnxt_ulp_mapper_parms *parms,
 {
 	struct ulp_flow_db_res_params	fid_parms;
 	uint64_t id = 0;
-	uint32_t idx;
+	uint32_t idx = 0;
 	struct tf_search_identifier_parms sparms = { 0 };
 	struct tf_free_identifier_parms free_parms = { 0 };
 	struct tf *tfp;
@@ -1292,12 +1292,13 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	struct tf *tfp;
 	int32_t rc, trc;
 	struct tf_alloc_tcam_entry_parms aparms		= { 0 };
+	struct tf_search_tcam_entry_parms searchparms   = { 0 };
 	struct tf_set_tcam_entry_parms sparms		= { 0 };
 	struct ulp_flow_db_res_params	fid_parms	= { 0 };
 	struct tf_free_tcam_entry_parms free_parms	= { 0 };
 	uint32_t hit = 0;
 	uint16_t tmplen = 0;
-	struct ulp_blob res_blob;
+	uint16_t idx;
 
 	/* Skip this if was handled by the cache. */
 	if (parms->tcam_tbl_opc == BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_SKIP) {
@@ -1352,37 +1353,72 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 	}
 
-	aparms.dir		= tbl->direction;
-	aparms.tcam_tbl_type	= tbl->resource_type;
-	aparms.search_enable	= tbl->srch_b4_alloc;
-	aparms.key_sz_in_bits	= tbl->key_bit_size;
-	aparms.key		= ulp_blob_data_get(&key, &tmplen);
-	if (tbl->key_bit_size != tmplen) {
-		BNXT_TF_DBG(ERR, "Key len (%d) != Expected (%d)\n",
-			    tmplen, tbl->key_bit_size);
-		return -EINVAL;
-	}
+	if (!tbl->srch_b4_alloc) {
+		/*
+		 * 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_sz_in_bits	= tbl->key_bit_size;
+		aparms.key		= ulp_blob_data_get(&key, &tmplen);
+		if (tbl->key_bit_size != tmplen) {
+			BNXT_TF_DBG(ERR, "Key len (%d) != Expected (%d)\n",
+				    tmplen, tbl->key_bit_size);
+			return -EINVAL;
+		}
 
-	aparms.mask		= ulp_blob_data_get(&mask, &tmplen);
-	if (tbl->key_bit_size != tmplen) {
-		BNXT_TF_DBG(ERR, "Mask len (%d) != Expected (%d)\n",
-			    tmplen, tbl->key_bit_size);
-		return -EINVAL;
-	}
+		aparms.mask		= ulp_blob_data_get(&mask, &tmplen);
+		if (tbl->key_bit_size != tmplen) {
+			BNXT_TF_DBG(ERR, "Mask len (%d) != Expected (%d)\n",
+				    tmplen, tbl->key_bit_size);
+			return -EINVAL;
+		}
 
-	aparms.priority		= tbl->priority;
+		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
-	 */
-	rc = tf_alloc_tcam_entry(tfp, &aparms);
-	if (rc) {
-		BNXT_TF_DBG(ERR, "tcam alloc failed rc=%d.\n", rc);
-		return rc;
-	}
+		/*
+		 * All failures after this succeeds require the entry to be
+		 * freed. cannot return directly on failure, but needs to goto
+		 * error.
+		 */
+		rc = tf_alloc_tcam_entry(tfp, &aparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "tcam alloc failed rc=%d.\n", rc);
+			return rc;
+		}
+		idx = aparms.idx;
+		hit = aparms.hit;
+	} else {
+		/*
+		 * Searching before allocation to see if we already have an
+		 * entry.  This allows re-use of a constrained resource.
+		 */
+		searchparms.dir = tbl->direction;
+		searchparms.tcam_tbl_type = tbl->resource_type;
+		searchparms.key = ulp_blob_data_get(&key, &tmplen);
+		searchparms.key_sz_in_bits = tbl->key_bit_size;
+		searchparms.mask = ulp_blob_data_get(&mask, &tmplen);
+		searchparms.priority = tbl->priority;
+		searchparms.alloc = 1;
+		searchparms.result = ulp_blob_data_get(&data, &tmplen);
+		searchparms.result_sz_in_bits = tbl->result_bit_size;
+
+		rc = tf_search_tcam_entry(tfp, &searchparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "tcam search failed rc=%d\n", rc);
+			return rc;
+		}
 
-	hit = aparms.hit;
+		/* Successful search, check the result */
+		if (searchparms.search_status == REJECT) {
+			BNXT_TF_DBG(ERR, "tcam alloc rejected\n");
+			return -ENOMEM;
+		}
+		idx = searchparms.idx;
+		hit = searchparms.hit;
+	}
 
 	/* Build the result */
 	if (!tbl->srch_b4_alloc || !hit) {
@@ -1430,9 +1466,9 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 			}
 		}
 
-		sparms.dir		= aparms.dir;
-		sparms.tcam_tbl_type	= aparms.tcam_tbl_type;
-		sparms.idx		= aparms.idx;
+		sparms.dir		= tbl->direction;
+		sparms.tcam_tbl_type	= tbl->resource_type;
+		sparms.idx		= idx;
 		/* Already verified the key/mask lengths */
 		sparms.key		= ulp_blob_data_get(&key, &tmplen);
 		sparms.mask		= ulp_blob_data_get(&mask, &tmplen);
@@ -1464,7 +1500,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 				rc = -EINVAL;
 				goto error;
 			}
-			parms->cache_ptr->tcam_idx = aparms.idx;
+			parms->cache_ptr->tcam_idx = idx;
 		}
 
 		/* Mark action */
@@ -1483,7 +1519,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		idents = ulp_mapper_ident_fields_get(tbl, &num_idents);
 		for (i = 0; i < num_idents; i++) {
 			rc = ulp_mapper_ident_extract(parms, tbl,
-						      &idents[i], &res_blob);
+						      &idents[i], &data);
 			if (rc) {
 				BNXT_TF_DBG(ERR,
 					    "Error in ident extraction\n");
@@ -1501,7 +1537,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		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	= aparms.idx;
+		fid_parms.resource_hndl	= idx;
 		rc = ulp_flow_db_resource_add(parms->ulp_ctx,
 					      parms->tbl_idx,
 					      parms->fid,
Signature · 1 line
2.7.4
#5 lore raw

PATCH 5/20 net/bnxt: add tf hash API

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Added tf_hash API for common hash uses across tf_core functions

---
 drivers/net/bnxt/meson.build       |   1 +
 drivers/net/bnxt/tf_core/Makefile  |   1 +
 drivers/net/bnxt/tf_core/tf_hash.c | 106 +++++++++++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_core/tf_hash.h |  27 ++++++++++
 4 files changed, 135 insertions(+)
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.h
drivers/net/bnxt/meson.build +1 -0
index 8529b33..190469e 100644
@@ -47,6 +47,7 @@ sources = files('bnxt_cpr.c',
 	'tf_core/tf_global_cfg.c',
 	'tf_core/tf_em_host.c',
 	'tf_core/tf_shadow_identifier.c',
+	'tf_core/tf_hash.c',
 
 	'hcapi/hcapi_cfa_p4.c',
 
drivers/net/bnxt/tf_core/Makefile +1 -0
index cca0e2e..cf6aaec 100644
@@ -32,3 +32,4 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_util.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_if_tbl.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_global_cfg.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_identifier.c
+SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_hash.c
drivers/net/bnxt/tf_core/tf_hash.c new file +106 -0

106 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_hash.h new file +27 -0
new file mode 100644
index 0000000..6b60aff
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019-2020 Broadcom
+ * All rights reserved.
+ */
+
+#ifndef _TF_HASH_H_
+#define _TF_HASH_H_
+
+#include "tf_core.h"
+
+/**
+ * Calculate a crc32 on the buffer with an initial value and len
+ *
+ * Returns the crc32
+ */
+uint32_t
+tf_hash_calc_crc32i(uint32_t init, uint8_t *buf, uint32_t len);
+
+/**
+ * Calculate a crc32 on the buffer with a default initial value
+ *
+ * Returns the crc32
+ */
+uint32_t
+tf_hash_calc_crc32(uint8_t *buf, uint32_t len);
+
+#endif
Signature · 1 line
2.7.4
#6 lore raw

PATCH 6/20 net/bnxt: skip mark id injection into mbuf

In reply to Somnath Kotur

From: Venkat Duvvuru <[email protected]>

When a packet is looped back from VF to VFR, it is marked to identify the VFR interface. However, this mark_id shouldn't be percolated up to the OVS as it is internal to pmd.
This patch fixes it by skipping mark injection into mbuf if the packet is received on VFR interface.

---
 drivers/net/bnxt/bnxt_rxr.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/bnxt/bnxt_rxr.c +3 -0
index baf73cb..43b1256 100644
@@ -485,6 +485,9 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,
 	rc = ulp_mark_db_mark_get(bp->ulp_ctx, gfid,
 				  cfa_code, vfr_flag, &mark_id);
 	if (!rc) {
+		/* VF to VFR Rx path. So, skip mark_id injection in mbuf */
+		if (vfr_flag && *vfr_flag)
+			return mark_id;
 		/* Got the mark, write it to the mbuf and return */
 		mbuf->hash.fdir.hi = mark_id;
 		mbuf->udata64 = (cfa_code & 0xffffffffull) << 32;
Signature · 1 line
2.7.4
#7 lore raw

PATCH 7/20 net/bnxt: nat template changes

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

The template is updated to support additional combinations of NAT actions.

---
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c   | 412 +++++++++++++++---------
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c |  16 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h  |  26 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c   |   4 +-
 4 files changed, 285 insertions(+), 173 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +258 -154
index 0f19e8e..31fe905 100644
@@ -12,80 +12,88 @@ uint16_t ulp_act_sig_tbl[BNXT_ULP_ACT_SIG_TBL_MAX_SZ] = {
 	[BNXT_ULP_ACT_HID_015a] = 1,
 	[BNXT_ULP_ACT_HID_00eb] = 2,
 	[BNXT_ULP_ACT_HID_0043] = 3,
-	[BNXT_ULP_ACT_HID_01d6] = 4,
-	[BNXT_ULP_ACT_HID_015e] = 5,
-	[BNXT_ULP_ACT_HID_00ef] = 6,
-	[BNXT_ULP_ACT_HID_0047] = 7,
-	[BNXT_ULP_ACT_HID_01da] = 8,
-	[BNXT_ULP_ACT_HID_025b] = 9,
-	[BNXT_ULP_ACT_HID_01ec] = 10,
-	[BNXT_ULP_ACT_HID_0144] = 11,
-	[BNXT_ULP_ACT_HID_02d7] = 12,
-	[BNXT_ULP_ACT_HID_025f] = 13,
-	[BNXT_ULP_ACT_HID_01f0] = 14,
-	[BNXT_ULP_ACT_HID_0148] = 15,
-	[BNXT_ULP_ACT_HID_02db] = 16,
-	[BNXT_ULP_ACT_HID_0000] = 17,
-	[BNXT_ULP_ACT_HID_0002] = 18,
-	[BNXT_ULP_ACT_HID_0800] = 19,
-	[BNXT_ULP_ACT_HID_0101] = 20,
-	[BNXT_ULP_ACT_HID_0020] = 21,
-	[BNXT_ULP_ACT_HID_0901] = 22,
-	[BNXT_ULP_ACT_HID_0121] = 23,
-	[BNXT_ULP_ACT_HID_0004] = 24,
-	[BNXT_ULP_ACT_HID_0804] = 25,
-	[BNXT_ULP_ACT_HID_0105] = 26,
-	[BNXT_ULP_ACT_HID_0024] = 27,
-	[BNXT_ULP_ACT_HID_0905] = 28,
-	[BNXT_ULP_ACT_HID_0125] = 29,
-	[BNXT_ULP_ACT_HID_0001] = 30,
-	[BNXT_ULP_ACT_HID_0005] = 31,
-	[BNXT_ULP_ACT_HID_0009] = 32,
-	[BNXT_ULP_ACT_HID_000d] = 33,
-	[BNXT_ULP_ACT_HID_0021] = 34,
-	[BNXT_ULP_ACT_HID_0029] = 35,
-	[BNXT_ULP_ACT_HID_0025] = 36,
-	[BNXT_ULP_ACT_HID_002d] = 37,
-	[BNXT_ULP_ACT_HID_0801] = 38,
-	[BNXT_ULP_ACT_HID_0809] = 39,
-	[BNXT_ULP_ACT_HID_0805] = 40,
-	[BNXT_ULP_ACT_HID_080d] = 41,
-	[BNXT_ULP_ACT_HID_0c15] = 42,
-	[BNXT_ULP_ACT_HID_0c19] = 43,
-	[BNXT_ULP_ACT_HID_02f6] = 44,
-	[BNXT_ULP_ACT_HID_04f8] = 45,
-	[BNXT_ULP_ACT_HID_01df] = 46,
-	[BNXT_ULP_ACT_HID_05e3] = 47,
-	[BNXT_ULP_ACT_HID_02fa] = 48,
-	[BNXT_ULP_ACT_HID_04fc] = 49,
-	[BNXT_ULP_ACT_HID_01e3] = 50,
-	[BNXT_ULP_ACT_HID_05e7] = 51,
-	[BNXT_ULP_ACT_HID_03f7] = 52,
-	[BNXT_ULP_ACT_HID_05f9] = 53,
-	[BNXT_ULP_ACT_HID_02e0] = 54,
-	[BNXT_ULP_ACT_HID_06e4] = 55,
-	[BNXT_ULP_ACT_HID_03fb] = 56,
-	[BNXT_ULP_ACT_HID_05fd] = 57,
-	[BNXT_ULP_ACT_HID_02e4] = 58,
-	[BNXT_ULP_ACT_HID_06e8] = 59,
-	[BNXT_ULP_ACT_HID_040d] = 60,
-	[BNXT_ULP_ACT_HID_040f] = 61,
-	[BNXT_ULP_ACT_HID_0413] = 62,
-	[BNXT_ULP_ACT_HID_0c0d] = 63,
-	[BNXT_ULP_ACT_HID_0567] = 64,
-	[BNXT_ULP_ACT_HID_0a49] = 65,
-	[BNXT_ULP_ACT_HID_050e] = 66,
-	[BNXT_ULP_ACT_HID_0d0e] = 67,
-	[BNXT_ULP_ACT_HID_0668] = 68,
-	[BNXT_ULP_ACT_HID_0b4a] = 69,
-	[BNXT_ULP_ACT_HID_0411] = 70,
-	[BNXT_ULP_ACT_HID_056b] = 71,
-	[BNXT_ULP_ACT_HID_0a4d] = 72,
-	[BNXT_ULP_ACT_HID_0c11] = 73,
-	[BNXT_ULP_ACT_HID_0512] = 74,
-	[BNXT_ULP_ACT_HID_0d12] = 75,
-	[BNXT_ULP_ACT_HID_066c] = 76,
-	[BNXT_ULP_ACT_HID_0b4e] = 77
+	[BNXT_ULP_ACT_HID_03d8] = 4,
+	[BNXT_ULP_ACT_HID_02c1] = 5,
+	[BNXT_ULP_ACT_HID_015e] = 6,
+	[BNXT_ULP_ACT_HID_00ef] = 7,
+	[BNXT_ULP_ACT_HID_0047] = 8,
+	[BNXT_ULP_ACT_HID_03dc] = 9,
+	[BNXT_ULP_ACT_HID_02c5] = 10,
+	[BNXT_ULP_ACT_HID_025b] = 11,
+	[BNXT_ULP_ACT_HID_01ec] = 12,
+	[BNXT_ULP_ACT_HID_0144] = 13,
+	[BNXT_ULP_ACT_HID_04d9] = 14,
+	[BNXT_ULP_ACT_HID_03c2] = 15,
+	[BNXT_ULP_ACT_HID_025f] = 16,
+	[BNXT_ULP_ACT_HID_01f0] = 17,
+	[BNXT_ULP_ACT_HID_0148] = 18,
+	[BNXT_ULP_ACT_HID_04dd] = 19,
+	[BNXT_ULP_ACT_HID_03c6] = 20,
+	[BNXT_ULP_ACT_HID_0000] = 21,
+	[BNXT_ULP_ACT_HID_0002] = 22,
+	[BNXT_ULP_ACT_HID_0800] = 23,
+	[BNXT_ULP_ACT_HID_0101] = 24,
+	[BNXT_ULP_ACT_HID_0020] = 25,
+	[BNXT_ULP_ACT_HID_0901] = 26,
+	[BNXT_ULP_ACT_HID_0121] = 27,
+	[BNXT_ULP_ACT_HID_0004] = 28,
+	[BNXT_ULP_ACT_HID_0804] = 29,
+	[BNXT_ULP_ACT_HID_0105] = 30,
+	[BNXT_ULP_ACT_HID_0024] = 31,
+	[BNXT_ULP_ACT_HID_0905] = 32,
+	[BNXT_ULP_ACT_HID_0125] = 33,
+	[BNXT_ULP_ACT_HID_0001] = 34,
+	[BNXT_ULP_ACT_HID_0005] = 35,
+	[BNXT_ULP_ACT_HID_0009] = 36,
+	[BNXT_ULP_ACT_HID_000d] = 37,
+	[BNXT_ULP_ACT_HID_0021] = 38,
+	[BNXT_ULP_ACT_HID_0029] = 39,
+	[BNXT_ULP_ACT_HID_0025] = 40,
+	[BNXT_ULP_ACT_HID_002d] = 41,
+	[BNXT_ULP_ACT_HID_0801] = 42,
+	[BNXT_ULP_ACT_HID_0809] = 43,
+	[BNXT_ULP_ACT_HID_0805] = 44,
+	[BNXT_ULP_ACT_HID_080d] = 45,
+	[BNXT_ULP_ACT_HID_0c15] = 46,
+	[BNXT_ULP_ACT_HID_0c19] = 47,
+	[BNXT_ULP_ACT_HID_02f6] = 48,
+	[BNXT_ULP_ACT_HID_04f8] = 49,
+	[BNXT_ULP_ACT_HID_01df] = 50,
+	[BNXT_ULP_ACT_HID_07e5] = 51,
+	[BNXT_ULP_ACT_HID_06ce] = 52,
+	[BNXT_ULP_ACT_HID_02fa] = 53,
+	[BNXT_ULP_ACT_HID_04fc] = 54,
+	[BNXT_ULP_ACT_HID_01e3] = 55,
+	[BNXT_ULP_ACT_HID_07e9] = 56,
+	[BNXT_ULP_ACT_HID_06d2] = 57,
+	[BNXT_ULP_ACT_HID_03f7] = 58,
+	[BNXT_ULP_ACT_HID_05f9] = 59,
+	[BNXT_ULP_ACT_HID_02e0] = 60,
+	[BNXT_ULP_ACT_HID_08e6] = 61,
+	[BNXT_ULP_ACT_HID_07cf] = 62,
+	[BNXT_ULP_ACT_HID_03fb] = 63,
+	[BNXT_ULP_ACT_HID_05fd] = 64,
+	[BNXT_ULP_ACT_HID_02e4] = 65,
+	[BNXT_ULP_ACT_HID_08ea] = 66,
+	[BNXT_ULP_ACT_HID_07d3] = 67,
+	[BNXT_ULP_ACT_HID_040d] = 68,
+	[BNXT_ULP_ACT_HID_040f] = 69,
+	[BNXT_ULP_ACT_HID_0413] = 70,
+	[BNXT_ULP_ACT_HID_0c0d] = 71,
+	[BNXT_ULP_ACT_HID_0567] = 72,
+	[BNXT_ULP_ACT_HID_0a49] = 73,
+	[BNXT_ULP_ACT_HID_050e] = 74,
+	[BNXT_ULP_ACT_HID_0d0e] = 75,
+	[BNXT_ULP_ACT_HID_0668] = 76,
+	[BNXT_ULP_ACT_HID_0b4a] = 77,
+	[BNXT_ULP_ACT_HID_0411] = 78,
+	[BNXT_ULP_ACT_HID_056b] = 79,
+	[BNXT_ULP_ACT_HID_0a4d] = 80,
+	[BNXT_ULP_ACT_HID_0c11] = 81,
+	[BNXT_ULP_ACT_HID_0512] = 82,
+	[BNXT_ULP_ACT_HID_0d12] = 83,
+	[BNXT_ULP_ACT_HID_066c] = 84,
+	[BNXT_ULP_ACT_HID_0b4e] = 85
 };
 
 struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
@@ -112,14 +120,25 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 	.act_tid = 1
 	},
 	[4] = {
-	.act_hid = BNXT_ULP_ACT_HID_01d6,
+	.act_hid = BNXT_ULP_ACT_HID_03d8,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
 	[5] = {
+	.act_hid = BNXT_ULP_ACT_HID_02c1,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[6] = {
 	.act_hid = BNXT_ULP_ACT_HID_015e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -127,7 +146,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[6] = {
+	[7] = {
 	.act_hid = BNXT_ULP_ACT_HID_00ef,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -136,7 +155,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[7] = {
+	[8] = {
 	.act_hid = BNXT_ULP_ACT_HID_0047,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -144,16 +163,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[8] = {
-	.act_hid = BNXT_ULP_ACT_HID_01da,
+	[9] = {
+	.act_hid = BNXT_ULP_ACT_HID_03dc,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[9] = {
+	[10] = {
+	.act_hid = BNXT_ULP_ACT_HID_02c5,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[11] = {
 	.act_hid = BNXT_ULP_ACT_HID_025b,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -161,7 +192,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[10] = {
+	[12] = {
 	.act_hid = BNXT_ULP_ACT_HID_01ec,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -170,7 +201,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[11] = {
+	[13] = {
 	.act_hid = BNXT_ULP_ACT_HID_0144,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -178,16 +209,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[12] = {
-	.act_hid = BNXT_ULP_ACT_HID_02d7,
+	[14] = {
+	.act_hid = BNXT_ULP_ACT_HID_04d9,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[13] = {
+	[15] = {
+	.act_hid = BNXT_ULP_ACT_HID_03c2,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[16] = {
 	.act_hid = BNXT_ULP_ACT_HID_025f,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -196,7 +239,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[14] = {
+	[17] = {
 	.act_hid = BNXT_ULP_ACT_HID_01f0,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -206,7 +249,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[15] = {
+	[18] = {
 	.act_hid = BNXT_ULP_ACT_HID_0148,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -215,51 +258,64 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[16] = {
-	.act_hid = BNXT_ULP_ACT_HID_02db,
+	[19] = {
+	.act_hid = BNXT_ULP_ACT_HID_04dd,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[17] = {
+	[20] = {
+	.act_hid = BNXT_ULP_ACT_HID_03c6,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[21] = {
 	.act_hid = BNXT_ULP_ACT_HID_0000,
 	.act_sig = { .bits =
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[18] = {
+	[22] = {
 	.act_hid = BNXT_ULP_ACT_HID_0002,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DROP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[19] = {
+	[23] = {
 	.act_hid = BNXT_ULP_ACT_HID_0800,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_POP_VLAN |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[20] = {
+	[24] = {
 	.act_hid = BNXT_ULP_ACT_HID_0101,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[21] = {
+	[25] = {
 	.act_hid = BNXT_ULP_ACT_HID_0020,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_DECAP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[22] = {
+	[26] = {
 	.act_hid = BNXT_ULP_ACT_HID_0901,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -267,7 +323,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[23] = {
+	[27] = {
 	.act_hid = BNXT_ULP_ACT_HID_0121,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_DECAP |
@@ -275,14 +331,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[24] = {
+	[28] = {
 	.act_hid = BNXT_ULP_ACT_HID_0004,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[25] = {
+	[29] = {
 	.act_hid = BNXT_ULP_ACT_HID_0804,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -290,7 +346,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[26] = {
+	[30] = {
 	.act_hid = BNXT_ULP_ACT_HID_0105,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -298,7 +354,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[27] = {
+	[31] = {
 	.act_hid = BNXT_ULP_ACT_HID_0024,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -306,7 +362,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[28] = {
+	[32] = {
 	.act_hid = BNXT_ULP_ACT_HID_0905,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -315,7 +371,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[29] = {
+	[33] = {
 	.act_hid = BNXT_ULP_ACT_HID_0125,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -324,14 +380,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[30] = {
+	[34] = {
 	.act_hid = BNXT_ULP_ACT_HID_0001,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[31] = {
+	[35] = {
 	.act_hid = BNXT_ULP_ACT_HID_0005,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -339,7 +395,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[32] = {
+	[36] = {
 	.act_hid = BNXT_ULP_ACT_HID_0009,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -347,7 +403,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[33] = {
+	[37] = {
 	.act_hid = BNXT_ULP_ACT_HID_000d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -356,7 +412,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[34] = {
+	[38] = {
 	.act_hid = BNXT_ULP_ACT_HID_0021,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -364,7 +420,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[35] = {
+	[39] = {
 	.act_hid = BNXT_ULP_ACT_HID_0029,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -373,7 +429,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[36] = {
+	[40] = {
 	.act_hid = BNXT_ULP_ACT_HID_0025,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -382,7 +438,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[37] = {
+	[41] = {
 	.act_hid = BNXT_ULP_ACT_HID_002d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -392,7 +448,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[38] = {
+	[42] = {
 	.act_hid = BNXT_ULP_ACT_HID_0801,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -400,7 +456,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[39] = {
+	[43] = {
 	.act_hid = BNXT_ULP_ACT_HID_0809,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -409,7 +465,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[40] = {
+	[44] = {
 	.act_hid = BNXT_ULP_ACT_HID_0805,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -418,7 +474,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[41] = {
+	[45] = {
 	.act_hid = BNXT_ULP_ACT_HID_080d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -428,14 +484,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[42] = {
+	[46] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c15,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_ENCAP |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 4
 	},
-	[43] = {
+	[47] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c19,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_ENCAP |
@@ -443,14 +499,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 4
 	},
-	[44] = {
+	[48] = {
 	.act_hid = BNXT_ULP_ACT_HID_02f6,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[45] = {
+	[49] = {
 	.act_hid = BNXT_ULP_ACT_HID_04f8,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
@@ -458,22 +514,33 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[46] = {
+	[50] = {
 	.act_hid = BNXT_ULP_ACT_HID_01df,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[47] = {
-	.act_hid = BNXT_ULP_ACT_HID_05e3,
+	[51] = {
+	.act_hid = BNXT_ULP_ACT_HID_07e5,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[48] = {
+	[52] = {
+	.act_hid = BNXT_ULP_ACT_HID_06ce,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[53] = {
 	.act_hid = BNXT_ULP_ACT_HID_02fa,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -481,7 +548,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[49] = {
+	[54] = {
 	.act_hid = BNXT_ULP_ACT_HID_04fc,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -490,7 +557,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[50] = {
+	[55] = {
 	.act_hid = BNXT_ULP_ACT_HID_01e3,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -498,16 +565,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[51] = {
-	.act_hid = BNXT_ULP_ACT_HID_05e7,
+	[56] = {
+	.act_hid = BNXT_ULP_ACT_HID_07e9,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[52] = {
+	[57] = {
+	.act_hid = BNXT_ULP_ACT_HID_06d2,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[58] = {
 	.act_hid = BNXT_ULP_ACT_HID_03f7,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -515,7 +594,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[53] = {
+	[59] = {
 	.act_hid = BNXT_ULP_ACT_HID_05f9,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -524,7 +603,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[54] = {
+	[60] = {
 	.act_hid = BNXT_ULP_ACT_HID_02e0,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -532,16 +611,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[55] = {
-	.act_hid = BNXT_ULP_ACT_HID_06e4,
+	[61] = {
+	.act_hid = BNXT_ULP_ACT_HID_08e6,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[56] = {
+	[62] = {
+	.act_hid = BNXT_ULP_ACT_HID_07cf,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[63] = {
 	.act_hid = BNXT_ULP_ACT_HID_03fb,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -550,7 +641,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[57] = {
+	[64] = {
 	.act_hid = BNXT_ULP_ACT_HID_05fd,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -560,7 +651,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[58] = {
+	[65] = {
 	.act_hid = BNXT_ULP_ACT_HID_02e4,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -569,30 +660,43 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[59] = {
-	.act_hid = BNXT_ULP_ACT_HID_06e8,
+	[66] = {
+	.act_hid = BNXT_ULP_ACT_HID_08ea,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[60] = {
+	[67] = {
+	.act_hid = BNXT_ULP_ACT_HID_07d3,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[68] = {
 	.act_hid = BNXT_ULP_ACT_HID_040d,
 	.act_sig = { .bits =
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[61] = {
+	[69] = {
 	.act_hid = BNXT_ULP_ACT_HID_040f,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DROP |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[62] = {
+	[70] = {
 	.act_hid = BNXT_ULP_ACT_HID_0413,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DROP |
@@ -600,14 +704,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[63] = {
+	[71] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c0d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_POP_VLAN |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[64] = {
+	[72] = {
 	.act_hid = BNXT_ULP_ACT_HID_0567,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_VLAN_PCP |
@@ -616,7 +720,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[65] = {
+	[73] = {
 	.act_hid = BNXT_ULP_ACT_HID_0a49,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_VLAN_VID |
@@ -624,14 +728,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[66] = {
+	[74] = {
 	.act_hid = BNXT_ULP_ACT_HID_050e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[67] = {
+	[75] = {
 	.act_hid = BNXT_ULP_ACT_HID_0d0e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -639,7 +743,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[68] = {
+	[76] = {
 	.act_hid = BNXT_ULP_ACT_HID_0668,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -649,7 +753,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[69] = {
+	[77] = {
 	.act_hid = BNXT_ULP_ACT_HID_0b4a,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -658,14 +762,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[70] = {
+	[78] = {
 	.act_hid = BNXT_ULP_ACT_HID_0411,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[71] = {
+	[79] = {
 	.act_hid = BNXT_ULP_ACT_HID_056b,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -675,7 +779,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[72] = {
+	[80] = {
 	.act_hid = BNXT_ULP_ACT_HID_0a4d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -684,7 +788,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[73] = {
+	[81] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c11,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -692,7 +796,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[74] = {
+	[82] = {
 	.act_hid = BNXT_ULP_ACT_HID_0512,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -700,7 +804,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[75] = {
+	[83] = {
 	.act_hid = BNXT_ULP_ACT_HID_0d12,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -709,7 +813,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[76] = {
+	[84] = {
 	.act_hid = BNXT_ULP_ACT_HID_066c,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -720,7 +824,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[77] = {
+	[85] = {
 	.act_hid = BNXT_ULP_ACT_HID_0b4e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +8 -8
index 200a5a6..9de45cd 100644
@@ -17241,7 +17241,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17311,7 +17311,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17325,7 +17325,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17339,7 +17339,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17353,7 +17353,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17367,7 +17367,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17381,7 +17381,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17451,7 +17451,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +17 -9
index b5deaf6..c9fe1bc 100644
@@ -18,7 +18,7 @@
 #define BNXT_ULP_CLASS_HID_SHFTL 31
 #define BNXT_ULP_CLASS_HID_MASK 2047
 #define BNXT_ULP_ACT_SIG_TBL_MAX_SZ 4096
-#define BNXT_ULP_ACT_MATCH_LIST_MAX_SZ 78
+#define BNXT_ULP_ACT_MATCH_LIST_MAX_SZ 86
 #define BNXT_ULP_ACT_HID_LOW_PRIME 7919
 #define BNXT_ULP_ACT_HID_HIGH_PRIME 4721
 #define BNXT_ULP_ACT_HID_SHFTR 23
@@ -786,19 +786,23 @@ enum bnxt_ulp_act_hid {
 	BNXT_ULP_ACT_HID_015a = 0x015a,
 	BNXT_ULP_ACT_HID_00eb = 0x00eb,
 	BNXT_ULP_ACT_HID_0043 = 0x0043,
-	BNXT_ULP_ACT_HID_01d6 = 0x01d6,
+	BNXT_ULP_ACT_HID_03d8 = 0x03d8,
+	BNXT_ULP_ACT_HID_02c1 = 0x02c1,
 	BNXT_ULP_ACT_HID_015e = 0x015e,
 	BNXT_ULP_ACT_HID_00ef = 0x00ef,
 	BNXT_ULP_ACT_HID_0047 = 0x0047,
-	BNXT_ULP_ACT_HID_01da = 0x01da,
+	BNXT_ULP_ACT_HID_03dc = 0x03dc,
+	BNXT_ULP_ACT_HID_02c5 = 0x02c5,
 	BNXT_ULP_ACT_HID_025b = 0x025b,
 	BNXT_ULP_ACT_HID_01ec = 0x01ec,
 	BNXT_ULP_ACT_HID_0144 = 0x0144,
-	BNXT_ULP_ACT_HID_02d7 = 0x02d7,
+	BNXT_ULP_ACT_HID_04d9 = 0x04d9,
+	BNXT_ULP_ACT_HID_03c2 = 0x03c2,
 	BNXT_ULP_ACT_HID_025f = 0x025f,
 	BNXT_ULP_ACT_HID_01f0 = 0x01f0,
 	BNXT_ULP_ACT_HID_0148 = 0x0148,
-	BNXT_ULP_ACT_HID_02db = 0x02db,
+	BNXT_ULP_ACT_HID_04dd = 0x04dd,
+	BNXT_ULP_ACT_HID_03c6 = 0x03c6,
 	BNXT_ULP_ACT_HID_0000 = 0x0000,
 	BNXT_ULP_ACT_HID_0002 = 0x0002,
 	BNXT_ULP_ACT_HID_0800 = 0x0800,
@@ -829,19 +833,23 @@ enum bnxt_ulp_act_hid {
 	BNXT_ULP_ACT_HID_02f6 = 0x02f6,
 	BNXT_ULP_ACT_HID_04f8 = 0x04f8,
 	BNXT_ULP_ACT_HID_01df = 0x01df,
-	BNXT_ULP_ACT_HID_05e3 = 0x05e3,
+	BNXT_ULP_ACT_HID_07e5 = 0x07e5,
+	BNXT_ULP_ACT_HID_06ce = 0x06ce,
 	BNXT_ULP_ACT_HID_02fa = 0x02fa,
 	BNXT_ULP_ACT_HID_04fc = 0x04fc,
 	BNXT_ULP_ACT_HID_01e3 = 0x01e3,
-	BNXT_ULP_ACT_HID_05e7 = 0x05e7,
+	BNXT_ULP_ACT_HID_07e9 = 0x07e9,
+	BNXT_ULP_ACT_HID_06d2 = 0x06d2,
 	BNXT_ULP_ACT_HID_03f7 = 0x03f7,
 	BNXT_ULP_ACT_HID_05f9 = 0x05f9,
 	BNXT_ULP_ACT_HID_02e0 = 0x02e0,
-	BNXT_ULP_ACT_HID_06e4 = 0x06e4,
+	BNXT_ULP_ACT_HID_08e6 = 0x08e6,
+	BNXT_ULP_ACT_HID_07cf = 0x07cf,
 	BNXT_ULP_ACT_HID_03fb = 0x03fb,
 	BNXT_ULP_ACT_HID_05fd = 0x05fd,
 	BNXT_ULP_ACT_HID_02e4 = 0x02e4,
-	BNXT_ULP_ACT_HID_06e8 = 0x06e8,
+	BNXT_ULP_ACT_HID_08ea = 0x08ea,
+	BNXT_ULP_ACT_HID_07d3 = 0x07d3,
 	BNXT_ULP_ACT_HID_040d = 0x040d,
 	BNXT_ULP_ACT_HID_040f = 0x040f,
 	BNXT_ULP_ACT_HID_0413 = 0x0413,
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +2 -2
index 4388a0a..f2e2a59 100644
@@ -259,8 +259,8 @@ struct bnxt_ulp_rte_act_info ulp_act_info[] = {
 	.proto_act_func          = NULL
 	},
 	[RTE_FLOW_ACTION_TYPE_DEC_TTL] = {
-		.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,
-		.proto_act_func          = ulp_rte_dec_ttl_act_handler
+	.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,
+	.proto_act_func          = ulp_rte_dec_ttl_act_handler
 	},
 	[RTE_FLOW_ACTION_TYPE_SET_TTL] = {
 	.act_type                = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
Signature · 1 line
2.7.4
#8 lore raw

PATCH 8/20 net/bnxt: configure parif for the egress rules

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

The parif for the egress rules need to be dynamically configured based on the port type.

---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c         | 11 ++---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c            | 35 ++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_port_db.c           |  2 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c        | 54 ++++++++++++++++++++-----
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c   | 16 ++++++--
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c | 25 +++++++++---
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h  | 14 ++++---
 7 files changed, 123 insertions(+), 34 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +3 -8
index d86e4c9..ddc6da8 100644
@@ -81,17 +81,12 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx,
 	if (rc)
 		return rc;
 
-	if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
+	if (parif_type == BNXT_ULP_PHY_PORT_PARIF)
 		idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF;
-		/* Parif needs to be reset to a free partition */
-		parif += BNXT_ULP_FREE_PARIF_BASE;
-	} else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) {
+	else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF)
 		idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF;
-		/* Parif needs to be reset to a free partition */
-		parif += BNXT_ULP_FREE_PARIF_BASE;
-	} else {
+	else
 		idx = BNXT_ULP_CF_IDX_VF_FUNC_PARIF;
-	}
 
 	ULP_COMP_FLD_IDX_WR(mapper_params, idx, parif);
 
drivers/net/bnxt/tf_ulp/ulp_mapper.c +35 -0
index 2d3373d..a071c07 100644
@@ -998,6 +998,41 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 			return -EINVAL;
 		}
 		break;
+	case BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF:
+		if (!ulp_operand_read(fld->result_operand,
+				      (uint8_t *)&idx,
+				      sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "%s key operand read failed.\n", name);
+			return -EINVAL;
+		}
+		idx = tfp_be_to_cpu_16(idx);
+		if (idx >= BNXT_ULP_CF_IDX_LAST) {
+			BNXT_TF_DBG(ERR, "%s invalid index %u\n", name, idx);
+			return -EINVAL;
+		}
+		/* check if the computed field is set */
+		if (ULP_COMP_FLD_IDX_RD(parms, idx))
+			val = fld->result_operand_true;
+		else
+			val = fld->result_operand_false;
+
+		/* read the appropriate computed field */
+		if (!ulp_operand_read(val, (uint8_t *)&idx, sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "%s val operand read failed\n", name);
+			return -EINVAL;
+		}
+		idx = tfp_be_to_cpu_16(idx);
+		if (idx >= BNXT_ULP_CF_IDX_LAST) {
+			BNXT_TF_DBG(ERR, "%s invalid index %u\n", name, idx);
+			return -EINVAL;
+		}
+		val = ulp_blob_push_32(blob, &parms->comp_fld[idx],
+				       fld->field_bit_size);
+		if (!val) {
+			BNXT_TF_DBG(ERR, "%s push to key blob failed\n", name);
+			return -EINVAL;
+		}
+		break;
 	default:
 		BNXT_TF_DBG(ERR, "invalid result mapper opcode 0x%x\n",
 			    fld->result_opcode);
drivers/net/bnxt/tf_ulp/ulp_port_db.c +2 -0
index 0fc7c0a..3087647 100644
@@ -372,6 +372,8 @@ ulp_port_db_parif_get(struct bnxt_ulp_context *ulp_ctxt,
 		phy_port_id = port_db->ulp_func_id_tbl[func_id].phy_port_id;
 		*parif = port_db->phy_port_list[phy_port_id].port_parif;
 	}
+	/* Parif needs to be reset to a free partition */
+	*parif += BNXT_ULP_FREE_PARIF_BASE;
 
 	return 0;
 }
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +43 -11

74 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +12 -4
index 31fe905..58b581c 100644
@@ -1808,11 +1808,19 @@ struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_CONST_ELSE_CONST,
 	.result_operand = {
-		BNXT_ULP_SYM_DECAP_FUNC_THRU_TUN,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 56) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 48) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 40) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 32) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 24) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 16) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 8) & 0xff,
+		(uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 12,
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +20 -5
index 9de45cd..330c5ec 100644
@@ -5058,7 +5058,9 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 2,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
 	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
 	.spec_operand = {0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
@@ -5149,7 +5151,9 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 2,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
 	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
 	.spec_operand = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
@@ -17054,11 +17058,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +8 -6
index c9fe1bc..f08065b 100644
@@ -127,11 +127,12 @@ enum bnxt_ulp_cf_idx {
 	BNXT_ULP_CF_IDX_ACT_PORT_IS_SET = 35,
 	BNXT_ULP_CF_IDX_ACT_PORT_TYPE = 36,
 	BNXT_ULP_CF_IDX_MATCH_PORT_TYPE = 37,
-	BNXT_ULP_CF_IDX_VF_TO_VF = 38,
-	BNXT_ULP_CF_IDX_L3_HDR_CNT = 39,
-	BNXT_ULP_CF_IDX_L4_HDR_CNT = 40,
-	BNXT_ULP_CF_IDX_VFR_MODE = 41,
-	BNXT_ULP_CF_IDX_LAST = 42
+	BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP = 38,
+	BNXT_ULP_CF_IDX_VF_TO_VF = 39,
+	BNXT_ULP_CF_IDX_L3_HDR_CNT = 40,
+	BNXT_ULP_CF_IDX_L4_HDR_CNT = 41,
+	BNXT_ULP_CF_IDX_VFR_MODE = 42,
+	BNXT_ULP_CF_IDX_LAST = 43
 };
 
 enum bnxt_ulp_cond_opcode {
@@ -215,7 +216,8 @@ enum bnxt_ulp_mapper_opc {
 	BNXT_ULP_MAPPER_OPC_SET_TO_ENCAP_ACT_PROP_SZ = 8,
 	BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_ACT_PROP_ELSE_CONST = 9,
 	BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_CONST_ELSE_CONST = 10,
-	BNXT_ULP_MAPPER_OPC_LAST = 11
+	BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF = 11,
+	BNXT_ULP_MAPPER_OPC_LAST = 12
 };
 
 enum bnxt_ulp_mark_db_opcode {
Signature · 1 line
2.7.4
#9 lore raw

PATCH 9/20 net/bnxt: ignore VLAN priority mask

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

This is a work around for the OVS setting offload rules that are passing vlan priority mask as wild card and currently we do not support it.

---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +9 -0
index 67f9319..a924769 100644
@@ -709,8 +709,17 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,
 			vlan_tag |= ~ULP_VLAN_TAG_MASK;
 		vlan_tag = htons(vlan_tag);
 
+#ifdef ULP_DONT_IGNORE_TOS
 		ulp_rte_prsr_mask_copy(params, &idx, &priority,
 				       sizeof(priority));
+#else
+		/*
+		 * The priortiy field is ignored since OVS is seting it as
+		 * wild card match and it is not supported. This is a work
+		 * around and shall be addressed in the future.
+		 */
+		idx += 1;
+#endif
 		ulp_rte_prsr_mask_copy(params, &idx, &vlan_tag,
 				       sizeof(vlan_tag));
 		ulp_rte_prsr_mask_copy(params, &idx, &vlan_mask->inner_type,
Signature · 1 line
2.7.4
#10 lore raw

PATCH 10/20 net/bnxt: add egress template with VLAN tag match

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

Added egress template with VLAN tag match

---
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c | 501 +++++++++++++++++++++++-
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h  |  28 +-
 2 files changed, 509 insertions(+), 20 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +483 -18
index 330c5ec..41d1d87 100644
@@ -162,7 +162,31 @@ uint16_t ulp_class_sig_tbl[BNXT_ULP_CLASS_SIG_TBL_MAX_SZ] = {
 	[BNXT_ULP_CLASS_HID_01d1] = 151,
 	[BNXT_ULP_CLASS_HID_0319] = 152,
 	[BNXT_ULP_CLASS_HID_01cd] = 153,
-	[BNXT_ULP_CLASS_HID_0305] = 154
+	[BNXT_ULP_CLASS_HID_0305] = 154,
+	[BNXT_ULP_CLASS_HID_01e2] = 155,
+	[BNXT_ULP_CLASS_HID_032a] = 156,
+	[BNXT_ULP_CLASS_HID_0650] = 157,
+	[BNXT_ULP_CLASS_HID_0198] = 158,
+	[BNXT_ULP_CLASS_HID_01de] = 159,
+	[BNXT_ULP_CLASS_HID_0316] = 160,
+	[BNXT_ULP_CLASS_HID_066c] = 161,
+	[BNXT_ULP_CLASS_HID_01a4] = 162,
+	[BNXT_ULP_CLASS_HID_01c2] = 163,
+	[BNXT_ULP_CLASS_HID_030a] = 164,
+	[BNXT_ULP_CLASS_HID_0670] = 165,
+	[BNXT_ULP_CLASS_HID_01b8] = 166,
+	[BNXT_ULP_CLASS_HID_003e] = 167,
+	[BNXT_ULP_CLASS_HID_02f6] = 168,
+	[BNXT_ULP_CLASS_HID_078c] = 169,
+	[BNXT_ULP_CLASS_HID_0044] = 170,
+	[BNXT_ULP_CLASS_HID_01d2] = 171,
+	[BNXT_ULP_CLASS_HID_031a] = 172,
+	[BNXT_ULP_CLASS_HID_0660] = 173,
+	[BNXT_ULP_CLASS_HID_01a8] = 174,
+	[BNXT_ULP_CLASS_HID_01ce] = 175,
+	[BNXT_ULP_CLASS_HID_0306] = 176,
+	[BNXT_ULP_CLASS_HID_067c] = 177,
+	[BNXT_ULP_CLASS_HID_01b4] = 178
 };
 
 struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
@@ -2833,6 +2857,382 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	.class_tid = 21,
 	.wc_pri = 11
+	},
+	[155] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01e2,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 12
+	},
+	[156] = {
+	.class_hid = BNXT_ULP_CLASS_HID_032a,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 13
+	},
+	[157] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0650,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 14
+	},
+	[158] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0198,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 15
+	},
+	[159] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01de,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 16
+	},
+	[160] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0316,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 17
+	},
+	[161] = {
+	.class_hid = BNXT_ULP_CLASS_HID_066c,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 18
+	},
+	[162] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01a4,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 19
+	},
+	[163] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01c2,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 20
+	},
+	[164] = {
+	.class_hid = BNXT_ULP_CLASS_HID_030a,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 21
+	},
+	[165] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0670,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 22
+	},
+	[166] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01b8,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 23
+	},
+	[167] = {
+	.class_hid = BNXT_ULP_CLASS_HID_003e,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 24
+	},
+	[168] = {
+	.class_hid = BNXT_ULP_CLASS_HID_02f6,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 25
+	},
+	[169] = {
+	.class_hid = BNXT_ULP_CLASS_HID_078c,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 26
+	},
+	[170] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0044,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 27
+	},
+	[171] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01d2,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 28
+	},
+	[172] = {
+	.class_hid = BNXT_ULP_CLASS_HID_031a,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 29
+	},
+	[173] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0660,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 30
+	},
+	[174] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01a8,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 31
+	},
+	[175] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01ce,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 32
+	},
+	[176] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0306,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 33
+	},
+	[177] = {
+	.class_hid = BNXT_ULP_CLASS_HID_067c,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 34
+	},
+	[178] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01b4,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 35
 	}
 };
 
@@ -3236,7 +3636,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
-	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
+	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -3255,7 +3655,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
-	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
+	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -3346,7 +3746,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
-	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
+	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -12534,8 +12934,18 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 12,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
-	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_HDR_FIELD,
+	.mask_operand = {
+		(BNXT_ULP_HF21_IDX_OO_VLAN_VID >> 8) & 0xff,
+		BNXT_ULP_HF21_IDX_OO_VLAN_VID & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_HDR_FIELD,
+	.spec_operand = {
+		(BNXT_ULP_HF21_IDX_OO_VLAN_VID >> 8) & 0xff,
+		BNXT_ULP_HF21_IDX_OO_VLAN_VID & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 12,
@@ -12594,8 +13004,15 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 2,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
-	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
+	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_COMP_FIELD,
+	.spec_operand = {
+		(BNXT_ULP_CF_IDX_O_VTAG_NUM >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_O_VTAG_NUM & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 2,
@@ -16307,11 +16724,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
@@ -16498,11 +16926,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
@@ -16689,7 +17128,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
+	.result_operand = {
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
@@ -16876,11 +17330,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +26 -2
index f08065b..ac651f6 100644
@@ -11,7 +11,7 @@
 #define BNXT_ULP_LOG2_MAX_NUM_DEV 2
 #define BNXT_ULP_CACHE_TBL_MAX_SZ 4
 #define BNXT_ULP_CLASS_SIG_TBL_MAX_SZ 2048
-#define BNXT_ULP_CLASS_MATCH_LIST_MAX_SZ 155
+#define BNXT_ULP_CLASS_MATCH_LIST_MAX_SZ 179
 #define BNXT_ULP_CLASS_HID_LOW_PRIME 7919
 #define BNXT_ULP_CLASS_HID_HIGH_PRIME 7907
 #define BNXT_ULP_CLASS_HID_SHFTR 32
@@ -781,7 +781,31 @@ enum bnxt_ulp_class_hid {
 	BNXT_ULP_CLASS_HID_01d1 = 0x01d1,
 	BNXT_ULP_CLASS_HID_0319 = 0x0319,
 	BNXT_ULP_CLASS_HID_01cd = 0x01cd,
-	BNXT_ULP_CLASS_HID_0305 = 0x0305
+	BNXT_ULP_CLASS_HID_0305 = 0x0305,
+	BNXT_ULP_CLASS_HID_01e2 = 0x01e2,
+	BNXT_ULP_CLASS_HID_032a = 0x032a,
+	BNXT_ULP_CLASS_HID_0650 = 0x0650,
+	BNXT_ULP_CLASS_HID_0198 = 0x0198,
+	BNXT_ULP_CLASS_HID_01de = 0x01de,
+	BNXT_ULP_CLASS_HID_0316 = 0x0316,
+	BNXT_ULP_CLASS_HID_066c = 0x066c,
+	BNXT_ULP_CLASS_HID_01a4 = 0x01a4,
+	BNXT_ULP_CLASS_HID_01c2 = 0x01c2,
+	BNXT_ULP_CLASS_HID_030a = 0x030a,
+	BNXT_ULP_CLASS_HID_0670 = 0x0670,
+	BNXT_ULP_CLASS_HID_01b8 = 0x01b8,
+	BNXT_ULP_CLASS_HID_003e = 0x003e,
+	BNXT_ULP_CLASS_HID_02f6 = 0x02f6,
+	BNXT_ULP_CLASS_HID_078c = 0x078c,
+	BNXT_ULP_CLASS_HID_0044 = 0x0044,
+	BNXT_ULP_CLASS_HID_01d2 = 0x01d2,
+	BNXT_ULP_CLASS_HID_031a = 0x031a,
+	BNXT_ULP_CLASS_HID_0660 = 0x0660,
+	BNXT_ULP_CLASS_HID_01a8 = 0x01a8,
+	BNXT_ULP_CLASS_HID_01ce = 0x01ce,
+	BNXT_ULP_CLASS_HID_0306 = 0x0306,
+	BNXT_ULP_CLASS_HID_067c = 0x067c,
+	BNXT_ULP_CLASS_HID_01b4 = 0x01b4
 };
 
 enum bnxt_ulp_act_hid {
Signature · 1 line
2.7.4
#11 lore raw

PATCH 11/20 net/bnxt: modify tf shadow tcam to use common tf hash

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Removed the hash calculation from tf_shadow_tcam in favor of using a new common implementation.

---
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 77 +------------------------------
 1 file changed, 2 insertions(+), 75 deletions(-)
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +2 -75
index 51aae4f..beaea03 100644
@@ -7,6 +7,7 @@
 #include "tf_util.h"
 #include "tfp.h"
 #include "tf_shadow_tcam.h"
+#include "tf_hash.h"
 
 /**
  * The implementation includes 3 tables per tcam table type.
@@ -164,74 +165,6 @@ struct tf_shadow_tcam_db {
 	struct tf_shadow_tcam_ctxt *ctxt[TF_TCAM_TBL_TYPE_MAX];
 };
 
-/* CRC polynomial 0xedb88320 */
-static const uint32_t tf_shadow_tcam_crc32tbl[] = {
-	0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
-	0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
-	0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
-	0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
-	0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
-	0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
-	0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
-	0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
-	0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
-	0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
-	0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
-	0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
-	0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
-	0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
-	0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
-	0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
-	0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
-	0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
-	0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
-	0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
-	0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
-	0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
-	0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
-	0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
-	0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
-	0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
-	0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
-	0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
-	0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
-	0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
-	0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
-	0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
-	0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
-	0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
-	0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
-	0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
-	0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
-	0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
-	0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
-	0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
-	0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
-	0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
-	0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
-	0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
-	0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
-	0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
-	0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
-	0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
-	0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
-	0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
-	0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
-	0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
-	0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
-	0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
-	0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
-	0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
-	0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
-	0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
-	0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
-	0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
-	0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
-	0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
-	0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
-	0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
-};
-
 /**
  * Returns the number of entries in the contexts shadow table.
  */
@@ -289,13 +222,7 @@ tf_shadow_tcam_res_cpy(struct tf_shadow_tcam_ctxt *ctxt,
 static uint32_t
 tf_shadow_tcam_crc32_calc(uint8_t *key, uint32_t len)
 {
-	uint32_t crc = ~0U;
-
-	while (len--)
-		crc = tf_shadow_tcam_crc32tbl[(crc ^ key[len]) & 0xff] ^
-			(crc >> 8);
-
-	return ~crc;
+	return tf_hash_calc_crc32(key, len);
 }
 
 /**
Signature · 1 line
2.7.4
#12 lore raw

PATCH 12/20 net/bnxt: added shadow table capability with search

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

- Added Index Table shadow tables for searching
- Added Search API to allow reuse of Table entries

---
 drivers/net/bnxt/tf_core/tf_core.c        |  66 ++-
 drivers/net/bnxt/tf_core/tf_core.h        |  79 ++-
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   2 +-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c  | 768 +++++++++++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.h  | 124 ++---
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c |   6 +
 drivers/net/bnxt/tf_core/tf_tbl.c         | 246 +++++++++-
 drivers/net/bnxt/tf_core/tf_tbl.h         |  22 +-
 drivers/net/bnxt/tf_core/tf_tcam.h        |   2 +-
 9 files changed, 1211 insertions(+), 104 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +65 -1
index ca3280b..0dbde1d 100644
@@ -75,7 +75,6 @@ tf_open_session(struct tf *tfp,
 	/* Session vs session client is decided in
 	 * tf_session_open_session()
 	 */
-	printf("TF_OPEN, %s\n", parms->ctrl_chan_name);
 	rc = tf_session_open_session(tfp, &oparms);
 	/* Logging handled by tf_session_open_session */
 	if (rc)
@@ -954,6 +953,71 @@ tf_alloc_tbl_entry(struct tf *tfp,
 }
 
 int
+tf_search_tbl_entry(struct tf *tfp,
+		    struct tf_search_tbl_entry_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+	struct tf_tbl_alloc_search_parms sparms;
+
+	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_alloc_search_tbl == NULL) {
+		rc = -EOPNOTSUPP;
+		TFP_DRV_LOG(ERR,
+			    "%s: Operation not supported, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	memset(&sparms, 0, sizeof(struct tf_tbl_alloc_search_parms));
+	sparms.dir = parms->dir;
+	sparms.type = parms->type;
+	sparms.result = parms->result;
+	sparms.result_sz_in_bytes = parms->result_sz_in_bytes;
+	sparms.alloc = parms->alloc;
+	sparms.tbl_scope_id = parms->tbl_scope_id;
+	rc = dev->ops->tf_dev_alloc_search_tbl(tfp, &sparms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: TBL allocation failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Return the outputs from the search */
+	parms->hit = sparms.hit;
+	parms->search_status = sparms.search_status;
+	parms->ref_cnt = sparms.ref_cnt;
+	parms->idx = sparms.idx;
+
+	return 0;
+}
+
+int
 tf_free_tbl_entry(struct tf *tfp,
 		  struct tf_free_tbl_entry_parms *parms)
 {
drivers/net/bnxt/tf_core/tf_core.h +76 -3

98 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device_p4.c +1 -1
index afb6098..fe8dec3 100644
@@ -126,7 +126,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_alloc_ext_tbl = tf_tbl_ext_alloc,
 	.tf_dev_free_tbl = tf_tbl_free,
 	.tf_dev_free_ext_tbl = tf_tbl_ext_free,
-	.tf_dev_alloc_search_tbl = NULL,
+	.tf_dev_alloc_search_tbl = tf_tbl_alloc_search,
 	.tf_dev_set_tbl = tf_tbl_set,
 	.tf_dev_set_ext_tbl = tf_tbl_ext_common_set,
 	.tf_dev_get_tbl = tf_tbl_get,
drivers/net/bnxt/tf_core/tf_shadow_tbl.c +746 -22

807 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tbl.h +70 -54

212 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tcam.c +6 -0
index beaea03..a0130d6 100644
@@ -373,6 +373,12 @@ tf_shadow_tcam_clear_hash_entry(struct tf_shadow_tcam_ctxt *ctxt,
 	case 3:
 		*bucket = TF_SHADOW_TCAM_BE2_MASK_CLEAR(*bucket);
 		break;
+	default:
+		/*
+		 * Since the BE_GET masks non-inclusive bits, this will not
+		 * happen.
+		 */
+		break;
 	}
 }
 
drivers/net/bnxt/tf_core/tf_tbl.c +234 -12

324 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tbl.h +12 -10
index f20e8d7..930fcc3 100644
@@ -144,29 +144,31 @@ struct tf_tbl_alloc_search_parms {
 	 */
 	uint32_t tbl_scope_id;
 	/**
-	 * [in] Enable search for matching entry. If the table type is
-	 * internal the shadow copy will be searched before
-	 * alloc. Session must be configured with shadow copy enabled.
-	 */
-	uint8_t search_enable;
-	/**
-	 * [in] Result data to search for (if search_enable)
+	 * [in] Result data to search for
 	 */
 	uint8_t *result;
 	/**
-	 * [in] Result data size in bytes (if search_enable)
+	 * [in] Result data size in bytes
 	 */
 	uint16_t result_sz_in_bytes;
 	/**
+	 * [in] Whether or not to allocate on MISS, 1 is allocate.
+	 */
+	uint8_t alloc;
+	/**
 	 * [out] If search_enable, set if matching entry found
 	 */
 	uint8_t hit;
 	/**
-	 * [out] Current ref count after allocation (if search_enable)
+	 * [out] The status of the search (REJECT, MISS, HIT)
+	 */
+	enum tf_search_status search_status;
+	/**
+	 * [out] Current ref count after allocation
 	 */
 	uint16_t ref_cnt;
 	/**
-	 * [out] Idx of allocated entry or found entry (if search_enable)
+	 * [out] Idx of allocated entry or found entry
 	 */
 	uint32_t idx;
 };
drivers/net/bnxt/tf_core/tf_tcam.h +1 -1
index 4722ce0..ffa0a94 100644
@@ -134,7 +134,7 @@ struct tf_tcam_alloc_search_parms {
 	/**
 	 * [out] Search result status (hit, miss, reject)
 	 */
-	enum tf_tcam_search_status search_status;
+	enum tf_search_status search_status;
 	/**
 	 * [out] Current refcnt after allocation
 	 */
Signature · 1 line
2.7.4
#13 lore raw

PATCH 13/20 net/bnxt: ulp mapper changes to use tbl search

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

modified ulp mappper to use the new tf_search_tbl_entry API. When search before allocation is requested, mapper calls tc_search_tbl_entry with the alloc flag.

- On HIT, the result and table index is returned.
- On MISS, the table index is returned but the result is created and the table entry is set.
- On REJECT, the flow request is rejected.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c | 75 ++++++++++++++++++++++++------------
 1 file changed, 51 insertions(+), 24 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +51 -24
index a071c07..4dee659 100644
@@ -1764,9 +1764,10 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	struct ulp_blob	data;
 	uint64_t idx = 0;
 	uint16_t tmplen;
-	uint32_t i, num_flds;
+	uint32_t i, num_flds, index, hit;
 	int32_t rc = 0, trc = 0;
 	struct tf_alloc_tbl_entry_parms	aparms = { 0 };
+	struct tf_search_tbl_entry_parms srchparms = { 0 };
 	struct tf_set_tbl_entry_parms	sparms = { 0 };
 	struct tf_free_tbl_entry_parms	free_parms = { 0 };
 	uint32_t tbl_scope_id;
@@ -1868,33 +1869,59 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		return 0; /* success */
 	}
 
+	index = 0;
+	hit = 0;
 	/* Perform the tf table allocation by filling the alloc params */
-	aparms.dir		= tbl->direction;
-	aparms.type		= tbl->resource_type;
-	aparms.search_enable	= tbl->srch_b4_alloc;
-	aparms.result		= ulp_blob_data_get(&data, &tmplen);
-	aparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
-	aparms.tbl_scope_id	= tbl_scope_id;
-
-	/* All failures after the alloc succeeds require a free */
-	rc = tf_alloc_tbl_entry(tfp, &aparms);
-	if (rc) {
-		BNXT_TF_DBG(ERR, "Alloc table[%d][%s] failed rc=%d\n",
-			    aparms.type,
-			    (aparms.dir == TF_DIR_RX) ? "RX" : "TX",
-			    rc);
-		return rc;
-	}
+	if (tbl->srch_b4_alloc) {
+		memset(&srchparms, 0, sizeof(srchparms));
+		srchparms.dir = tbl->direction;
+		srchparms.type = tbl->resource_type;
+		srchparms.alloc	= 1;
+		srchparms.result = ulp_blob_data_get(&data, &tmplen);
+		srchparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
+		srchparms.tbl_scope_id = tbl_scope_id;
+		rc = tf_search_tbl_entry(tfp, &srchparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Alloc table[%s][%s] failed rc=%d\n",
+				    tf_tbl_type_2_str(tbl->resource_type),
+				    tf_dir_2_str(tbl->direction), rc);
+			return rc;
+		}
+		if (srchparms.search_status == REJECT) {
+			BNXT_TF_DBG(ERR, "Alloc table[%s][%s] rejected.\n",
+				    tf_tbl_type_2_str(tbl->resource_type),
+				    tf_dir_2_str(tbl->direction));
+			return -ENOMEM;
+		}
+		index = srchparms.idx;
+		hit = srchparms.hit;
+	} else {
+		aparms.dir		= tbl->direction;
+		aparms.type		= tbl->resource_type;
+		aparms.search_enable	= tbl->srch_b4_alloc;
+		aparms.result		= ulp_blob_data_get(&data, &tmplen);
+		aparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
+		aparms.tbl_scope_id	= tbl_scope_id;
 
+		/* All failures after the alloc succeeds require a free */
+		rc = tf_alloc_tbl_entry(tfp, &aparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Alloc table[%s][%s] failed rc=%d\n",
+				    tf_tbl_type_2_str(tbl->resource_type),
+				    tf_dir_2_str(tbl->direction), rc);
+			return rc;
+		}
+		index = aparms.idx;
+	}
 	/*
 	 * calculate the idx for the result record, for external EM the offset
 	 * needs to be shifted accordingly. If external non-inline table types
 	 * are used then need to revisit this logic.
 	 */
-	if (aparms.type == TF_TBL_TYPE_EXT)
-		idx = TF_ACT_REC_OFFSET_2_PTR(aparms.idx);
+	if (tbl->resource_type == TF_TBL_TYPE_EXT)
+		idx = TF_ACT_REC_OFFSET_2_PTR(index);
 	else
-		idx = aparms.idx;
+		idx = index;
 
 	/* Always storing values in Regfile in BE */
 	idx = tfp_cpu_to_be_64(idx);
@@ -1908,12 +1935,12 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	}
 
 	/* Perform the tf table set by filling the set params */
-	if (!tbl->srch_b4_alloc || !aparms.hit) {
+	if (!tbl->srch_b4_alloc || !hit) {
 		sparms.dir		= tbl->direction;
 		sparms.type		= tbl->resource_type;
 		sparms.data		= ulp_blob_data_get(&data, &tmplen);
 		sparms.data_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
-		sparms.idx		= aparms.idx;
+		sparms.idx		= index;
 		sparms.tbl_scope_id	= tbl_scope_id;
 
 		rc = tf_set_tbl_entry(tfp, &sparms);
@@ -1933,7 +1960,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	fid_parms.resource_func	= tbl->resource_func;
 	fid_parms.resource_type	= tbl->resource_type;
 	fid_parms.resource_sub_type = tbl->resource_sub_type;
-	fid_parms.resource_hndl	= aparms.idx;
+	fid_parms.resource_hndl	= index;
 	fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
 
 	rc = ulp_flow_db_resource_add(parms->ulp_ctx,
@@ -1960,7 +1987,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	 */
 	free_parms.dir	= tbl->direction;
 	free_parms.type	= tbl->resource_type;
-	free_parms.idx	= aparms.idx;
+	free_parms.idx	= index;
 	free_parms.tbl_scope_id = tbl_scope_id;
 
 	trc = tf_free_tbl_entry(tfp, &free_parms);
Signature · 1 line
2.7.4
#14 lore raw

PATCH 14/20 net/bnxt: fix port default rule create and destroy

In reply to Somnath Kotur

From: Venkat Duvvuru <[email protected]>

Currently, the flow_ids of port_to_app/app_to_port & tx_cfa_action for the first port are getting over-written by the second port because these fields are stored in the ulp context which is common across the ports.

This patch fixes the problem by having per port structure to store these fields.

Fixes 9f702636d7ba ("net/bnxt: add port default rules for ingress and egress")
---
 drivers/net/bnxt/bnxt.h                 |   5 +-
 drivers/net/bnxt/bnxt_ethdev.c          |  81 ++--------------------
 drivers/net/bnxt/bnxt_txq.h             |   1 -
 drivers/net/bnxt/bnxt_txr.c             |   6 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c      |  12 +++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h      |  14 +++-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 116 ++++++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c   |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h   |   2 +-
 9 files changed, 151 insertions(+), 88 deletions(-)
drivers/net/bnxt/bnxt.h +4 -1
index 50f93ff..41e7ae5 100644
@@ -784,6 +784,7 @@ struct bnxt {
 	struct bnxt_flow_stat_info *flow_stat;
 	uint8_t			flow_xstat;
 	uint16_t		max_num_kflows;
+	uint16_t		tx_cfa_action;
 };
 
 #define BNXT_FC_TIMER	1 /* Timer freq in Sec Flow Counters */
@@ -797,7 +798,7 @@ struct bnxt_vf_representor {
 	uint16_t		fw_fid;
 	uint16_t		dflt_vnic_id;
 	uint16_t		svif;
-	uint32_t		vfr_tx_cfa_action;
+	uint16_t		vfr_tx_cfa_action;
 	uint16_t		rx_cfa_code;
 	uint32_t		rep2vf_flow_id;
 	uint32_t		vf2rep_flow_id;
@@ -872,6 +873,8 @@ extern int bnxt_logtype_driver;
 extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;
 int32_t bnxt_ulp_init(struct bnxt *bp);
 void bnxt_ulp_deinit(struct bnxt *bp);
+int32_t bnxt_ulp_create_df_rules(struct bnxt *bp);
+void bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global);
 
 uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
 uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif,
drivers/net/bnxt/bnxt_ethdev.c +5 -76

111 lines not on this page · raw message

drivers/net/bnxt/bnxt_txq.h +0 -1
index a1ab3f3..83a9853 100644
@@ -29,7 +29,6 @@ struct bnxt_tx_queue {
 	struct bnxt		*bp;
 	int			index;
 	int			tx_wake_thresh;
-	uint32_t                tx_cfa_action;
 	uint32_t		vfr_tx_cfa_action;
 	struct bnxt_tx_ring_info	*tx_ring;
 
drivers/net/bnxt/bnxt_txr.c +2 -4
index c741c71..1113aca 100644
@@ -133,8 +133,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 				PKT_TX_TUNNEL_GENEVE | PKT_TX_IEEE1588_TMST |
 				PKT_TX_QINQ_PKT) ||
 	     (BNXT_TRUFLOW_EN(txq->bp) &&
-	      (txq->bp->ulp_ctx->cfg_data->tx_cfa_action ||
-	       txq->vfr_tx_cfa_action)))
+	      (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action)))
 		long_bd = true;
 
 	nr_bds = long_bd + tx_pkt->nb_segs;
@@ -192,8 +191,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 			if (txq->vfr_tx_cfa_action)
 				cfa_action = txq->vfr_tx_cfa_action;
 			else
-				cfa_action =
-				      txq->bp->ulp_ctx->cfg_data->tx_cfa_action;
+				cfa_action = txq->bp->tx_cfa_action;
 		}
 
 		/* HW can accelerate only outer vlan in QinQ mode */
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +11 -1
index 7c65a4b..2febd58 100644
@@ -9,9 +9,9 @@
 #include <rte_flow_driver.h>
 #include <rte_tailq.h>
 
+#include "bnxt.h"
 #include "bnxt_ulp.h"
 #include "bnxt_tf_common.h"
-#include "bnxt.h"
 #include "tf_core.h"
 #include "tf_ext_flow_handle.h"
 
@@ -381,6 +381,7 @@ ulp_ctx_init(struct bnxt *bp,
 		(void)ulp_ctx_deinit(bp, session);
 		return rc;
 	}
+
 	bnxt_ulp_cntxt_tfp_set(bp->ulp_ctx, session->g_tfp);
 	return rc;
 }
@@ -654,6 +655,9 @@ bnxt_ulp_init(struct bnxt *bp)
 	bool init;
 	int rc;
 
+	if (!BNXT_TRUFLOW_EN(bp))
+		return 0;
+
 	if (bp->ulp_ctx) {
 		BNXT_TF_DBG(DEBUG, "ulp ctx already allocated\n");
 		return -EINVAL;
@@ -822,6 +826,9 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	struct rte_pci_device		*pci_dev;
 	struct rte_pci_addr		*pci_addr;
 
+	if (!BNXT_TRUFLOW_EN(bp))
+		return;
+
 	/* Get the session first */
 	pci_dev = RTE_DEV_TO_PCI(bp->eth_dev->device);
 	pci_addr = &pci_dev->addr;
@@ -833,6 +840,9 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	if (!session)
 		return;
 
+	/* clean up default flows */
+	bnxt_ulp_destroy_df_rules(bp, true);
+
 	/* clean up regular flows */
 	ulp_flow_db_flush_flows(bp->ulp_ctx, BNXT_ULP_REGULAR_FLOW_TABLE);
 
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +11 -3
index 7c95ead..d532452 100644
@@ -22,6 +22,12 @@
 #define BNXT_ULP_VF_REP_ENABLED		0x1
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
 
+struct bnxt_ulp_df_rule_info {
+	uint32_t			port_to_app_flow_id;
+	uint32_t			app_to_port_flow_id;
+	uint8_t				valid;
+};
+
 struct bnxt_ulp_data {
 	uint32_t			tbl_scope_id;
 	struct bnxt_ulp_mark_tbl	*mark_tbl;
@@ -32,9 +38,7 @@ struct bnxt_ulp_data {
 	struct bnxt_ulp_port_db		*port_db;
 	struct bnxt_ulp_fc_info		*fc_info;
 	uint32_t			ulp_flags;
-	uint32_t			port_to_app_flow_id;
-	uint32_t			app_to_port_flow_id;
-	uint32_t			tx_cfa_action;
+	struct bnxt_ulp_df_rule_info   df_rule_info[RTE_MAX_ETHPORTS];
 };
 
 struct bnxt_ulp_context {
@@ -175,4 +179,8 @@ int32_t
 bnxt_ulp_cntxt_ptr2_ulp_flags_get(struct bnxt_ulp_context *ulp_ctx,
 				  uint32_t *flags);
 
+int32_t
+bnxt_ulp_get_df_rule_info(uint8_t port_id, struct bnxt_ulp_context *ulp_ctx,
+			  struct bnxt_ulp_df_rule_info *info);
+
 #endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +116 -0

119 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_flow_db.c +1 -1
index a3cfe54..7144517 100644
@@ -962,7 +962,7 @@ ulp_flow_db_resource_hndl_get(struct bnxt_ulp_context *ulp_ctx,
 int32_t
 ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
 				   uint32_t flow_id,
-				   uint32_t *cfa_action)
+				   uint16_t *cfa_action)
 {
 	uint8_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_VFR_CFA_ACTION;
 	uint64_t hndl;
drivers/net/bnxt/tf_ulp/ulp_flow_db.h +1 -1
index 1fc0601..117e250 100644
@@ -234,7 +234,7 @@ ulp_flow_db_validate_flow_func(struct bnxt_ulp_context *ulp_ctx,
 int32_t
 ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
 				   uint32_t flow_id,
-				   uint32_t *cfa_action);
+				   uint16_t *cfa_action);
 
 #ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
 /*
Signature · 1 line
2.7.4
#15 lore raw

PATCH 15/20 net/bnxt: delete VF FW rules when a representor is created

In reply to Somnath Kotur

From: Venkat Duvvuru <[email protected]>

Truflow stack adds VFR to VF and VF to VFR conduits when VF representor is created. However, in the ingress direction the VF's fw rules conflict with Truflow rules, resulting in not hitting the Truflow VFR rules. To fix this, fw is going to remove it’s VF rules when vf representor is created in Truflow mode and will restore the removed rules when vf representor is destroyed.

This patch invokes the vf representor alloc and free hwrm commands as part of which fw will do the above mentioned actions.

---
 drivers/net/bnxt/bnxt_hwrm.c           |  49 ++++++++++++
 drivers/net/bnxt/bnxt_hwrm.h           |   2 +
 drivers/net/bnxt/bnxt_reps.c           |  19 ++++-
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 138 +++++++++++++++++++++++++++++++++
 4 files changed, 205 insertions(+), 3 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +49 -0
index 7ea13a8..f5f0dfe 100644
@@ -5486,6 +5486,55 @@ int bnxt_hwrm_cfa_counter_qstats(struct bnxt *bp,
 	return 0;
 }
 
+int bnxt_hwrm_cfa_vfr_alloc(struct bnxt *bp, uint16_t vf_idx)
+{
+	struct hwrm_cfa_vfr_alloc_output *resp = bp->hwrm_cmd_resp_addr;
+	struct hwrm_cfa_vfr_alloc_input req = {0};
+	int rc;
+
+	if (!(BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))) {
+		PMD_DRV_LOG(DEBUG,
+			    "Not a PF or trusted VF. Command not supported\n");
+		return 0;
+	}
+
+	HWRM_PREP(&req, HWRM_CFA_VFR_ALLOC, BNXT_USE_CHIMP_MB);
+	req.vf_id = rte_cpu_to_le_16(vf_idx);
+	snprintf(req.vfr_name, sizeof(req.vfr_name), "%svfr%d",
+		 bp->eth_dev->data->name, vf_idx);
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+	HWRM_CHECK_RESULT();
+
+	HWRM_UNLOCK();
+	PMD_DRV_LOG(DEBUG, "VFR %d allocated\n", vf_idx);
+	return rc;
+}
+
+int bnxt_hwrm_cfa_vfr_free(struct bnxt *bp, uint16_t vf_idx)
+{
+	struct hwrm_cfa_vfr_free_output *resp = bp->hwrm_cmd_resp_addr;
+	struct hwrm_cfa_vfr_free_input req = {0};
+	int rc;
+
+	if (!(BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))) {
+		PMD_DRV_LOG(DEBUG,
+			    "Not a PF or trusted VF. Command not supported\n");
+		return 0;
+	}
+
+	HWRM_PREP(&req, HWRM_CFA_VFR_FREE, BNXT_USE_CHIMP_MB);
+	req.vf_id = rte_cpu_to_le_16(vf_idx);
+	snprintf(req.vfr_name, sizeof(req.vfr_name), "%svfr%d",
+		 bp->eth_dev->data->name, vf_idx);
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+	HWRM_CHECK_RESULT();
+	HWRM_UNLOCK();
+	PMD_DRV_LOG(DEBUG, "VFR %d freed\n", vf_idx);
+	return rc;
+}
+
 #ifdef RTE_LIBRTE_BNXT_PMD_SYSTEM
 int
 bnxt_hwrm_oem_cmd(struct bnxt *bp, uint32_t entry_num)
drivers/net/bnxt/bnxt_hwrm.h +2 -0
index 01201a7..4a2af13 100644
@@ -278,4 +278,6 @@ int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp);
 int bnxt_hwrm_oem_cmd(struct bnxt *bp, uint32_t entry_num);
 int bnxt_clear_one_vnic_filter(struct bnxt *bp,
 			       struct bnxt_filter_info *filter);
+int bnxt_hwrm_cfa_vfr_alloc(struct bnxt *bp, uint16_t vf_idx);
+int bnxt_hwrm_cfa_vfr_free(struct bnxt *bp, uint16_t vf_idx);
 #endif
drivers/net/bnxt/bnxt_reps.c +16 -3
index c425e69..2f775e0 100644
@@ -272,7 +272,7 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 	if (rc) {
 		BNXT_TF_DBG(DEBUG,
 			    "Default flow rule creation for VFR->VF failed!\n");
-		return -EIO;
+		goto err;
 	}
 
 	BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VFR->VF! ***\n");
@@ -283,7 +283,7 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 	if (rc) {
 		BNXT_TF_DBG(DEBUG,
 			    "Failed to get action_ptr for VFR->VF dflt rule\n");
-		return -EIO;
+		goto rep2vf_free;
 	}
 	BNXT_TF_DBG(DEBUG, "tx_cfa_action = %d\n", vfr->vfr_tx_cfa_action);
 	rc = ulp_default_flow_create(parent_dev, param_list,
@@ -292,13 +292,24 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 	if (rc) {
 		BNXT_TF_DBG(DEBUG,
 			    "Default flow rule creation for VF->VFR failed!\n");
-		return -EIO;
+		goto rep2vf_free;
 	}
 
 	BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VF->VFR! ***\n");
 	BNXT_TF_DBG(DEBUG, "vfr2rep_flow_id = %d\n", vfr->vf2rep_flow_id);
 
+	rc = bnxt_hwrm_cfa_vfr_alloc(parent_bp, vfr->vf_id);
+	if (rc)
+		goto vf2rep_free;
+
 	return 0;
+
+vf2rep_free:
+	ulp_default_flow_destroy(vfr->parent_dev, vfr->vf2rep_flow_id);
+rep2vf_free:
+	ulp_default_flow_destroy(vfr->parent_dev, vfr->rep2vf_flow_id);
+err:
+	return -EIO;
 }
 
 static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
@@ -414,6 +425,8 @@ static int bnxt_vfr_free(struct bnxt_vf_representor *vfr)
 	vfr->vfr_tx_cfa_action = 0;
 	vfr->rx_cfa_code = 0;
 
+	rc = bnxt_hwrm_cfa_vfr_free(parent_bp, vfr->vf_id);
+
 	return rc;
 }
 
drivers/net/bnxt/hsi_struct_def_dpdk.h +138 -0

144 lines not on this page · raw message

Signature · 1 line
2.7.4
#16 lore raw

PATCH 16/20 net/bnxt: shadow tcam and tbl reference count modification

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Moved setting the refcnt for shadow tcam and table entries to the allocation path only. The insert can be called multiple times for updates and was resetting the refcnt to 1 each time. Now multiple insertion/modifications will not change the reference count.

---
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c  | 2 --
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/bnxt/tf_core/tf_shadow_tbl.c +0 -2
index 019a26e..a4207eb 100644
@@ -687,8 +687,6 @@ tf_shadow_tbl_insert(struct tf_shadow_tbl_insert_parms *parms)
 	if (!TF_SHADOW_HB_HANDLE_IS_VALID(sr_entry->hb_handle))
 		return 0;
 
-	sr_entry->refcnt = 1;
-
 	return 0;
 }
 
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +1 -1
index a0130d6..e2c347a 100644
@@ -472,6 +472,7 @@ tf_shadow_tcam_bind_index(struct tf_shadow_tcam_bind_index_parms *parms)
 	/* Write the result table */
 	sr_entry->key_size = parms->key_size;
 	sr_entry->hb_handle = parms->hb_handle;
+	sr_entry->refcnt = 1;
 
 	return 0;
 }
@@ -738,7 +739,6 @@ tf_shadow_tcam_insert(struct tf_shadow_tcam_insert_parms *parms)
 
 	memcpy(sr_entry->result, sparms->result, sparms->result_size);
 	sr_entry->result_size = sparms->result_size;
-	sr_entry->refcnt = 1;
 
 	return 0;
 }
Signature · 1 line
2.7.4
#17 lore raw

PATCH 17/20 net/bnxt: tcam table processing support for search and alloc

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

Added support for tcam table processing to enable the search and allocate support. This also includes the tcam entry update support.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c           | 317 ++++++++++++++++---------
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h |   5 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h  |   8 +-
 3 files changed, 213 insertions(+), 117 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +206 -111
index 4dee659..6ac4b0f 100644
@@ -1317,20 +1317,177 @@ ulp_mapper_mark_vfr_idx_process(struct bnxt_ulp_mapper_parms *parms,
 	return rc;
 }
 
+/*
+ * Tcam table - create the result blob.
+ * data [out] - the result blob data
+ */
+static int32_t
+ulp_mapper_tcam_tbl_result_create(struct bnxt_ulp_mapper_parms *parms,
+				  struct bnxt_ulp_mapper_tbl_info *tbl,
+				  struct ulp_blob *data)
+{
+	struct bnxt_ulp_mapper_result_field_info *dflds;
+	uint32_t num_dflds;
+	uint32_t encap_flds = 0;
+	uint32_t i;
+	int32_t rc = 0;
+
+	/* Create the result data blob */
+	dflds = ulp_mapper_result_fields_get(tbl, &num_dflds,
+					     &encap_flds);
+	if (!dflds || !num_dflds || encap_flds) {
+		BNXT_TF_DBG(ERR, "Failed to get data fields.\n");
+		return -EINVAL;
+	}
+
+	for (i = 0; i < num_dflds; i++) {
+		rc = ulp_mapper_result_field_process(parms,
+						     tbl->direction,
+						     &dflds[i],
+						     data,
+						     "TCAM Result");
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Failed to set data fields\n");
+			return -EINVAL;
+		}
+	}
+	return rc;
+}
+
+/* Tcam table scan the identifier list and allocate each identifier */
+static int32_t
+ulp_mapper_tcam_tbl_scan_ident_alloc(struct bnxt_ulp_mapper_parms *parms,
+				     struct bnxt_ulp_mapper_tbl_info *tbl)
+{
+	struct bnxt_ulp_mapper_ident_info *idents;
+	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(tbl, &num_idents);
+
+		for (i = 0; i < num_idents; i++) {
+			if (ulp_mapper_ident_process(parms, tbl,
+						     &idents[i], NULL))
+				return -EINVAL;
+		}
+	}
+	return 0;
+}
+
+/*
+ * Tcam table scan the identifier list and extract the identifier from
+ * the result blob.
+ */
+static int32_t
+ulp_mapper_tcam_tbl_scan_ident_extract(struct bnxt_ulp_mapper_parms *parms,
+				       struct bnxt_ulp_mapper_tbl_info *tbl,
+				       struct ulp_blob *data)
+{
+	struct bnxt_ulp_mapper_ident_info *idents;
+	uint32_t num_idents = 0, i;
+	int32_t rc = 0;
+
+	/*
+	 * Extract the listed identifiers from the result field,
+	 * no need to allocate them.
+	 */
+	idents = ulp_mapper_ident_fields_get(tbl, &num_idents);
+	for (i = 0; i < num_idents; i++) {
+		rc = ulp_mapper_ident_extract(parms, tbl, &idents[i], data);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Error in identifier extraction\n");
+			return rc;
+		}
+	}
+	return rc;
+}
+
+/* Internal function to write the tcam entry */
+static int32_t
+ulp_mapper_tcam_tbl_entry_write(struct bnxt_ulp_mapper_parms *parms,
+				struct bnxt_ulp_mapper_tbl_info *tbl,
+				struct ulp_blob *key,
+				struct ulp_blob *mask,
+				struct ulp_blob *data,
+				uint16_t idx)
+{
+	struct tf_set_tcam_entry_parms sparms = { 0 };
+	struct tf *tfp;
+	uint16_t tmplen;
+	int32_t rc;
+
+	tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
+	if (!tfp) {
+		BNXT_TF_DBG(ERR, "Failed to get truflow pointer\n");
+		return -EINVAL;
+	}
+
+	sparms.dir		= tbl->direction;
+	sparms.tcam_tbl_type	= tbl->resource_type;
+	sparms.idx		= idx;
+	/* Already verified the key/mask lengths */
+	sparms.key		= ulp_blob_data_get(key, &tmplen);
+	sparms.mask		= ulp_blob_data_get(mask, &tmplen);
+	sparms.key_sz_in_bits	= tbl->key_bit_size;
+	sparms.result		= ulp_blob_data_get(data, &tmplen);
+
+	if (tbl->result_bit_size != tmplen) {
+		BNXT_TF_DBG(ERR, "Result len (%d) != Expected (%d)\n",
+			    tmplen, tbl->result_bit_size);
+		return -EINVAL;
+	}
+	sparms.result_sz_in_bits = tbl->result_bit_size;
+	if (tf_set_tcam_entry(tfp, &sparms)) {
+		BNXT_TF_DBG(ERR, "tcam[%s][%s][%x] write failed.\n",
+			    tf_tcam_tbl_2_str(sparms.tcam_tbl_type),
+			    tf_dir_2_str(sparms.dir), sparms.idx);
+		return -EIO;
+	}
+	BNXT_TF_DBG(INFO, "tcam[%s][%s][%x] write success.\n",
+		    tf_tcam_tbl_2_str(sparms.tcam_tbl_type),
+		    tf_dir_2_str(sparms.dir), sparms.idx);
+
+	/* Update cache with TCAM index if the was cache allocated. */
+	if (parms->tcam_tbl_opc ==
+	    BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC) {
+		if (!parms->cache_ptr) {
+			BNXT_TF_DBG(ERR, "Unable to update cache");
+			return -EINVAL;
+		}
+		parms->cache_ptr->tcam_idx = idx;
+	}
+
+	/* Mark action */
+	rc = ulp_mapper_mark_act_ptr_process(parms, tbl);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "failed mark action processing\n");
+		return rc;
+	}
+
+	return rc;
+}
+
 static int32_t
 ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 			    struct bnxt_ulp_mapper_tbl_info *tbl)
 {
 	struct bnxt_ulp_mapper_class_key_field_info	*kflds;
-	struct ulp_blob key, mask, data;
+	struct ulp_blob key, mask, data, update_data;
 	uint32_t i, num_kflds;
 	struct tf *tfp;
 	int32_t rc, trc;
 	struct tf_alloc_tcam_entry_parms aparms		= { 0 };
 	struct tf_search_tcam_entry_parms searchparms   = { 0 };
-	struct tf_set_tcam_entry_parms sparms		= { 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;
@@ -1358,6 +1515,8 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	    !ulp_blob_init(&mask, tbl->key_bit_size,
 			   parms->device_params->byte_order) ||
 	    !ulp_blob_init(&data, tbl->result_bit_size,
+			   parms->device_params->byte_order) ||
+	    !ulp_blob_init(&update_data, tbl->result_bit_size,
 			   parms->device_params->byte_order)) {
 		BNXT_TF_DBG(ERR, "blob inits failed.\n");
 		return -EINVAL;
@@ -1388,7 +1547,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 	}
 
-	if (!tbl->srch_b4_alloc) {
+	if (tbl->srch_b4_alloc == BNXT_ULP_SEARCH_BEFORE_ALLOC_NO) {
 		/*
 		 * No search for re-use is requested, so simply allocate the
 		 * tcam index.
@@ -1455,113 +1614,49 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		hit = searchparms.hit;
 	}
 
-	/* Build the result */
-	if (!tbl->srch_b4_alloc || !hit) {
-		struct bnxt_ulp_mapper_result_field_info *dflds;
-		struct bnxt_ulp_mapper_ident_info *idents;
-		uint32_t num_dflds, num_idents;
-		uint32_t encap_flds = 0;
-
-		/*
-		 * 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(tbl, &num_idents);
-
-			for (i = 0; i < num_idents; i++) {
-				rc = ulp_mapper_ident_process(parms, tbl,
-							      &idents[i], NULL);
-				/* Already logged the error, just return */
-				if (rc)
-					goto error;
-			}
-		}
-
-		/* Create the result data blob */
-		dflds = ulp_mapper_result_fields_get(tbl, &num_dflds,
-						     &encap_flds);
-		if (!dflds || !num_dflds || encap_flds) {
-			BNXT_TF_DBG(ERR, "Failed to get data fields.\n");
-			rc = -EINVAL;
-			goto error;
-		}
-
-		for (i = 0; i < num_dflds; i++) {
-			rc = ulp_mapper_result_field_process(parms,
-							     tbl->direction,
-							     &dflds[i],
-							     &data,
-							     "TCAM Result");
-			if (rc) {
-				BNXT_TF_DBG(ERR, "Failed to set data fields\n");
-				goto error;
-			}
-		}
-
-		sparms.dir		= tbl->direction;
-		sparms.tcam_tbl_type	= tbl->resource_type;
-		sparms.idx		= idx;
-		/* Already verified the key/mask lengths */
-		sparms.key		= ulp_blob_data_get(&key, &tmplen);
-		sparms.mask		= ulp_blob_data_get(&mask, &tmplen);
-		sparms.key_sz_in_bits	= tbl->key_bit_size;
-		sparms.result		= ulp_blob_data_get(&data, &tmplen);
-
-		if (tbl->result_bit_size != tmplen) {
-			BNXT_TF_DBG(ERR, "Result len (%d) != Expected (%d)\n",
-				    tmplen, tbl->result_bit_size);
-			rc = -EINVAL;
-			goto error;
-		}
-		sparms.result_sz_in_bits = tbl->result_bit_size;
-
-		rc = tf_set_tcam_entry(tfp, &sparms);
-		if (rc) {
-			BNXT_TF_DBG(ERR, "tcam[%d][%s][%d] write failed.\n",
-				    sparms.tcam_tbl_type,
-				    (sparms.dir == TF_DIR_RX) ? "RX" : "TX",
-				    sparms.idx);
-			goto error;
-		}
-
-		/* Update cache with TCAM index if the was cache allocated. */
-		if (parms->tcam_tbl_opc ==
-		    BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC) {
-			if (!parms->cache_ptr) {
-				BNXT_TF_DBG(ERR, "Unable to update cache");
-				rc = -EINVAL;
-				goto error;
-			}
-			parms->cache_ptr->tcam_idx = idx;
-		}
-
-		/* Mark action */
-		rc = ulp_mapper_mark_act_ptr_process(parms, tbl);
-		if (rc)
-			goto error;
-
-	} else {
-		struct bnxt_ulp_mapper_ident_info *idents;
-		uint32_t num_idents;
-
-		/*
-		 * Extract the listed identifiers from the result field,
-		 * no need to allocate them.
-		 */
-		idents = ulp_mapper_ident_fields_get(tbl, &num_idents);
-		for (i = 0; i < num_idents; i++) {
-			rc = ulp_mapper_ident_extract(parms, tbl,
-						      &idents[i], &data);
-			if (rc) {
-				BNXT_TF_DBG(ERR,
-					    "Error in ident extraction\n");
-				goto error;
-			}
-		}
+	/* 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;
+
+	switch (search_flag) {
+	case BNXT_ULP_SEARCH_BEFORE_ALLOC_NO:
+		/*Scan identifier list, allocate identifier and update regfile*/
+		rc = ulp_mapper_tcam_tbl_scan_ident_alloc(parms, tbl);
+		/* Create the result blob */
+		if (!rc)
+			rc = ulp_mapper_tcam_tbl_result_create(parms, tbl,
+							       &data);
+		/* write the tcam entry */
+		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:
+		/*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
@@ -1598,11 +1693,11 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	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			= aparms.idx;
+	free_parms.idx			= idx;
 	trc = tf_free_tcam_entry(tfp, &free_parms);
 	if (trc)
 		BNXT_TF_DBG(ERR, "Failed to free tcam[%d][%d][%d] on failure\n",
-			    tbl->resource_type, tbl->direction, aparms.idx);
+			    tbl->resource_type, tbl->direction, idx);
 
 	return rc;
 }
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +3 -2
index ac651f6..9855918 100644
@@ -271,8 +271,9 @@ enum bnxt_ulp_regfile_index {
 
 enum bnxt_ulp_search_before_alloc {
 	BNXT_ULP_SEARCH_BEFORE_ALLOC_NO = 0,
-	BNXT_ULP_SEARCH_BEFORE_ALLOC_YES = 1,
-	BNXT_ULP_SEARCH_BEFORE_ALLOC_LAST = 2
+	BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP = 1,
+	BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_UPDATE = 2,
+	BNXT_ULP_SEARCH_BEFORE_ALLOC_LAST = 3
 };
 
 enum bnxt_ulp_fdb_resource_flags {
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +4 -4
index b9a25b0..6617ab9 100644
@@ -173,10 +173,10 @@ struct bnxt_ulp_mapper_tbl_info {
 	enum bnxt_ulp_resource_sub_type	resource_sub_type;
 	enum bnxt_ulp_cond_opcode	cond_opcode;
 	uint32_t			cond_operand;
-	uint8_t		direction;
-	uint32_t	priority;
-	uint8_t		srch_b4_alloc;
-	enum bnxt_ulp_critical_resource	critical_resource;
+	uint8_t				direction;
+	uint32_t			priority;
+	enum bnxt_ulp_search_before_alloc	srch_b4_alloc;
+	enum bnxt_ulp_critical_resource		critical_resource;
 
 	/* Information for accessing the ulp_key_field_list */
 	uint32_t	key_start_idx;
Signature · 1 line
2.7.4
#18 lore raw

PATCH 18/20 net/bnxt: added templates for search before alloc

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Search before alloc allows reuse of constrained resources such as tcam, encap, and source modifications. The new templates will search the entry and alloc only if necessary.

---
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c   |  6 +++---
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +3 -3
index 58b581c..14ce16e 100644
@@ -1052,7 +1052,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
 	.cond_opcode = BNXT_ULP_COND_OPCODE_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_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.result_start_idx = 96,
 	.result_bit_size = 0,
 	.result_num_fields = 0,
@@ -1069,7 +1069,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
 	.cond_opcode = BNXT_ULP_COND_OPCODE_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_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.result_start_idx = 99,
 	.result_bit_size = 0,
 	.result_num_fields = 0,
@@ -1084,7 +1084,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
 	.direction = TF_DIR_TX,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.result_start_idx = 102,
 	.result_bit_size = 0,
 	.result_num_fields = 0,
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +7 -7
index 41d1d87..94160a9 100644
@@ -3782,7 +3782,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 108,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4210,7 +4210,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 457,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4282,7 +4282,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 526,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4354,7 +4354,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 595,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4426,7 +4426,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 664,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4570,7 +4570,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 802,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4998,7 +4998,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_TX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_UPDATE,
 	.key_start_idx = 1151,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
Signature · 1 line
2.7.4
#19 lore raw

PATCH 19/20 net/bnxt: enabled shadow tables during session open

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Turn on shadow memory in the core to allow search before allocate. This allows reuse of constrained resources.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +1 -1
index 2febd58..077527f 100644
@@ -81,7 +81,7 @@ ulp_ctx_session_open(struct bnxt *bp,
 		return rc;
 	}
 
-	params.shadow_copy = false;
+	params.shadow_copy = true;
 	params.device_type = TF_DEVICE_TYPE_WH;
 	resources = &params.resources;
 	/** RX **/
Signature · 1 line
2.7.4
#20 lore raw

PATCH 20/20 net/bnxt: cleanup of VF-representor dev ops

In reply to Somnath Kotur

No need to access rx_cfa_code, cfa_code_map from the VF-Rep functions anymore.

Fixes 322bd6e70272 ("net/bnxt: add port representor infrastructure")
---
 drivers/net/bnxt/bnxt.h      |  1 -
 drivers/net/bnxt/bnxt_reps.c | 75 +++++---------------------------------------
 2 files changed, 7 insertions(+), 69 deletions(-)
drivers/net/bnxt/bnxt.h +0 -1
index 41e7ae5..f4b2a3f 100644
@@ -799,7 +799,6 @@ struct bnxt_vf_representor {
 	uint16_t		dflt_vnic_id;
 	uint16_t		svif;
 	uint16_t		vfr_tx_cfa_action;
-	uint16_t		rx_cfa_code;
 	uint32_t		rep2vf_flow_id;
 	uint32_t		vf2rep_flow_id;
 	/* Private data store of associated PF/Trusted VF */
drivers/net/bnxt/bnxt_reps.c +7 -68

122 lines not on this page · raw message

Signature · 1 line
2.7.4
#21 lore raw

v2 cover bnxt patches

In reply to Somnath Kotur

Some fixes, cleanups and changes to augment pre-existing support in infrastructure

Please apply

Kishore Padmanabha (7):
net/bnxt: nat global registers support
net/bnxt: parif for offload miss rules
net/bnxt: nat template changes
net/bnxt: configure parif for the egress rules net/bnxt: ignore VLAN priority mask
net/bnxt: add egress template with VLAN tag match net/bnxt: tcam table processing support for search and alloc

Mike Baucom (9):
net/bnxt: add shadow tcam capability with search net/bnxt: ulp mapper changes to use tcam search net/bnxt: add tf hash API
net/bnxt: modify tf shadow tcam to use common tf hash net/bnxt: added shadow table capability with search net/bnxt: ulp mapper changes to use tbl search net/bnxt: shadow tcam and tbl reference count modification net/bnxt: added templates for search before alloc net/bnxt: enabled shadow tables during session open

Somnath Kotur (1):
net/bnxt: cleanup of VF-representor dev ops

Venkat Duvvuru (3):
net/bnxt: skip mark id injection into mbuf net/bnxt: fix port default rule create and destroy net/bnxt: delete VF FW rules when a representor is created

 drivers/net/bnxt/bnxt.h                         |   6 +-
 drivers/net/bnxt/bnxt_ethdev.c                  |  81 +--
 drivers/net/bnxt/bnxt_hwrm.c                    |  49 ++
 drivers/net/bnxt/bnxt_hwrm.h                    |   2 +
 drivers/net/bnxt/bnxt_reps.c                    |  94 +--
 drivers/net/bnxt/bnxt_rxr.c                     |   3 +
 drivers/net/bnxt/bnxt_txq.h                     |   1 -
 drivers/net/bnxt/bnxt_txr.c                     |   6 +-
 drivers/net/bnxt/hsi_struct_def_dpdk.h          | 138 ++++
 drivers/net/bnxt/meson.build                    |   1 +
 drivers/net/bnxt/tf_core/Makefile               |   1 +
 drivers/net/bnxt/tf_core/tf_core.c              | 139 +++-
 drivers/net/bnxt/tf_core/tf_core.h              | 174 +++++
 drivers/net/bnxt/tf_core/tf_device_p4.c         |   4 +-
 drivers/net/bnxt/tf_core/tf_hash.c              | 106 +++
 drivers/net/bnxt/tf_core/tf_hash.h              |  27 +
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c        | 766 +++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.h        | 124 ++--
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c       | 818 +++++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h       | 258 ++++----
 drivers/net/bnxt/tf_core/tf_tbl.c               | 246 ++++++-
 drivers/net/bnxt/tf_core/tf_tbl.h               |  22 +-
 drivers/net/bnxt/tf_core/tf_tcam.c              | 300 ++++++++-
 drivers/net/bnxt/tf_core/tf_tcam.h              |  31 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c              |  97 ++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h              |  18 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c         | 127 +++-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c           |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h           |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c            | 505 ++++++++++-----
 drivers/net/bnxt/tf_ulp/ulp_port_db.c           |   2 +
 drivers/net/bnxt/tf_ulp/ulp_port_db.h           |   1 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c        |  81 +++
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c   | 434 ++++++++-----
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c | 556 ++++++++++++++--
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h  |  73 ++-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c   |   4 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h   |   8 +-
 38 files changed, 4457 insertions(+), 850 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.h
Signature · 2 lines
v1->v2: Fixed some typos in patch 9/20
2.7.4
#22 lore raw

PATCH v2 1/20 net/bnxt: add shadow tcam capability with search

From: Mike Baucom <[email protected]>

- Add TCAM shadow tables for searching
- Add Search API to allow reuse of TCAM entries

---
 drivers/net/bnxt/tf_core/tf_core.c        |  73 +++
 drivers/net/bnxt/tf_core/tf_core.h        | 101 ++++
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   2 +-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 885 +++++++++++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h | 258 ++++-----
 drivers/net/bnxt/tf_core/tf_tcam.c        | 300 +++++++++-
 drivers/net/bnxt/tf_core/tf_tcam.h        |  31 +-
 7 files changed, 1449 insertions(+), 201 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +73 -0
index 97e7952..ca3280b 100644
@@ -608,6 +608,79 @@ tf_search_identifier(struct tf *tfp,
 }
 
 int
+tf_search_tcam_entry(struct tf *tfp,
+		     struct tf_search_tcam_entry_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+	struct tf_tcam_alloc_search_parms sparms;
+
+	TF_CHECK_PARMS2(tfp, parms);
+
+	memset(&sparms, 0, sizeof(struct tf_tcam_alloc_search_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_alloc_search_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;
+	}
+
+	sparms.dir = parms->dir;
+	sparms.type = parms->tcam_tbl_type;
+	sparms.key = parms->key;
+	sparms.key_size = TF_BITS2BYTES_WORD_ALIGN(parms->key_sz_in_bits);
+	sparms.mask = parms->mask;
+	sparms.priority = parms->priority;
+	sparms.alloc = parms->alloc;
+
+	/* Result is an in/out and so no need to copy during outputs */
+	sparms.result = parms->result;
+	sparms.result_size =
+		TF_BITS2BYTES_WORD_ALIGN(parms->result_sz_in_bits);
+
+	rc = dev->ops->tf_dev_alloc_search_tcam(tfp, &sparms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: TCAM allocation failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Copy the outputs */
+	parms->hit = sparms.hit;
+	parms->search_status = sparms.search_status;
+	parms->ref_cnt = sparms.ref_cnt;
+	parms->idx = sparms.idx;
+
+	return 0;
+}
+
+int
 tf_alloc_tcam_entry(struct tf *tfp,
 		    struct tf_alloc_tcam_entry_parms *parms)
 {
drivers/net/bnxt/tf_core/tf_core.h +101 -0

119 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device_p4.c +1 -1
index f38c38e..afb6098 100644
@@ -133,7 +133,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_alloc_search_tcam = NULL,
+	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
 	.tf_dev_get_tcam = NULL,
 	.tf_dev_insert_int_em_entry = tf_em_insert_int_entry,
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +863 -22

924 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tcam.h +107 -151

339 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.c +281 -19

445 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.h +23 -8
index ee5bacc..4722ce0 100644
@@ -104,19 +104,19 @@ struct tf_tcam_alloc_search_parms {
 	 */
 	enum tf_tcam_tbl_type type;
 	/**
-	 * [in] Enable search for matching entry
+	 * [in] Type of HCAPI
 	 */
-	uint8_t search_enable;
+	uint16_t hcapi_type;
 	/**
-	 * [in] Key data to match on (if search)
+	 * [in] Key data to match on
 	 */
 	uint8_t *key;
 	/**
-	 * [in] key size (if search)
+	 * [in] key size in bits
 	 */
 	uint16_t key_size;
 	/**
-	 * [in] Mask data to match on (if search)
+	 * [in] Mask data to match on
 	 */
 	uint8_t *mask;
 	/**
@@ -124,16 +124,31 @@ struct tf_tcam_alloc_search_parms {
 	 */
 	uint32_t priority;
 	/**
-	 * [out] If search, set if matching entry found
+	 * [in] Allocate on miss.
+	 */
+	uint8_t alloc;
+	/**
+	 * [out] Set if matching entry found
 	 */
 	uint8_t hit;
 	/**
+	 * [out] Search result status (hit, miss, reject)
+	 */
+	enum tf_tcam_search_status search_status;
+	/**
 	 * [out] Current refcnt after allocation
 	 */
 	uint16_t ref_cnt;
 	/**
-	 * [out] Idx allocated
-	 *
+	 * [inout] The result data from the search is copied here
+	 */
+	uint8_t *result;
+	/**
+	 * [inout] result size in bits for the result data
+	 */
+	uint16_t result_size;
+	/**
+	 * [out] Index found
 	 */
 	uint16_t idx;
 };
Signature · 1 line
2.7.4
#23 lore raw

PATCH v2 2/20 net/bnxt: nat global registers support

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

Add support to enable or disable the NAT global registers. The NAT feature is enabled in hardware during initialization and disabled at deinitialization of the application.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 83 ++++++++++++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h |  4 ++
 2 files changed, 87 insertions(+)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +83 -0
index 0869231..7c65a4b 100644
@@ -597,6 +597,52 @@ ulp_session_deinit(struct bnxt_ulp_session_state *session)
 }
 
 /*
+ * Internal api to enable NAT feature.
+ * Set set_flag to 1 to set the value or zero to reset the value.
+ * returns 0 on success.
+ */
+static int32_t
+bnxt_ulp_global_cfg_update(struct bnxt *bp,
+			   enum tf_dir dir,
+			   enum tf_global_config_type type,
+			   uint32_t offset,
+			   uint32_t value,
+			   uint32_t set_flag)
+{
+	uint32_t global_cfg = 0;
+	int rc;
+	struct tf_global_cfg_parms parms;
+
+	/* Initialize the params */
+	parms.dir = dir,
+	parms.type = type,
+	parms.offset = offset,
+	parms.config = (uint8_t *)&global_cfg,
+	parms.config_sz_in_bytes = sizeof(global_cfg);
+
+	rc = tf_get_global_cfg(&bp->tfp, &parms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to get global cfg 0x%x rc:%d\n",
+			    type, rc);
+		return rc;
+	}
+
+	if (set_flag)
+		global_cfg |= value;
+	else
+		global_cfg &= ~value;
+
+	/* SET the register RE_CFA_REG_ACT_TECT */
+	rc = tf_set_global_cfg(&bp->tfp, &parms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set global cfg 0x%x rc:%d\n",
+			    type, rc);
+		return rc;
+	}
+	return rc;
+}
+
+/*
  * When a port is initialized by dpdk. This functions is called
  * and this function initializes the ULP context and rest of the
  * infrastructure associated with it.
@@ -732,6 +778,29 @@ bnxt_ulp_init(struct bnxt *bp)
 		goto jump_to_error;
 	}
 
+	/*
+	 * Enable NAT feature. Set the global configuration register
+	 * Tunnel encap to enable NAT with the reuse of existing inner
+	 * L2 header smac and dmac
+	 */
+	rc = bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,
+					TF_TUNNEL_ENCAP_NAT,
+					(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					BNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set rx global configuration\n");
+		goto jump_to_error;
+	}
+
+	rc = bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,
+					TF_TUNNEL_ENCAP_NAT,
+					(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					BNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set tx global configuration\n");
+		goto jump_to_error;
+	}
+
 	return rc;
 
 jump_to_error:
@@ -785,6 +854,19 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	/* Delete the Port database */
 	ulp_port_db_deinit(bp->ulp_ctx);
 
+	/* Disable NAT feature */
+	(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,
+					 TF_TUNNEL_ENCAP_NAT,
+					 (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),
+					 0);
+
+	(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,
+					 TF_TUNNEL_ENCAP_NAT,
+					 (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),
+					 0);
+
 	/* Delete the ulp context and tf session */
 	ulp_ctx_detach(bp, session);
 
@@ -942,6 +1024,7 @@ bnxt_ulp_eth_dev_ptr2_cntxt_get(struct rte_eth_dev	*dev)
 
 	if (BNXT_ETH_DEV_IS_REPRESENTOR(dev)) {
 		struct bnxt_vf_representor *vfr = dev->data->dev_private;
+
 		bp = vfr->parent_dev->data->dev_private;
 	}
 
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +4 -0
index f9e5e2b..7c95ead 100644
@@ -14,6 +14,10 @@
 
 #include "ulp_template_db_enum.h"
 
+/* NAT defines to reuse existing inner L2 SMAC and DMAC */
+#define BNXT_ULP_NAT_INNER_L2_HEADER_SMAC	0x2000
+#define BNXT_ULP_NAT_INNER_L2_HEADER_DMAC	0x100
+
 /* defines for the ulp_flags */
 #define BNXT_ULP_VF_REP_ENABLED		0x1
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
Signature · 1 line
2.7.4
#24 lore raw

PATCH v2 3/20 net/bnxt: parif for offload miss rules

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

For the offload miss rules, the parif miss path needs to be considered. The higher parif are reserved for handling this.

---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c  |  4 ++--
 drivers/net/bnxt/tf_ulp/ulp_port_db.h    |  1 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 40 ++++++++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +2 -2
index 4d4f7c4..d86e4c9 100644
@@ -12,8 +12,6 @@
 #include "ulp_flow_db.h"
 #include "ulp_mapper.h"
 
-#define BNXT_ULP_FREE_PARIF_BASE 11
-
 struct bnxt_ulp_def_param_handler {
 	int32_t (*vfr_func)(struct bnxt_ulp_context *ulp_ctx,
 			    struct ulp_tlv_param *param,
@@ -85,6 +83,8 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx,
 
 	if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
 		idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF;
+		/* Parif needs to be reset to a free partition */
+		parif += BNXT_ULP_FREE_PARIF_BASE;
 	} else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) {
 		idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF;
 		/* Parif needs to be reset to a free partition */
drivers/net/bnxt/tf_ulp/ulp_port_db.h +1 -0
index 393d01b..2b323d1 100644
@@ -10,6 +10,7 @@
 
 #define BNXT_PORT_DB_MAX_INTF_LIST		256
 #define BNXT_PORT_DB_MAX_FUNC			2048
+#define BNXT_ULP_FREE_PARIF_BASE		11
 
 enum bnxt_ulp_svif_type {
 	BNXT_ULP_DRV_FUNC_SVIF = 0,
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +40 -0
index 3891bcd..39f801b 100644
@@ -159,6 +159,43 @@ bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[],
 }
 
 /*
+ * Function to handle the post processing of the computed
+ * fields for the interface.
+ */
+static void
+bnxt_ulp_comp_fld_intf_update(struct ulp_rte_parser_params *params)
+{
+	uint32_t ifindex;
+	uint16_t port_id, parif;
+	enum bnxt_ulp_direction_type dir;
+
+	/* get the direction details */
+	dir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);
+
+	if (dir == BNXT_ULP_DIR_INGRESS) {
+		/* read the port id details */
+		port_id = ULP_COMP_FLD_IDX_RD(params,
+					      BNXT_ULP_CF_IDX_INCOMING_IF);
+		if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx,
+						      port_id,
+						      &ifindex)) {
+			BNXT_TF_DBG(ERR, "ParseErr:Portid is not valid\n");
+			return;
+		}
+		/* Set port PARIF */
+		if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
+					  BNXT_ULP_PHY_PORT_PARIF, &parif)) {
+			BNXT_TF_DBG(ERR, "ParseErr:ifindex is not valid\n");
+			return;
+		}
+		/* Parif needs to be reset to a free partition */
+		parif += BNXT_ULP_FREE_PARIF_BASE;
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_PHY_PORT_PARIF,
+				    parif);
+	}
+}
+
+/*
  * Function to handle the post processing of the parsing details
  */
 int32_t
@@ -213,6 +250,9 @@ bnxt_ulp_rte_parser_post_process(struct ulp_rte_parser_params *params)
 	/* Merge the hdr_fp_bit into the proto header bit */
 	params->hdr_bitmap.bits |= params->hdr_fp_bit.bits;
 
+	/* Update the computed interface parameters */
+	bnxt_ulp_comp_fld_intf_update(params);
+
 	/* TBD: Handle the flow rejection scenarios */
 	return 0;
 }
Signature · 1 line
2.7.4
#25 lore raw

PATCH v2 4/20 net/bnxt: ulp mapper changes to use tcam search

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

modified ulp mappper to use the new tf_search_tcam_entry API. When search before allocation is requested, mapper calls tc_search_tcam_entry with the alloc flag.

- On HIT, the result and tcam index is returned.
- On MISS, the tcam index is returned but the result is created and the tcam entry is set.
- On REJECT, the flow request is rejected.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c | 106 +++++++++++++++++++++++------------
 1 file changed, 71 insertions(+), 35 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +71 -35
index 6a727ed..2d3373d 100644
@@ -690,7 +690,7 @@ ulp_mapper_ident_extract(struct bnxt_ulp_mapper_parms *parms,
 {
 	struct ulp_flow_db_res_params	fid_parms;
 	uint64_t id = 0;
-	uint32_t idx;
+	uint32_t idx = 0;
 	struct tf_search_identifier_parms sparms = { 0 };
 	struct tf_free_identifier_parms free_parms = { 0 };
 	struct tf *tfp;
@@ -1292,12 +1292,13 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	struct tf *tfp;
 	int32_t rc, trc;
 	struct tf_alloc_tcam_entry_parms aparms		= { 0 };
+	struct tf_search_tcam_entry_parms searchparms   = { 0 };
 	struct tf_set_tcam_entry_parms sparms		= { 0 };
 	struct ulp_flow_db_res_params	fid_parms	= { 0 };
 	struct tf_free_tcam_entry_parms free_parms	= { 0 };
 	uint32_t hit = 0;
 	uint16_t tmplen = 0;
-	struct ulp_blob res_blob;
+	uint16_t idx;
 
 	/* Skip this if was handled by the cache. */
 	if (parms->tcam_tbl_opc == BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_SKIP) {
@@ -1352,37 +1353,72 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 	}
 
-	aparms.dir		= tbl->direction;
-	aparms.tcam_tbl_type	= tbl->resource_type;
-	aparms.search_enable	= tbl->srch_b4_alloc;
-	aparms.key_sz_in_bits	= tbl->key_bit_size;
-	aparms.key		= ulp_blob_data_get(&key, &tmplen);
-	if (tbl->key_bit_size != tmplen) {
-		BNXT_TF_DBG(ERR, "Key len (%d) != Expected (%d)\n",
-			    tmplen, tbl->key_bit_size);
-		return -EINVAL;
-	}
+	if (!tbl->srch_b4_alloc) {
+		/*
+		 * 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_sz_in_bits	= tbl->key_bit_size;
+		aparms.key		= ulp_blob_data_get(&key, &tmplen);
+		if (tbl->key_bit_size != tmplen) {
+			BNXT_TF_DBG(ERR, "Key len (%d) != Expected (%d)\n",
+				    tmplen, tbl->key_bit_size);
+			return -EINVAL;
+		}
 
-	aparms.mask		= ulp_blob_data_get(&mask, &tmplen);
-	if (tbl->key_bit_size != tmplen) {
-		BNXT_TF_DBG(ERR, "Mask len (%d) != Expected (%d)\n",
-			    tmplen, tbl->key_bit_size);
-		return -EINVAL;
-	}
+		aparms.mask		= ulp_blob_data_get(&mask, &tmplen);
+		if (tbl->key_bit_size != tmplen) {
+			BNXT_TF_DBG(ERR, "Mask len (%d) != Expected (%d)\n",
+				    tmplen, tbl->key_bit_size);
+			return -EINVAL;
+		}
 
-	aparms.priority		= tbl->priority;
+		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
-	 */
-	rc = tf_alloc_tcam_entry(tfp, &aparms);
-	if (rc) {
-		BNXT_TF_DBG(ERR, "tcam alloc failed rc=%d.\n", rc);
-		return rc;
-	}
+		/*
+		 * All failures after this succeeds require the entry to be
+		 * freed. cannot return directly on failure, but needs to goto
+		 * error.
+		 */
+		rc = tf_alloc_tcam_entry(tfp, &aparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "tcam alloc failed rc=%d.\n", rc);
+			return rc;
+		}
+		idx = aparms.idx;
+		hit = aparms.hit;
+	} else {
+		/*
+		 * Searching before allocation to see if we already have an
+		 * entry.  This allows re-use of a constrained resource.
+		 */
+		searchparms.dir = tbl->direction;
+		searchparms.tcam_tbl_type = tbl->resource_type;
+		searchparms.key = ulp_blob_data_get(&key, &tmplen);
+		searchparms.key_sz_in_bits = tbl->key_bit_size;
+		searchparms.mask = ulp_blob_data_get(&mask, &tmplen);
+		searchparms.priority = tbl->priority;
+		searchparms.alloc = 1;
+		searchparms.result = ulp_blob_data_get(&data, &tmplen);
+		searchparms.result_sz_in_bits = tbl->result_bit_size;
+
+		rc = tf_search_tcam_entry(tfp, &searchparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "tcam search failed rc=%d\n", rc);
+			return rc;
+		}
 
-	hit = aparms.hit;
+		/* Successful search, check the result */
+		if (searchparms.search_status == REJECT) {
+			BNXT_TF_DBG(ERR, "tcam alloc rejected\n");
+			return -ENOMEM;
+		}
+		idx = searchparms.idx;
+		hit = searchparms.hit;
+	}
 
 	/* Build the result */
 	if (!tbl->srch_b4_alloc || !hit) {
@@ -1430,9 +1466,9 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 			}
 		}
 
-		sparms.dir		= aparms.dir;
-		sparms.tcam_tbl_type	= aparms.tcam_tbl_type;
-		sparms.idx		= aparms.idx;
+		sparms.dir		= tbl->direction;
+		sparms.tcam_tbl_type	= tbl->resource_type;
+		sparms.idx		= idx;
 		/* Already verified the key/mask lengths */
 		sparms.key		= ulp_blob_data_get(&key, &tmplen);
 		sparms.mask		= ulp_blob_data_get(&mask, &tmplen);
@@ -1464,7 +1500,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 				rc = -EINVAL;
 				goto error;
 			}
-			parms->cache_ptr->tcam_idx = aparms.idx;
+			parms->cache_ptr->tcam_idx = idx;
 		}
 
 		/* Mark action */
@@ -1483,7 +1519,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		idents = ulp_mapper_ident_fields_get(tbl, &num_idents);
 		for (i = 0; i < num_idents; i++) {
 			rc = ulp_mapper_ident_extract(parms, tbl,
-						      &idents[i], &res_blob);
+						      &idents[i], &data);
 			if (rc) {
 				BNXT_TF_DBG(ERR,
 					    "Error in ident extraction\n");
@@ -1501,7 +1537,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		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	= aparms.idx;
+		fid_parms.resource_hndl	= idx;
 		rc = ulp_flow_db_resource_add(parms->ulp_ctx,
 					      parms->tbl_idx,
 					      parms->fid,
Signature · 1 line
2.7.4
#26 lore raw

PATCH v2 5/20 net/bnxt: add tf hash API

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Added tf_hash API for common hash uses across tf_core functions

---
 drivers/net/bnxt/meson.build       |   1 +
 drivers/net/bnxt/tf_core/Makefile  |   1 +
 drivers/net/bnxt/tf_core/tf_hash.c | 106 +++++++++++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_core/tf_hash.h |  27 ++++++++++
 4 files changed, 135 insertions(+)
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.h
drivers/net/bnxt/meson.build +1 -0
index 8529b33..190469e 100644
@@ -47,6 +47,7 @@ sources = files('bnxt_cpr.c',
 	'tf_core/tf_global_cfg.c',
 	'tf_core/tf_em_host.c',
 	'tf_core/tf_shadow_identifier.c',
+	'tf_core/tf_hash.c',
 
 	'hcapi/hcapi_cfa_p4.c',
 
drivers/net/bnxt/tf_core/Makefile +1 -0
index cca0e2e..cf6aaec 100644
@@ -32,3 +32,4 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_util.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_if_tbl.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_global_cfg.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_identifier.c
+SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_hash.c
drivers/net/bnxt/tf_core/tf_hash.c new file +106 -0

106 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_hash.h new file +27 -0
new file mode 100644
index 0000000..6b60aff
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019-2020 Broadcom
+ * All rights reserved.
+ */
+
+#ifndef _TF_HASH_H_
+#define _TF_HASH_H_
+
+#include "tf_core.h"
+
+/**
+ * Calculate a crc32 on the buffer with an initial value and len
+ *
+ * Returns the crc32
+ */
+uint32_t
+tf_hash_calc_crc32i(uint32_t init, uint8_t *buf, uint32_t len);
+
+/**
+ * Calculate a crc32 on the buffer with a default initial value
+ *
+ * Returns the crc32
+ */
+uint32_t
+tf_hash_calc_crc32(uint8_t *buf, uint32_t len);
+
+#endif
Signature · 1 line
2.7.4
#27 lore raw

PATCH v2 6/20 net/bnxt: skip mark id injection into mbuf

In reply to Somnath Kotur

From: Venkat Duvvuru <[email protected]>

When a packet is looped back from VF to VFR, it is marked to identify the VFR interface. However, this mark_id shouldn't be percolated up to the OVS as it is internal to pmd.
This patch fixes it by skipping mark injection into mbuf if the packet is received on VFR interface.

---
 drivers/net/bnxt/bnxt_rxr.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/bnxt/bnxt_rxr.c +3 -0
index baf73cb..43b1256 100644
@@ -485,6 +485,9 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,
 	rc = ulp_mark_db_mark_get(bp->ulp_ctx, gfid,
 				  cfa_code, vfr_flag, &mark_id);
 	if (!rc) {
+		/* VF to VFR Rx path. So, skip mark_id injection in mbuf */
+		if (vfr_flag && *vfr_flag)
+			return mark_id;
 		/* Got the mark, write it to the mbuf and return */
 		mbuf->hash.fdir.hi = mark_id;
 		mbuf->udata64 = (cfa_code & 0xffffffffull) << 32;
Signature · 1 line
2.7.4
#28 lore raw

PATCH v2 7/20 net/bnxt: nat template changes

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

The template is updated to support additional combinations of NAT actions.

---
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c   | 412 +++++++++++++++---------
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c |  16 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h  |  26 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c   |   4 +-
 4 files changed, 285 insertions(+), 173 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +258 -154
index 0f19e8e..31fe905 100644
@@ -12,80 +12,88 @@ uint16_t ulp_act_sig_tbl[BNXT_ULP_ACT_SIG_TBL_MAX_SZ] = {
 	[BNXT_ULP_ACT_HID_015a] = 1,
 	[BNXT_ULP_ACT_HID_00eb] = 2,
 	[BNXT_ULP_ACT_HID_0043] = 3,
-	[BNXT_ULP_ACT_HID_01d6] = 4,
-	[BNXT_ULP_ACT_HID_015e] = 5,
-	[BNXT_ULP_ACT_HID_00ef] = 6,
-	[BNXT_ULP_ACT_HID_0047] = 7,
-	[BNXT_ULP_ACT_HID_01da] = 8,
-	[BNXT_ULP_ACT_HID_025b] = 9,
-	[BNXT_ULP_ACT_HID_01ec] = 10,
-	[BNXT_ULP_ACT_HID_0144] = 11,
-	[BNXT_ULP_ACT_HID_02d7] = 12,
-	[BNXT_ULP_ACT_HID_025f] = 13,
-	[BNXT_ULP_ACT_HID_01f0] = 14,
-	[BNXT_ULP_ACT_HID_0148] = 15,
-	[BNXT_ULP_ACT_HID_02db] = 16,
-	[BNXT_ULP_ACT_HID_0000] = 17,
-	[BNXT_ULP_ACT_HID_0002] = 18,
-	[BNXT_ULP_ACT_HID_0800] = 19,
-	[BNXT_ULP_ACT_HID_0101] = 20,
-	[BNXT_ULP_ACT_HID_0020] = 21,
-	[BNXT_ULP_ACT_HID_0901] = 22,
-	[BNXT_ULP_ACT_HID_0121] = 23,
-	[BNXT_ULP_ACT_HID_0004] = 24,
-	[BNXT_ULP_ACT_HID_0804] = 25,
-	[BNXT_ULP_ACT_HID_0105] = 26,
-	[BNXT_ULP_ACT_HID_0024] = 27,
-	[BNXT_ULP_ACT_HID_0905] = 28,
-	[BNXT_ULP_ACT_HID_0125] = 29,
-	[BNXT_ULP_ACT_HID_0001] = 30,
-	[BNXT_ULP_ACT_HID_0005] = 31,
-	[BNXT_ULP_ACT_HID_0009] = 32,
-	[BNXT_ULP_ACT_HID_000d] = 33,
-	[BNXT_ULP_ACT_HID_0021] = 34,
-	[BNXT_ULP_ACT_HID_0029] = 35,
-	[BNXT_ULP_ACT_HID_0025] = 36,
-	[BNXT_ULP_ACT_HID_002d] = 37,
-	[BNXT_ULP_ACT_HID_0801] = 38,
-	[BNXT_ULP_ACT_HID_0809] = 39,
-	[BNXT_ULP_ACT_HID_0805] = 40,
-	[BNXT_ULP_ACT_HID_080d] = 41,
-	[BNXT_ULP_ACT_HID_0c15] = 42,
-	[BNXT_ULP_ACT_HID_0c19] = 43,
-	[BNXT_ULP_ACT_HID_02f6] = 44,
-	[BNXT_ULP_ACT_HID_04f8] = 45,
-	[BNXT_ULP_ACT_HID_01df] = 46,
-	[BNXT_ULP_ACT_HID_05e3] = 47,
-	[BNXT_ULP_ACT_HID_02fa] = 48,
-	[BNXT_ULP_ACT_HID_04fc] = 49,
-	[BNXT_ULP_ACT_HID_01e3] = 50,
-	[BNXT_ULP_ACT_HID_05e7] = 51,
-	[BNXT_ULP_ACT_HID_03f7] = 52,
-	[BNXT_ULP_ACT_HID_05f9] = 53,
-	[BNXT_ULP_ACT_HID_02e0] = 54,
-	[BNXT_ULP_ACT_HID_06e4] = 55,
-	[BNXT_ULP_ACT_HID_03fb] = 56,
-	[BNXT_ULP_ACT_HID_05fd] = 57,
-	[BNXT_ULP_ACT_HID_02e4] = 58,
-	[BNXT_ULP_ACT_HID_06e8] = 59,
-	[BNXT_ULP_ACT_HID_040d] = 60,
-	[BNXT_ULP_ACT_HID_040f] = 61,
-	[BNXT_ULP_ACT_HID_0413] = 62,
-	[BNXT_ULP_ACT_HID_0c0d] = 63,
-	[BNXT_ULP_ACT_HID_0567] = 64,
-	[BNXT_ULP_ACT_HID_0a49] = 65,
-	[BNXT_ULP_ACT_HID_050e] = 66,
-	[BNXT_ULP_ACT_HID_0d0e] = 67,
-	[BNXT_ULP_ACT_HID_0668] = 68,
-	[BNXT_ULP_ACT_HID_0b4a] = 69,
-	[BNXT_ULP_ACT_HID_0411] = 70,
-	[BNXT_ULP_ACT_HID_056b] = 71,
-	[BNXT_ULP_ACT_HID_0a4d] = 72,
-	[BNXT_ULP_ACT_HID_0c11] = 73,
-	[BNXT_ULP_ACT_HID_0512] = 74,
-	[BNXT_ULP_ACT_HID_0d12] = 75,
-	[BNXT_ULP_ACT_HID_066c] = 76,
-	[BNXT_ULP_ACT_HID_0b4e] = 77
+	[BNXT_ULP_ACT_HID_03d8] = 4,
+	[BNXT_ULP_ACT_HID_02c1] = 5,
+	[BNXT_ULP_ACT_HID_015e] = 6,
+	[BNXT_ULP_ACT_HID_00ef] = 7,
+	[BNXT_ULP_ACT_HID_0047] = 8,
+	[BNXT_ULP_ACT_HID_03dc] = 9,
+	[BNXT_ULP_ACT_HID_02c5] = 10,
+	[BNXT_ULP_ACT_HID_025b] = 11,
+	[BNXT_ULP_ACT_HID_01ec] = 12,
+	[BNXT_ULP_ACT_HID_0144] = 13,
+	[BNXT_ULP_ACT_HID_04d9] = 14,
+	[BNXT_ULP_ACT_HID_03c2] = 15,
+	[BNXT_ULP_ACT_HID_025f] = 16,
+	[BNXT_ULP_ACT_HID_01f0] = 17,
+	[BNXT_ULP_ACT_HID_0148] = 18,
+	[BNXT_ULP_ACT_HID_04dd] = 19,
+	[BNXT_ULP_ACT_HID_03c6] = 20,
+	[BNXT_ULP_ACT_HID_0000] = 21,
+	[BNXT_ULP_ACT_HID_0002] = 22,
+	[BNXT_ULP_ACT_HID_0800] = 23,
+	[BNXT_ULP_ACT_HID_0101] = 24,
+	[BNXT_ULP_ACT_HID_0020] = 25,
+	[BNXT_ULP_ACT_HID_0901] = 26,
+	[BNXT_ULP_ACT_HID_0121] = 27,
+	[BNXT_ULP_ACT_HID_0004] = 28,
+	[BNXT_ULP_ACT_HID_0804] = 29,
+	[BNXT_ULP_ACT_HID_0105] = 30,
+	[BNXT_ULP_ACT_HID_0024] = 31,
+	[BNXT_ULP_ACT_HID_0905] = 32,
+	[BNXT_ULP_ACT_HID_0125] = 33,
+	[BNXT_ULP_ACT_HID_0001] = 34,
+	[BNXT_ULP_ACT_HID_0005] = 35,
+	[BNXT_ULP_ACT_HID_0009] = 36,
+	[BNXT_ULP_ACT_HID_000d] = 37,
+	[BNXT_ULP_ACT_HID_0021] = 38,
+	[BNXT_ULP_ACT_HID_0029] = 39,
+	[BNXT_ULP_ACT_HID_0025] = 40,
+	[BNXT_ULP_ACT_HID_002d] = 41,
+	[BNXT_ULP_ACT_HID_0801] = 42,
+	[BNXT_ULP_ACT_HID_0809] = 43,
+	[BNXT_ULP_ACT_HID_0805] = 44,
+	[BNXT_ULP_ACT_HID_080d] = 45,
+	[BNXT_ULP_ACT_HID_0c15] = 46,
+	[BNXT_ULP_ACT_HID_0c19] = 47,
+	[BNXT_ULP_ACT_HID_02f6] = 48,
+	[BNXT_ULP_ACT_HID_04f8] = 49,
+	[BNXT_ULP_ACT_HID_01df] = 50,
+	[BNXT_ULP_ACT_HID_07e5] = 51,
+	[BNXT_ULP_ACT_HID_06ce] = 52,
+	[BNXT_ULP_ACT_HID_02fa] = 53,
+	[BNXT_ULP_ACT_HID_04fc] = 54,
+	[BNXT_ULP_ACT_HID_01e3] = 55,
+	[BNXT_ULP_ACT_HID_07e9] = 56,
+	[BNXT_ULP_ACT_HID_06d2] = 57,
+	[BNXT_ULP_ACT_HID_03f7] = 58,
+	[BNXT_ULP_ACT_HID_05f9] = 59,
+	[BNXT_ULP_ACT_HID_02e0] = 60,
+	[BNXT_ULP_ACT_HID_08e6] = 61,
+	[BNXT_ULP_ACT_HID_07cf] = 62,
+	[BNXT_ULP_ACT_HID_03fb] = 63,
+	[BNXT_ULP_ACT_HID_05fd] = 64,
+	[BNXT_ULP_ACT_HID_02e4] = 65,
+	[BNXT_ULP_ACT_HID_08ea] = 66,
+	[BNXT_ULP_ACT_HID_07d3] = 67,
+	[BNXT_ULP_ACT_HID_040d] = 68,
+	[BNXT_ULP_ACT_HID_040f] = 69,
+	[BNXT_ULP_ACT_HID_0413] = 70,
+	[BNXT_ULP_ACT_HID_0c0d] = 71,
+	[BNXT_ULP_ACT_HID_0567] = 72,
+	[BNXT_ULP_ACT_HID_0a49] = 73,
+	[BNXT_ULP_ACT_HID_050e] = 74,
+	[BNXT_ULP_ACT_HID_0d0e] = 75,
+	[BNXT_ULP_ACT_HID_0668] = 76,
+	[BNXT_ULP_ACT_HID_0b4a] = 77,
+	[BNXT_ULP_ACT_HID_0411] = 78,
+	[BNXT_ULP_ACT_HID_056b] = 79,
+	[BNXT_ULP_ACT_HID_0a4d] = 80,
+	[BNXT_ULP_ACT_HID_0c11] = 81,
+	[BNXT_ULP_ACT_HID_0512] = 82,
+	[BNXT_ULP_ACT_HID_0d12] = 83,
+	[BNXT_ULP_ACT_HID_066c] = 84,
+	[BNXT_ULP_ACT_HID_0b4e] = 85
 };
 
 struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
@@ -112,14 +120,25 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 	.act_tid = 1
 	},
 	[4] = {
-	.act_hid = BNXT_ULP_ACT_HID_01d6,
+	.act_hid = BNXT_ULP_ACT_HID_03d8,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
 	[5] = {
+	.act_hid = BNXT_ULP_ACT_HID_02c1,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[6] = {
 	.act_hid = BNXT_ULP_ACT_HID_015e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -127,7 +146,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[6] = {
+	[7] = {
 	.act_hid = BNXT_ULP_ACT_HID_00ef,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -136,7 +155,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[7] = {
+	[8] = {
 	.act_hid = BNXT_ULP_ACT_HID_0047,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -144,16 +163,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[8] = {
-	.act_hid = BNXT_ULP_ACT_HID_01da,
+	[9] = {
+	.act_hid = BNXT_ULP_ACT_HID_03dc,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[9] = {
+	[10] = {
+	.act_hid = BNXT_ULP_ACT_HID_02c5,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[11] = {
 	.act_hid = BNXT_ULP_ACT_HID_025b,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -161,7 +192,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[10] = {
+	[12] = {
 	.act_hid = BNXT_ULP_ACT_HID_01ec,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -170,7 +201,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[11] = {
+	[13] = {
 	.act_hid = BNXT_ULP_ACT_HID_0144,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -178,16 +209,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[12] = {
-	.act_hid = BNXT_ULP_ACT_HID_02d7,
+	[14] = {
+	.act_hid = BNXT_ULP_ACT_HID_04d9,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[13] = {
+	[15] = {
+	.act_hid = BNXT_ULP_ACT_HID_03c2,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[16] = {
 	.act_hid = BNXT_ULP_ACT_HID_025f,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -196,7 +239,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[14] = {
+	[17] = {
 	.act_hid = BNXT_ULP_ACT_HID_01f0,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -206,7 +249,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[15] = {
+	[18] = {
 	.act_hid = BNXT_ULP_ACT_HID_0148,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -215,51 +258,64 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[16] = {
-	.act_hid = BNXT_ULP_ACT_HID_02db,
+	[19] = {
+	.act_hid = BNXT_ULP_ACT_HID_04dd,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[17] = {
+	[20] = {
+	.act_hid = BNXT_ULP_ACT_HID_03c6,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[21] = {
 	.act_hid = BNXT_ULP_ACT_HID_0000,
 	.act_sig = { .bits =
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[18] = {
+	[22] = {
 	.act_hid = BNXT_ULP_ACT_HID_0002,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DROP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[19] = {
+	[23] = {
 	.act_hid = BNXT_ULP_ACT_HID_0800,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_POP_VLAN |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[20] = {
+	[24] = {
 	.act_hid = BNXT_ULP_ACT_HID_0101,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[21] = {
+	[25] = {
 	.act_hid = BNXT_ULP_ACT_HID_0020,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_DECAP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[22] = {
+	[26] = {
 	.act_hid = BNXT_ULP_ACT_HID_0901,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -267,7 +323,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[23] = {
+	[27] = {
 	.act_hid = BNXT_ULP_ACT_HID_0121,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_DECAP |
@@ -275,14 +331,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[24] = {
+	[28] = {
 	.act_hid = BNXT_ULP_ACT_HID_0004,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[25] = {
+	[29] = {
 	.act_hid = BNXT_ULP_ACT_HID_0804,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -290,7 +346,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[26] = {
+	[30] = {
 	.act_hid = BNXT_ULP_ACT_HID_0105,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -298,7 +354,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[27] = {
+	[31] = {
 	.act_hid = BNXT_ULP_ACT_HID_0024,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -306,7 +362,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[28] = {
+	[32] = {
 	.act_hid = BNXT_ULP_ACT_HID_0905,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -315,7 +371,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[29] = {
+	[33] = {
 	.act_hid = BNXT_ULP_ACT_HID_0125,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -324,14 +380,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[30] = {
+	[34] = {
 	.act_hid = BNXT_ULP_ACT_HID_0001,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[31] = {
+	[35] = {
 	.act_hid = BNXT_ULP_ACT_HID_0005,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -339,7 +395,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[32] = {
+	[36] = {
 	.act_hid = BNXT_ULP_ACT_HID_0009,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -347,7 +403,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[33] = {
+	[37] = {
 	.act_hid = BNXT_ULP_ACT_HID_000d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -356,7 +412,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[34] = {
+	[38] = {
 	.act_hid = BNXT_ULP_ACT_HID_0021,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -364,7 +420,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[35] = {
+	[39] = {
 	.act_hid = BNXT_ULP_ACT_HID_0029,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -373,7 +429,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[36] = {
+	[40] = {
 	.act_hid = BNXT_ULP_ACT_HID_0025,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -382,7 +438,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[37] = {
+	[41] = {
 	.act_hid = BNXT_ULP_ACT_HID_002d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -392,7 +448,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[38] = {
+	[42] = {
 	.act_hid = BNXT_ULP_ACT_HID_0801,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -400,7 +456,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[39] = {
+	[43] = {
 	.act_hid = BNXT_ULP_ACT_HID_0809,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -409,7 +465,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[40] = {
+	[44] = {
 	.act_hid = BNXT_ULP_ACT_HID_0805,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -418,7 +474,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[41] = {
+	[45] = {
 	.act_hid = BNXT_ULP_ACT_HID_080d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -428,14 +484,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[42] = {
+	[46] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c15,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_ENCAP |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 4
 	},
-	[43] = {
+	[47] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c19,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_ENCAP |
@@ -443,14 +499,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 4
 	},
-	[44] = {
+	[48] = {
 	.act_hid = BNXT_ULP_ACT_HID_02f6,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[45] = {
+	[49] = {
 	.act_hid = BNXT_ULP_ACT_HID_04f8,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
@@ -458,22 +514,33 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[46] = {
+	[50] = {
 	.act_hid = BNXT_ULP_ACT_HID_01df,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[47] = {
-	.act_hid = BNXT_ULP_ACT_HID_05e3,
+	[51] = {
+	.act_hid = BNXT_ULP_ACT_HID_07e5,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[48] = {
+	[52] = {
+	.act_hid = BNXT_ULP_ACT_HID_06ce,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[53] = {
 	.act_hid = BNXT_ULP_ACT_HID_02fa,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -481,7 +548,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[49] = {
+	[54] = {
 	.act_hid = BNXT_ULP_ACT_HID_04fc,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -490,7 +557,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[50] = {
+	[55] = {
 	.act_hid = BNXT_ULP_ACT_HID_01e3,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -498,16 +565,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[51] = {
-	.act_hid = BNXT_ULP_ACT_HID_05e7,
+	[56] = {
+	.act_hid = BNXT_ULP_ACT_HID_07e9,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[52] = {
+	[57] = {
+	.act_hid = BNXT_ULP_ACT_HID_06d2,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[58] = {
 	.act_hid = BNXT_ULP_ACT_HID_03f7,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -515,7 +594,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[53] = {
+	[59] = {
 	.act_hid = BNXT_ULP_ACT_HID_05f9,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -524,7 +603,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[54] = {
+	[60] = {
 	.act_hid = BNXT_ULP_ACT_HID_02e0,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -532,16 +611,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[55] = {
-	.act_hid = BNXT_ULP_ACT_HID_06e4,
+	[61] = {
+	.act_hid = BNXT_ULP_ACT_HID_08e6,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[56] = {
+	[62] = {
+	.act_hid = BNXT_ULP_ACT_HID_07cf,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[63] = {
 	.act_hid = BNXT_ULP_ACT_HID_03fb,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -550,7 +641,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[57] = {
+	[64] = {
 	.act_hid = BNXT_ULP_ACT_HID_05fd,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -560,7 +651,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[58] = {
+	[65] = {
 	.act_hid = BNXT_ULP_ACT_HID_02e4,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -569,30 +660,43 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[59] = {
-	.act_hid = BNXT_ULP_ACT_HID_06e8,
+	[66] = {
+	.act_hid = BNXT_ULP_ACT_HID_08ea,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[60] = {
+	[67] = {
+	.act_hid = BNXT_ULP_ACT_HID_07d3,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[68] = {
 	.act_hid = BNXT_ULP_ACT_HID_040d,
 	.act_sig = { .bits =
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[61] = {
+	[69] = {
 	.act_hid = BNXT_ULP_ACT_HID_040f,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DROP |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[62] = {
+	[70] = {
 	.act_hid = BNXT_ULP_ACT_HID_0413,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DROP |
@@ -600,14 +704,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[63] = {
+	[71] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c0d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_POP_VLAN |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[64] = {
+	[72] = {
 	.act_hid = BNXT_ULP_ACT_HID_0567,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_VLAN_PCP |
@@ -616,7 +720,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[65] = {
+	[73] = {
 	.act_hid = BNXT_ULP_ACT_HID_0a49,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_VLAN_VID |
@@ -624,14 +728,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[66] = {
+	[74] = {
 	.act_hid = BNXT_ULP_ACT_HID_050e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[67] = {
+	[75] = {
 	.act_hid = BNXT_ULP_ACT_HID_0d0e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -639,7 +743,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[68] = {
+	[76] = {
 	.act_hid = BNXT_ULP_ACT_HID_0668,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -649,7 +753,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[69] = {
+	[77] = {
 	.act_hid = BNXT_ULP_ACT_HID_0b4a,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -658,14 +762,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[70] = {
+	[78] = {
 	.act_hid = BNXT_ULP_ACT_HID_0411,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[71] = {
+	[79] = {
 	.act_hid = BNXT_ULP_ACT_HID_056b,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -675,7 +779,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[72] = {
+	[80] = {
 	.act_hid = BNXT_ULP_ACT_HID_0a4d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -684,7 +788,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[73] = {
+	[81] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c11,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -692,7 +796,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[74] = {
+	[82] = {
 	.act_hid = BNXT_ULP_ACT_HID_0512,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -700,7 +804,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[75] = {
+	[83] = {
 	.act_hid = BNXT_ULP_ACT_HID_0d12,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -709,7 +813,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[76] = {
+	[84] = {
 	.act_hid = BNXT_ULP_ACT_HID_066c,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -720,7 +824,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[77] = {
+	[85] = {
 	.act_hid = BNXT_ULP_ACT_HID_0b4e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +8 -8
index 200a5a6..9de45cd 100644
@@ -17241,7 +17241,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17311,7 +17311,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17325,7 +17325,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17339,7 +17339,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17353,7 +17353,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17367,7 +17367,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17381,7 +17381,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17451,7 +17451,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +17 -9
index b5deaf6..c9fe1bc 100644
@@ -18,7 +18,7 @@
 #define BNXT_ULP_CLASS_HID_SHFTL 31
 #define BNXT_ULP_CLASS_HID_MASK 2047
 #define BNXT_ULP_ACT_SIG_TBL_MAX_SZ 4096
-#define BNXT_ULP_ACT_MATCH_LIST_MAX_SZ 78
+#define BNXT_ULP_ACT_MATCH_LIST_MAX_SZ 86
 #define BNXT_ULP_ACT_HID_LOW_PRIME 7919
 #define BNXT_ULP_ACT_HID_HIGH_PRIME 4721
 #define BNXT_ULP_ACT_HID_SHFTR 23
@@ -786,19 +786,23 @@ enum bnxt_ulp_act_hid {
 	BNXT_ULP_ACT_HID_015a = 0x015a,
 	BNXT_ULP_ACT_HID_00eb = 0x00eb,
 	BNXT_ULP_ACT_HID_0043 = 0x0043,
-	BNXT_ULP_ACT_HID_01d6 = 0x01d6,
+	BNXT_ULP_ACT_HID_03d8 = 0x03d8,
+	BNXT_ULP_ACT_HID_02c1 = 0x02c1,
 	BNXT_ULP_ACT_HID_015e = 0x015e,
 	BNXT_ULP_ACT_HID_00ef = 0x00ef,
 	BNXT_ULP_ACT_HID_0047 = 0x0047,
-	BNXT_ULP_ACT_HID_01da = 0x01da,
+	BNXT_ULP_ACT_HID_03dc = 0x03dc,
+	BNXT_ULP_ACT_HID_02c5 = 0x02c5,
 	BNXT_ULP_ACT_HID_025b = 0x025b,
 	BNXT_ULP_ACT_HID_01ec = 0x01ec,
 	BNXT_ULP_ACT_HID_0144 = 0x0144,
-	BNXT_ULP_ACT_HID_02d7 = 0x02d7,
+	BNXT_ULP_ACT_HID_04d9 = 0x04d9,
+	BNXT_ULP_ACT_HID_03c2 = 0x03c2,
 	BNXT_ULP_ACT_HID_025f = 0x025f,
 	BNXT_ULP_ACT_HID_01f0 = 0x01f0,
 	BNXT_ULP_ACT_HID_0148 = 0x0148,
-	BNXT_ULP_ACT_HID_02db = 0x02db,
+	BNXT_ULP_ACT_HID_04dd = 0x04dd,
+	BNXT_ULP_ACT_HID_03c6 = 0x03c6,
 	BNXT_ULP_ACT_HID_0000 = 0x0000,
 	BNXT_ULP_ACT_HID_0002 = 0x0002,
 	BNXT_ULP_ACT_HID_0800 = 0x0800,
@@ -829,19 +833,23 @@ enum bnxt_ulp_act_hid {
 	BNXT_ULP_ACT_HID_02f6 = 0x02f6,
 	BNXT_ULP_ACT_HID_04f8 = 0x04f8,
 	BNXT_ULP_ACT_HID_01df = 0x01df,
-	BNXT_ULP_ACT_HID_05e3 = 0x05e3,
+	BNXT_ULP_ACT_HID_07e5 = 0x07e5,
+	BNXT_ULP_ACT_HID_06ce = 0x06ce,
 	BNXT_ULP_ACT_HID_02fa = 0x02fa,
 	BNXT_ULP_ACT_HID_04fc = 0x04fc,
 	BNXT_ULP_ACT_HID_01e3 = 0x01e3,
-	BNXT_ULP_ACT_HID_05e7 = 0x05e7,
+	BNXT_ULP_ACT_HID_07e9 = 0x07e9,
+	BNXT_ULP_ACT_HID_06d2 = 0x06d2,
 	BNXT_ULP_ACT_HID_03f7 = 0x03f7,
 	BNXT_ULP_ACT_HID_05f9 = 0x05f9,
 	BNXT_ULP_ACT_HID_02e0 = 0x02e0,
-	BNXT_ULP_ACT_HID_06e4 = 0x06e4,
+	BNXT_ULP_ACT_HID_08e6 = 0x08e6,
+	BNXT_ULP_ACT_HID_07cf = 0x07cf,
 	BNXT_ULP_ACT_HID_03fb = 0x03fb,
 	BNXT_ULP_ACT_HID_05fd = 0x05fd,
 	BNXT_ULP_ACT_HID_02e4 = 0x02e4,
-	BNXT_ULP_ACT_HID_06e8 = 0x06e8,
+	BNXT_ULP_ACT_HID_08ea = 0x08ea,
+	BNXT_ULP_ACT_HID_07d3 = 0x07d3,
 	BNXT_ULP_ACT_HID_040d = 0x040d,
 	BNXT_ULP_ACT_HID_040f = 0x040f,
 	BNXT_ULP_ACT_HID_0413 = 0x0413,
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +2 -2
index 4388a0a..f2e2a59 100644
@@ -259,8 +259,8 @@ struct bnxt_ulp_rte_act_info ulp_act_info[] = {
 	.proto_act_func          = NULL
 	},
 	[RTE_FLOW_ACTION_TYPE_DEC_TTL] = {
-		.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,
-		.proto_act_func          = ulp_rte_dec_ttl_act_handler
+	.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,
+	.proto_act_func          = ulp_rte_dec_ttl_act_handler
 	},
 	[RTE_FLOW_ACTION_TYPE_SET_TTL] = {
 	.act_type                = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
Signature · 1 line
2.7.4
#29 lore raw

PATCH v2 8/20 net/bnxt: configure parif for the egress rules

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

The parif for the egress rules need to be dynamically configured based on the port type.

---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c         | 11 ++---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c            | 35 ++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_port_db.c           |  2 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c        | 54 ++++++++++++++++++++-----
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c   | 16 ++++++--
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c | 25 +++++++++---
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h  | 14 ++++---
 7 files changed, 123 insertions(+), 34 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +3 -8
index d86e4c9..ddc6da8 100644
@@ -81,17 +81,12 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx,
 	if (rc)
 		return rc;
 
-	if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
+	if (parif_type == BNXT_ULP_PHY_PORT_PARIF)
 		idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF;
-		/* Parif needs to be reset to a free partition */
-		parif += BNXT_ULP_FREE_PARIF_BASE;
-	} else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) {
+	else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF)
 		idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF;
-		/* Parif needs to be reset to a free partition */
-		parif += BNXT_ULP_FREE_PARIF_BASE;
-	} else {
+	else
 		idx = BNXT_ULP_CF_IDX_VF_FUNC_PARIF;
-	}
 
 	ULP_COMP_FLD_IDX_WR(mapper_params, idx, parif);
 
drivers/net/bnxt/tf_ulp/ulp_mapper.c +35 -0
index 2d3373d..a071c07 100644
@@ -998,6 +998,41 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 			return -EINVAL;
 		}
 		break;
+	case BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF:
+		if (!ulp_operand_read(fld->result_operand,
+				      (uint8_t *)&idx,
+				      sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "%s key operand read failed.\n", name);
+			return -EINVAL;
+		}
+		idx = tfp_be_to_cpu_16(idx);
+		if (idx >= BNXT_ULP_CF_IDX_LAST) {
+			BNXT_TF_DBG(ERR, "%s invalid index %u\n", name, idx);
+			return -EINVAL;
+		}
+		/* check if the computed field is set */
+		if (ULP_COMP_FLD_IDX_RD(parms, idx))
+			val = fld->result_operand_true;
+		else
+			val = fld->result_operand_false;
+
+		/* read the appropriate computed field */
+		if (!ulp_operand_read(val, (uint8_t *)&idx, sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "%s val operand read failed\n", name);
+			return -EINVAL;
+		}
+		idx = tfp_be_to_cpu_16(idx);
+		if (idx >= BNXT_ULP_CF_IDX_LAST) {
+			BNXT_TF_DBG(ERR, "%s invalid index %u\n", name, idx);
+			return -EINVAL;
+		}
+		val = ulp_blob_push_32(blob, &parms->comp_fld[idx],
+				       fld->field_bit_size);
+		if (!val) {
+			BNXT_TF_DBG(ERR, "%s push to key blob failed\n", name);
+			return -EINVAL;
+		}
+		break;
 	default:
 		BNXT_TF_DBG(ERR, "invalid result mapper opcode 0x%x\n",
 			    fld->result_opcode);
drivers/net/bnxt/tf_ulp/ulp_port_db.c +2 -0
index 0fc7c0a..3087647 100644
@@ -372,6 +372,8 @@ ulp_port_db_parif_get(struct bnxt_ulp_context *ulp_ctxt,
 		phy_port_id = port_db->ulp_func_id_tbl[func_id].phy_port_id;
 		*parif = port_db->phy_port_list[phy_port_id].port_parif;
 	}
+	/* Parif needs to be reset to a free partition */
+	*parif += BNXT_ULP_FREE_PARIF_BASE;
 
 	return 0;
 }
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +43 -11

74 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +12 -4
index 31fe905..58b581c 100644
@@ -1808,11 +1808,19 @@ struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_CONST_ELSE_CONST,
 	.result_operand = {
-		BNXT_ULP_SYM_DECAP_FUNC_THRU_TUN,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 56) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 48) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 40) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 32) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 24) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 16) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 8) & 0xff,
+		(uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 12,
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +20 -5
index 9de45cd..330c5ec 100644
@@ -5058,7 +5058,9 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 2,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
 	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
 	.spec_operand = {0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
@@ -5149,7 +5151,9 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 2,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
 	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
 	.spec_operand = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
@@ -17054,11 +17058,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +8 -6
index c9fe1bc..f08065b 100644
@@ -127,11 +127,12 @@ enum bnxt_ulp_cf_idx {
 	BNXT_ULP_CF_IDX_ACT_PORT_IS_SET = 35,
 	BNXT_ULP_CF_IDX_ACT_PORT_TYPE = 36,
 	BNXT_ULP_CF_IDX_MATCH_PORT_TYPE = 37,
-	BNXT_ULP_CF_IDX_VF_TO_VF = 38,
-	BNXT_ULP_CF_IDX_L3_HDR_CNT = 39,
-	BNXT_ULP_CF_IDX_L4_HDR_CNT = 40,
-	BNXT_ULP_CF_IDX_VFR_MODE = 41,
-	BNXT_ULP_CF_IDX_LAST = 42
+	BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP = 38,
+	BNXT_ULP_CF_IDX_VF_TO_VF = 39,
+	BNXT_ULP_CF_IDX_L3_HDR_CNT = 40,
+	BNXT_ULP_CF_IDX_L4_HDR_CNT = 41,
+	BNXT_ULP_CF_IDX_VFR_MODE = 42,
+	BNXT_ULP_CF_IDX_LAST = 43
 };
 
 enum bnxt_ulp_cond_opcode {
@@ -215,7 +216,8 @@ enum bnxt_ulp_mapper_opc {
 	BNXT_ULP_MAPPER_OPC_SET_TO_ENCAP_ACT_PROP_SZ = 8,
 	BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_ACT_PROP_ELSE_CONST = 9,
 	BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_CONST_ELSE_CONST = 10,
-	BNXT_ULP_MAPPER_OPC_LAST = 11
+	BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF = 11,
+	BNXT_ULP_MAPPER_OPC_LAST = 12
 };
 
 enum bnxt_ulp_mark_db_opcode {
Signature · 1 line
2.7.4
#30 lore raw

PATCH v2 9/20 net/bnxt: ignore VLAN priority mask

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

This is a work around for the OVS setting offload rules that are passing vlan priority mask as wild card and currently we do not support it.

---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +9 -0
index 67f9319..665f5d3 100644
@@ -709,8 +709,17 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,
 			vlan_tag |= ~ULP_VLAN_TAG_MASK;
 		vlan_tag = htons(vlan_tag);
 
+#ifdef ULP_DONT_IGNORE_TOS
 		ulp_rte_prsr_mask_copy(params, &idx, &priority,
 				       sizeof(priority));
+#else
+		/*
+		 * The priority field is ignored since OVS is setting it as
+		 * wild card match and it is not supported. This is a work
+		 * around and shall be addressed in the future.
+		 */
+		idx += 1;
+#endif
 		ulp_rte_prsr_mask_copy(params, &idx, &vlan_tag,
 				       sizeof(vlan_tag));
 		ulp_rte_prsr_mask_copy(params, &idx, &vlan_mask->inner_type,
Signature · 1 line
2.7.4
#31 lore raw

PATCH v2 10/20 net/bnxt: add egress template with VLAN tag match

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

Added egress template with VLAN tag match

---
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c | 501 +++++++++++++++++++++++-
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h  |  28 +-
 2 files changed, 509 insertions(+), 20 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +483 -18
index 330c5ec..41d1d87 100644
@@ -162,7 +162,31 @@ uint16_t ulp_class_sig_tbl[BNXT_ULP_CLASS_SIG_TBL_MAX_SZ] = {
 	[BNXT_ULP_CLASS_HID_01d1] = 151,
 	[BNXT_ULP_CLASS_HID_0319] = 152,
 	[BNXT_ULP_CLASS_HID_01cd] = 153,
-	[BNXT_ULP_CLASS_HID_0305] = 154
+	[BNXT_ULP_CLASS_HID_0305] = 154,
+	[BNXT_ULP_CLASS_HID_01e2] = 155,
+	[BNXT_ULP_CLASS_HID_032a] = 156,
+	[BNXT_ULP_CLASS_HID_0650] = 157,
+	[BNXT_ULP_CLASS_HID_0198] = 158,
+	[BNXT_ULP_CLASS_HID_01de] = 159,
+	[BNXT_ULP_CLASS_HID_0316] = 160,
+	[BNXT_ULP_CLASS_HID_066c] = 161,
+	[BNXT_ULP_CLASS_HID_01a4] = 162,
+	[BNXT_ULP_CLASS_HID_01c2] = 163,
+	[BNXT_ULP_CLASS_HID_030a] = 164,
+	[BNXT_ULP_CLASS_HID_0670] = 165,
+	[BNXT_ULP_CLASS_HID_01b8] = 166,
+	[BNXT_ULP_CLASS_HID_003e] = 167,
+	[BNXT_ULP_CLASS_HID_02f6] = 168,
+	[BNXT_ULP_CLASS_HID_078c] = 169,
+	[BNXT_ULP_CLASS_HID_0044] = 170,
+	[BNXT_ULP_CLASS_HID_01d2] = 171,
+	[BNXT_ULP_CLASS_HID_031a] = 172,
+	[BNXT_ULP_CLASS_HID_0660] = 173,
+	[BNXT_ULP_CLASS_HID_01a8] = 174,
+	[BNXT_ULP_CLASS_HID_01ce] = 175,
+	[BNXT_ULP_CLASS_HID_0306] = 176,
+	[BNXT_ULP_CLASS_HID_067c] = 177,
+	[BNXT_ULP_CLASS_HID_01b4] = 178
 };
 
 struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
@@ -2833,6 +2857,382 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	.class_tid = 21,
 	.wc_pri = 11
+	},
+	[155] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01e2,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 12
+	},
+	[156] = {
+	.class_hid = BNXT_ULP_CLASS_HID_032a,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 13
+	},
+	[157] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0650,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 14
+	},
+	[158] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0198,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 15
+	},
+	[159] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01de,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 16
+	},
+	[160] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0316,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 17
+	},
+	[161] = {
+	.class_hid = BNXT_ULP_CLASS_HID_066c,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 18
+	},
+	[162] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01a4,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 19
+	},
+	[163] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01c2,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 20
+	},
+	[164] = {
+	.class_hid = BNXT_ULP_CLASS_HID_030a,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 21
+	},
+	[165] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0670,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 22
+	},
+	[166] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01b8,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 23
+	},
+	[167] = {
+	.class_hid = BNXT_ULP_CLASS_HID_003e,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 24
+	},
+	[168] = {
+	.class_hid = BNXT_ULP_CLASS_HID_02f6,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 25
+	},
+	[169] = {
+	.class_hid = BNXT_ULP_CLASS_HID_078c,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 26
+	},
+	[170] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0044,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 27
+	},
+	[171] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01d2,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 28
+	},
+	[172] = {
+	.class_hid = BNXT_ULP_CLASS_HID_031a,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 29
+	},
+	[173] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0660,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 30
+	},
+	[174] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01a8,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 31
+	},
+	[175] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01ce,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 32
+	},
+	[176] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0306,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 33
+	},
+	[177] = {
+	.class_hid = BNXT_ULP_CLASS_HID_067c,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 34
+	},
+	[178] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01b4,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 35
 	}
 };
 
@@ -3236,7 +3636,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
-	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
+	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -3255,7 +3655,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
-	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
+	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -3346,7 +3746,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
-	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
+	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -12534,8 +12934,18 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 12,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
-	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_HDR_FIELD,
+	.mask_operand = {
+		(BNXT_ULP_HF21_IDX_OO_VLAN_VID >> 8) & 0xff,
+		BNXT_ULP_HF21_IDX_OO_VLAN_VID & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_HDR_FIELD,
+	.spec_operand = {
+		(BNXT_ULP_HF21_IDX_OO_VLAN_VID >> 8) & 0xff,
+		BNXT_ULP_HF21_IDX_OO_VLAN_VID & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 12,
@@ -12594,8 +13004,15 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 2,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
-	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
+	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_COMP_FIELD,
+	.spec_operand = {
+		(BNXT_ULP_CF_IDX_O_VTAG_NUM >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_O_VTAG_NUM & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 2,
@@ -16307,11 +16724,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
@@ -16498,11 +16926,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
@@ -16689,7 +17128,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
+	.result_operand = {
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
@@ -16876,11 +17330,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +26 -2
index f08065b..ac651f6 100644
@@ -11,7 +11,7 @@
 #define BNXT_ULP_LOG2_MAX_NUM_DEV 2
 #define BNXT_ULP_CACHE_TBL_MAX_SZ 4
 #define BNXT_ULP_CLASS_SIG_TBL_MAX_SZ 2048
-#define BNXT_ULP_CLASS_MATCH_LIST_MAX_SZ 155
+#define BNXT_ULP_CLASS_MATCH_LIST_MAX_SZ 179
 #define BNXT_ULP_CLASS_HID_LOW_PRIME 7919
 #define BNXT_ULP_CLASS_HID_HIGH_PRIME 7907
 #define BNXT_ULP_CLASS_HID_SHFTR 32
@@ -781,7 +781,31 @@ enum bnxt_ulp_class_hid {
 	BNXT_ULP_CLASS_HID_01d1 = 0x01d1,
 	BNXT_ULP_CLASS_HID_0319 = 0x0319,
 	BNXT_ULP_CLASS_HID_01cd = 0x01cd,
-	BNXT_ULP_CLASS_HID_0305 = 0x0305
+	BNXT_ULP_CLASS_HID_0305 = 0x0305,
+	BNXT_ULP_CLASS_HID_01e2 = 0x01e2,
+	BNXT_ULP_CLASS_HID_032a = 0x032a,
+	BNXT_ULP_CLASS_HID_0650 = 0x0650,
+	BNXT_ULP_CLASS_HID_0198 = 0x0198,
+	BNXT_ULP_CLASS_HID_01de = 0x01de,
+	BNXT_ULP_CLASS_HID_0316 = 0x0316,
+	BNXT_ULP_CLASS_HID_066c = 0x066c,
+	BNXT_ULP_CLASS_HID_01a4 = 0x01a4,
+	BNXT_ULP_CLASS_HID_01c2 = 0x01c2,
+	BNXT_ULP_CLASS_HID_030a = 0x030a,
+	BNXT_ULP_CLASS_HID_0670 = 0x0670,
+	BNXT_ULP_CLASS_HID_01b8 = 0x01b8,
+	BNXT_ULP_CLASS_HID_003e = 0x003e,
+	BNXT_ULP_CLASS_HID_02f6 = 0x02f6,
+	BNXT_ULP_CLASS_HID_078c = 0x078c,
+	BNXT_ULP_CLASS_HID_0044 = 0x0044,
+	BNXT_ULP_CLASS_HID_01d2 = 0x01d2,
+	BNXT_ULP_CLASS_HID_031a = 0x031a,
+	BNXT_ULP_CLASS_HID_0660 = 0x0660,
+	BNXT_ULP_CLASS_HID_01a8 = 0x01a8,
+	BNXT_ULP_CLASS_HID_01ce = 0x01ce,
+	BNXT_ULP_CLASS_HID_0306 = 0x0306,
+	BNXT_ULP_CLASS_HID_067c = 0x067c,
+	BNXT_ULP_CLASS_HID_01b4 = 0x01b4
 };
 
 enum bnxt_ulp_act_hid {
Signature · 1 line
2.7.4
#32 lore raw

PATCH v2 11/20 net/bnxt: modify tf shadow tcam to use common tf hash

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Removed the hash calculation from tf_shadow_tcam in favor of using a new common implementation.

---
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 77 +------------------------------
 1 file changed, 2 insertions(+), 75 deletions(-)
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +2 -75
index 51aae4f..beaea03 100644
@@ -7,6 +7,7 @@
 #include "tf_util.h"
 #include "tfp.h"
 #include "tf_shadow_tcam.h"
+#include "tf_hash.h"
 
 /**
  * The implementation includes 3 tables per tcam table type.
@@ -164,74 +165,6 @@ struct tf_shadow_tcam_db {
 	struct tf_shadow_tcam_ctxt *ctxt[TF_TCAM_TBL_TYPE_MAX];
 };
 
-/* CRC polynomial 0xedb88320 */
-static const uint32_t tf_shadow_tcam_crc32tbl[] = {
-	0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
-	0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
-	0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
-	0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
-	0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
-	0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
-	0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
-	0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
-	0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
-	0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
-	0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
-	0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
-	0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
-	0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
-	0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
-	0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
-	0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
-	0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
-	0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
-	0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
-	0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
-	0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
-	0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
-	0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
-	0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
-	0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
-	0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
-	0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
-	0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
-	0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
-	0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
-	0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
-	0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
-	0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
-	0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
-	0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
-	0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
-	0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
-	0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
-	0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
-	0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
-	0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
-	0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
-	0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
-	0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
-	0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
-	0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
-	0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
-	0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
-	0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
-	0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
-	0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
-	0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
-	0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
-	0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
-	0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
-	0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
-	0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
-	0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
-	0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
-	0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
-	0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
-	0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
-	0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
-};
-
 /**
  * Returns the number of entries in the contexts shadow table.
  */
@@ -289,13 +222,7 @@ tf_shadow_tcam_res_cpy(struct tf_shadow_tcam_ctxt *ctxt,
 static uint32_t
 tf_shadow_tcam_crc32_calc(uint8_t *key, uint32_t len)
 {
-	uint32_t crc = ~0U;
-
-	while (len--)
-		crc = tf_shadow_tcam_crc32tbl[(crc ^ key[len]) & 0xff] ^
-			(crc >> 8);
-
-	return ~crc;
+	return tf_hash_calc_crc32(key, len);
 }
 
 /**
Signature · 1 line
2.7.4
#33 lore raw

PATCH v2 12/20 net/bnxt: added shadow table capability with search

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

- Added Index Table shadow tables for searching
- Added Search API to allow reuse of Table entries

---
 drivers/net/bnxt/tf_core/tf_core.c        |  66 ++-
 drivers/net/bnxt/tf_core/tf_core.h        |  79 ++-
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   2 +-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c  | 768 +++++++++++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.h  | 124 ++---
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c |   6 +
 drivers/net/bnxt/tf_core/tf_tbl.c         | 246 +++++++++-
 drivers/net/bnxt/tf_core/tf_tbl.h         |  22 +-
 drivers/net/bnxt/tf_core/tf_tcam.h        |   2 +-
 9 files changed, 1211 insertions(+), 104 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +65 -1
index ca3280b..0dbde1d 100644
@@ -75,7 +75,6 @@ tf_open_session(struct tf *tfp,
 	/* Session vs session client is decided in
 	 * tf_session_open_session()
 	 */
-	printf("TF_OPEN, %s\n", parms->ctrl_chan_name);
 	rc = tf_session_open_session(tfp, &oparms);
 	/* Logging handled by tf_session_open_session */
 	if (rc)
@@ -954,6 +953,71 @@ tf_alloc_tbl_entry(struct tf *tfp,
 }
 
 int
+tf_search_tbl_entry(struct tf *tfp,
+		    struct tf_search_tbl_entry_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+	struct tf_tbl_alloc_search_parms sparms;
+
+	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_alloc_search_tbl == NULL) {
+		rc = -EOPNOTSUPP;
+		TFP_DRV_LOG(ERR,
+			    "%s: Operation not supported, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	memset(&sparms, 0, sizeof(struct tf_tbl_alloc_search_parms));
+	sparms.dir = parms->dir;
+	sparms.type = parms->type;
+	sparms.result = parms->result;
+	sparms.result_sz_in_bytes = parms->result_sz_in_bytes;
+	sparms.alloc = parms->alloc;
+	sparms.tbl_scope_id = parms->tbl_scope_id;
+	rc = dev->ops->tf_dev_alloc_search_tbl(tfp, &sparms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: TBL allocation failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Return the outputs from the search */
+	parms->hit = sparms.hit;
+	parms->search_status = sparms.search_status;
+	parms->ref_cnt = sparms.ref_cnt;
+	parms->idx = sparms.idx;
+
+	return 0;
+}
+
+int
 tf_free_tbl_entry(struct tf *tfp,
 		  struct tf_free_tbl_entry_parms *parms)
 {
drivers/net/bnxt/tf_core/tf_core.h +76 -3

98 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device_p4.c +1 -1
index afb6098..fe8dec3 100644
@@ -126,7 +126,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_alloc_ext_tbl = tf_tbl_ext_alloc,
 	.tf_dev_free_tbl = tf_tbl_free,
 	.tf_dev_free_ext_tbl = tf_tbl_ext_free,
-	.tf_dev_alloc_search_tbl = NULL,
+	.tf_dev_alloc_search_tbl = tf_tbl_alloc_search,
 	.tf_dev_set_tbl = tf_tbl_set,
 	.tf_dev_set_ext_tbl = tf_tbl_ext_common_set,
 	.tf_dev_get_tbl = tf_tbl_get,
drivers/net/bnxt/tf_core/tf_shadow_tbl.c +746 -22

807 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tbl.h +70 -54

212 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tcam.c +6 -0
index beaea03..a0130d6 100644
@@ -373,6 +373,12 @@ tf_shadow_tcam_clear_hash_entry(struct tf_shadow_tcam_ctxt *ctxt,
 	case 3:
 		*bucket = TF_SHADOW_TCAM_BE2_MASK_CLEAR(*bucket);
 		break;
+	default:
+		/*
+		 * Since the BE_GET masks non-inclusive bits, this will not
+		 * happen.
+		 */
+		break;
 	}
 }
 
drivers/net/bnxt/tf_core/tf_tbl.c +234 -12

324 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tbl.h +12 -10
index f20e8d7..930fcc3 100644
@@ -144,29 +144,31 @@ struct tf_tbl_alloc_search_parms {
 	 */
 	uint32_t tbl_scope_id;
 	/**
-	 * [in] Enable search for matching entry. If the table type is
-	 * internal the shadow copy will be searched before
-	 * alloc. Session must be configured with shadow copy enabled.
-	 */
-	uint8_t search_enable;
-	/**
-	 * [in] Result data to search for (if search_enable)
+	 * [in] Result data to search for
 	 */
 	uint8_t *result;
 	/**
-	 * [in] Result data size in bytes (if search_enable)
+	 * [in] Result data size in bytes
 	 */
 	uint16_t result_sz_in_bytes;
 	/**
+	 * [in] Whether or not to allocate on MISS, 1 is allocate.
+	 */
+	uint8_t alloc;
+	/**
 	 * [out] If search_enable, set if matching entry found
 	 */
 	uint8_t hit;
 	/**
-	 * [out] Current ref count after allocation (if search_enable)
+	 * [out] The status of the search (REJECT, MISS, HIT)
+	 */
+	enum tf_search_status search_status;
+	/**
+	 * [out] Current ref count after allocation
 	 */
 	uint16_t ref_cnt;
 	/**
-	 * [out] Idx of allocated entry or found entry (if search_enable)
+	 * [out] Idx of allocated entry or found entry
 	 */
 	uint32_t idx;
 };
drivers/net/bnxt/tf_core/tf_tcam.h +1 -1
index 4722ce0..ffa0a94 100644
@@ -134,7 +134,7 @@ struct tf_tcam_alloc_search_parms {
 	/**
 	 * [out] Search result status (hit, miss, reject)
 	 */
-	enum tf_tcam_search_status search_status;
+	enum tf_search_status search_status;
 	/**
 	 * [out] Current refcnt after allocation
 	 */
Signature · 1 line
2.7.4
#34 lore raw

PATCH v2 13/20 net/bnxt: ulp mapper changes to use tbl search

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

modified ulp mappper to use the new tf_search_tbl_entry API. When search before allocation is requested, mapper calls tc_search_tbl_entry with the alloc flag.

- On HIT, the result and table index is returned.
- On MISS, the table index is returned but the result is created and the table entry is set.
- On REJECT, the flow request is rejected.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c | 75 ++++++++++++++++++++++++------------
 1 file changed, 51 insertions(+), 24 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +51 -24
index a071c07..4dee659 100644
@@ -1764,9 +1764,10 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	struct ulp_blob	data;
 	uint64_t idx = 0;
 	uint16_t tmplen;
-	uint32_t i, num_flds;
+	uint32_t i, num_flds, index, hit;
 	int32_t rc = 0, trc = 0;
 	struct tf_alloc_tbl_entry_parms	aparms = { 0 };
+	struct tf_search_tbl_entry_parms srchparms = { 0 };
 	struct tf_set_tbl_entry_parms	sparms = { 0 };
 	struct tf_free_tbl_entry_parms	free_parms = { 0 };
 	uint32_t tbl_scope_id;
@@ -1868,33 +1869,59 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		return 0; /* success */
 	}
 
+	index = 0;
+	hit = 0;
 	/* Perform the tf table allocation by filling the alloc params */
-	aparms.dir		= tbl->direction;
-	aparms.type		= tbl->resource_type;
-	aparms.search_enable	= tbl->srch_b4_alloc;
-	aparms.result		= ulp_blob_data_get(&data, &tmplen);
-	aparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
-	aparms.tbl_scope_id	= tbl_scope_id;
-
-	/* All failures after the alloc succeeds require a free */
-	rc = tf_alloc_tbl_entry(tfp, &aparms);
-	if (rc) {
-		BNXT_TF_DBG(ERR, "Alloc table[%d][%s] failed rc=%d\n",
-			    aparms.type,
-			    (aparms.dir == TF_DIR_RX) ? "RX" : "TX",
-			    rc);
-		return rc;
-	}
+	if (tbl->srch_b4_alloc) {
+		memset(&srchparms, 0, sizeof(srchparms));
+		srchparms.dir = tbl->direction;
+		srchparms.type = tbl->resource_type;
+		srchparms.alloc	= 1;
+		srchparms.result = ulp_blob_data_get(&data, &tmplen);
+		srchparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
+		srchparms.tbl_scope_id = tbl_scope_id;
+		rc = tf_search_tbl_entry(tfp, &srchparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Alloc table[%s][%s] failed rc=%d\n",
+				    tf_tbl_type_2_str(tbl->resource_type),
+				    tf_dir_2_str(tbl->direction), rc);
+			return rc;
+		}
+		if (srchparms.search_status == REJECT) {
+			BNXT_TF_DBG(ERR, "Alloc table[%s][%s] rejected.\n",
+				    tf_tbl_type_2_str(tbl->resource_type),
+				    tf_dir_2_str(tbl->direction));
+			return -ENOMEM;
+		}
+		index = srchparms.idx;
+		hit = srchparms.hit;
+	} else {
+		aparms.dir		= tbl->direction;
+		aparms.type		= tbl->resource_type;
+		aparms.search_enable	= tbl->srch_b4_alloc;
+		aparms.result		= ulp_blob_data_get(&data, &tmplen);
+		aparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
+		aparms.tbl_scope_id	= tbl_scope_id;
 
+		/* All failures after the alloc succeeds require a free */
+		rc = tf_alloc_tbl_entry(tfp, &aparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Alloc table[%s][%s] failed rc=%d\n",
+				    tf_tbl_type_2_str(tbl->resource_type),
+				    tf_dir_2_str(tbl->direction), rc);
+			return rc;
+		}
+		index = aparms.idx;
+	}
 	/*
 	 * calculate the idx for the result record, for external EM the offset
 	 * needs to be shifted accordingly. If external non-inline table types
 	 * are used then need to revisit this logic.
 	 */
-	if (aparms.type == TF_TBL_TYPE_EXT)
-		idx = TF_ACT_REC_OFFSET_2_PTR(aparms.idx);
+	if (tbl->resource_type == TF_TBL_TYPE_EXT)
+		idx = TF_ACT_REC_OFFSET_2_PTR(index);
 	else
-		idx = aparms.idx;
+		idx = index;
 
 	/* Always storing values in Regfile in BE */
 	idx = tfp_cpu_to_be_64(idx);
@@ -1908,12 +1935,12 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	}
 
 	/* Perform the tf table set by filling the set params */
-	if (!tbl->srch_b4_alloc || !aparms.hit) {
+	if (!tbl->srch_b4_alloc || !hit) {
 		sparms.dir		= tbl->direction;
 		sparms.type		= tbl->resource_type;
 		sparms.data		= ulp_blob_data_get(&data, &tmplen);
 		sparms.data_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
-		sparms.idx		= aparms.idx;
+		sparms.idx		= index;
 		sparms.tbl_scope_id	= tbl_scope_id;
 
 		rc = tf_set_tbl_entry(tfp, &sparms);
@@ -1933,7 +1960,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	fid_parms.resource_func	= tbl->resource_func;
 	fid_parms.resource_type	= tbl->resource_type;
 	fid_parms.resource_sub_type = tbl->resource_sub_type;
-	fid_parms.resource_hndl	= aparms.idx;
+	fid_parms.resource_hndl	= index;
 	fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
 
 	rc = ulp_flow_db_resource_add(parms->ulp_ctx,
@@ -1960,7 +1987,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	 */
 	free_parms.dir	= tbl->direction;
 	free_parms.type	= tbl->resource_type;
-	free_parms.idx	= aparms.idx;
+	free_parms.idx	= index;
 	free_parms.tbl_scope_id = tbl_scope_id;
 
 	trc = tf_free_tbl_entry(tfp, &free_parms);
Signature · 1 line
2.7.4
#35 lore raw

PATCH v2 14/20 net/bnxt: fix port default rule create and destroy

In reply to Somnath Kotur

From: Venkat Duvvuru <[email protected]>

Currently, the flow_ids of port_to_app/app_to_port & tx_cfa_action for the first port are getting over-written by the second port because these fields are stored in the ulp context which is common across the ports.

This patch fixes the problem by having per port structure to store these fields.

Fixes 9f702636d7ba ("net/bnxt: add port default rules for ingress and egress")
---
 drivers/net/bnxt/bnxt.h                 |   5 +-
 drivers/net/bnxt/bnxt_ethdev.c          |  81 ++--------------------
 drivers/net/bnxt/bnxt_txq.h             |   1 -
 drivers/net/bnxt/bnxt_txr.c             |   6 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c      |  12 +++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h      |  14 +++-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 116 ++++++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c   |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h   |   2 +-
 9 files changed, 151 insertions(+), 88 deletions(-)
drivers/net/bnxt/bnxt.h +4 -1
index 50f93ff..41e7ae5 100644
@@ -784,6 +784,7 @@ struct bnxt {
 	struct bnxt_flow_stat_info *flow_stat;
 	uint8_t			flow_xstat;
 	uint16_t		max_num_kflows;
+	uint16_t		tx_cfa_action;
 };
 
 #define BNXT_FC_TIMER	1 /* Timer freq in Sec Flow Counters */
@@ -797,7 +798,7 @@ struct bnxt_vf_representor {
 	uint16_t		fw_fid;
 	uint16_t		dflt_vnic_id;
 	uint16_t		svif;
-	uint32_t		vfr_tx_cfa_action;
+	uint16_t		vfr_tx_cfa_action;
 	uint16_t		rx_cfa_code;
 	uint32_t		rep2vf_flow_id;
 	uint32_t		vf2rep_flow_id;
@@ -872,6 +873,8 @@ extern int bnxt_logtype_driver;
 extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;
 int32_t bnxt_ulp_init(struct bnxt *bp);
 void bnxt_ulp_deinit(struct bnxt *bp);
+int32_t bnxt_ulp_create_df_rules(struct bnxt *bp);
+void bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global);
 
 uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
 uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif,
drivers/net/bnxt/bnxt_ethdev.c +5 -76

111 lines not on this page · raw message

drivers/net/bnxt/bnxt_txq.h +0 -1
index a1ab3f3..83a9853 100644
@@ -29,7 +29,6 @@ struct bnxt_tx_queue {
 	struct bnxt		*bp;
 	int			index;
 	int			tx_wake_thresh;
-	uint32_t                tx_cfa_action;
 	uint32_t		vfr_tx_cfa_action;
 	struct bnxt_tx_ring_info	*tx_ring;
 
drivers/net/bnxt/bnxt_txr.c +2 -4
index c741c71..1113aca 100644
@@ -133,8 +133,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 				PKT_TX_TUNNEL_GENEVE | PKT_TX_IEEE1588_TMST |
 				PKT_TX_QINQ_PKT) ||
 	     (BNXT_TRUFLOW_EN(txq->bp) &&
-	      (txq->bp->ulp_ctx->cfg_data->tx_cfa_action ||
-	       txq->vfr_tx_cfa_action)))
+	      (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action)))
 		long_bd = true;
 
 	nr_bds = long_bd + tx_pkt->nb_segs;
@@ -192,8 +191,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 			if (txq->vfr_tx_cfa_action)
 				cfa_action = txq->vfr_tx_cfa_action;
 			else
-				cfa_action =
-				      txq->bp->ulp_ctx->cfg_data->tx_cfa_action;
+				cfa_action = txq->bp->tx_cfa_action;
 		}
 
 		/* HW can accelerate only outer vlan in QinQ mode */
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +11 -1
index 7c65a4b..2febd58 100644
@@ -9,9 +9,9 @@
 #include <rte_flow_driver.h>
 #include <rte_tailq.h>
 
+#include "bnxt.h"
 #include "bnxt_ulp.h"
 #include "bnxt_tf_common.h"
-#include "bnxt.h"
 #include "tf_core.h"
 #include "tf_ext_flow_handle.h"
 
@@ -381,6 +381,7 @@ ulp_ctx_init(struct bnxt *bp,
 		(void)ulp_ctx_deinit(bp, session);
 		return rc;
 	}
+
 	bnxt_ulp_cntxt_tfp_set(bp->ulp_ctx, session->g_tfp);
 	return rc;
 }
@@ -654,6 +655,9 @@ bnxt_ulp_init(struct bnxt *bp)
 	bool init;
 	int rc;
 
+	if (!BNXT_TRUFLOW_EN(bp))
+		return 0;
+
 	if (bp->ulp_ctx) {
 		BNXT_TF_DBG(DEBUG, "ulp ctx already allocated\n");
 		return -EINVAL;
@@ -822,6 +826,9 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	struct rte_pci_device		*pci_dev;
 	struct rte_pci_addr		*pci_addr;
 
+	if (!BNXT_TRUFLOW_EN(bp))
+		return;
+
 	/* Get the session first */
 	pci_dev = RTE_DEV_TO_PCI(bp->eth_dev->device);
 	pci_addr = &pci_dev->addr;
@@ -833,6 +840,9 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	if (!session)
 		return;
 
+	/* clean up default flows */
+	bnxt_ulp_destroy_df_rules(bp, true);
+
 	/* clean up regular flows */
 	ulp_flow_db_flush_flows(bp->ulp_ctx, BNXT_ULP_REGULAR_FLOW_TABLE);
 
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +11 -3
index 7c95ead..d532452 100644
@@ -22,6 +22,12 @@
 #define BNXT_ULP_VF_REP_ENABLED		0x1
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
 
+struct bnxt_ulp_df_rule_info {
+	uint32_t			port_to_app_flow_id;
+	uint32_t			app_to_port_flow_id;
+	uint8_t				valid;
+};
+
 struct bnxt_ulp_data {
 	uint32_t			tbl_scope_id;
 	struct bnxt_ulp_mark_tbl	*mark_tbl;
@@ -32,9 +38,7 @@ struct bnxt_ulp_data {
 	struct bnxt_ulp_port_db		*port_db;
 	struct bnxt_ulp_fc_info		*fc_info;
 	uint32_t			ulp_flags;
-	uint32_t			port_to_app_flow_id;
-	uint32_t			app_to_port_flow_id;
-	uint32_t			tx_cfa_action;
+	struct bnxt_ulp_df_rule_info   df_rule_info[RTE_MAX_ETHPORTS];
 };
 
 struct bnxt_ulp_context {
@@ -175,4 +179,8 @@ int32_t
 bnxt_ulp_cntxt_ptr2_ulp_flags_get(struct bnxt_ulp_context *ulp_ctx,
 				  uint32_t *flags);
 
+int32_t
+bnxt_ulp_get_df_rule_info(uint8_t port_id, struct bnxt_ulp_context *ulp_ctx,
+			  struct bnxt_ulp_df_rule_info *info);
+
 #endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +116 -0

119 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_flow_db.c +1 -1
index a3cfe54..7144517 100644
@@ -962,7 +962,7 @@ ulp_flow_db_resource_hndl_get(struct bnxt_ulp_context *ulp_ctx,
 int32_t
 ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
 				   uint32_t flow_id,
-				   uint32_t *cfa_action)
+				   uint16_t *cfa_action)
 {
 	uint8_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_VFR_CFA_ACTION;
 	uint64_t hndl;
drivers/net/bnxt/tf_ulp/ulp_flow_db.h +1 -1
index 1fc0601..117e250 100644
@@ -234,7 +234,7 @@ ulp_flow_db_validate_flow_func(struct bnxt_ulp_context *ulp_ctx,
 int32_t
 ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
 				   uint32_t flow_id,
-				   uint32_t *cfa_action);
+				   uint16_t *cfa_action);
 
 #ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
 /*
Signature · 1 line
2.7.4
#36 lore raw

PATCH v2 15/20 net/bnxt: delete VF FW rules when a representor is created

In reply to Somnath Kotur

From: Venkat Duvvuru <[email protected]>

Truflow stack adds VFR to VF and VF to VFR conduits when VF representor is created. However, in the ingress direction the VF's fw rules conflict with Truflow rules, resulting in not hitting the Truflow VFR rules. To fix this, fw is going to remove it’s VF rules when vf representor is created in Truflow mode and will restore the removed rules when vf representor is destroyed.

This patch invokes the vf representor alloc and free hwrm commands as part of which fw will do the above mentioned actions.

---
 drivers/net/bnxt/bnxt_hwrm.c           |  49 ++++++++++++
 drivers/net/bnxt/bnxt_hwrm.h           |   2 +
 drivers/net/bnxt/bnxt_reps.c           |  19 ++++-
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 138 +++++++++++++++++++++++++++++++++
 4 files changed, 205 insertions(+), 3 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +49 -0
index 7ea13a8..f5f0dfe 100644
@@ -5486,6 +5486,55 @@ int bnxt_hwrm_cfa_counter_qstats(struct bnxt *bp,
 	return 0;
 }
 
+int bnxt_hwrm_cfa_vfr_alloc(struct bnxt *bp, uint16_t vf_idx)
+{
+	struct hwrm_cfa_vfr_alloc_output *resp = bp->hwrm_cmd_resp_addr;
+	struct hwrm_cfa_vfr_alloc_input req = {0};
+	int rc;
+
+	if (!(BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))) {
+		PMD_DRV_LOG(DEBUG,
+			    "Not a PF or trusted VF. Command not supported\n");
+		return 0;
+	}
+
+	HWRM_PREP(&req, HWRM_CFA_VFR_ALLOC, BNXT_USE_CHIMP_MB);
+	req.vf_id = rte_cpu_to_le_16(vf_idx);
+	snprintf(req.vfr_name, sizeof(req.vfr_name), "%svfr%d",
+		 bp->eth_dev->data->name, vf_idx);
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+	HWRM_CHECK_RESULT();
+
+	HWRM_UNLOCK();
+	PMD_DRV_LOG(DEBUG, "VFR %d allocated\n", vf_idx);
+	return rc;
+}
+
+int bnxt_hwrm_cfa_vfr_free(struct bnxt *bp, uint16_t vf_idx)
+{
+	struct hwrm_cfa_vfr_free_output *resp = bp->hwrm_cmd_resp_addr;
+	struct hwrm_cfa_vfr_free_input req = {0};
+	int rc;
+
+	if (!(BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))) {
+		PMD_DRV_LOG(DEBUG,
+			    "Not a PF or trusted VF. Command not supported\n");
+		return 0;
+	}
+
+	HWRM_PREP(&req, HWRM_CFA_VFR_FREE, BNXT_USE_CHIMP_MB);
+	req.vf_id = rte_cpu_to_le_16(vf_idx);
+	snprintf(req.vfr_name, sizeof(req.vfr_name), "%svfr%d",
+		 bp->eth_dev->data->name, vf_idx);
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+	HWRM_CHECK_RESULT();
+	HWRM_UNLOCK();
+	PMD_DRV_LOG(DEBUG, "VFR %d freed\n", vf_idx);
+	return rc;
+}
+
 #ifdef RTE_LIBRTE_BNXT_PMD_SYSTEM
 int
 bnxt_hwrm_oem_cmd(struct bnxt *bp, uint32_t entry_num)
drivers/net/bnxt/bnxt_hwrm.h +2 -0
index 01201a7..4a2af13 100644
@@ -278,4 +278,6 @@ int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp);
 int bnxt_hwrm_oem_cmd(struct bnxt *bp, uint32_t entry_num);
 int bnxt_clear_one_vnic_filter(struct bnxt *bp,
 			       struct bnxt_filter_info *filter);
+int bnxt_hwrm_cfa_vfr_alloc(struct bnxt *bp, uint16_t vf_idx);
+int bnxt_hwrm_cfa_vfr_free(struct bnxt *bp, uint16_t vf_idx);
 #endif
drivers/net/bnxt/bnxt_reps.c +16 -3
index c425e69..2f775e0 100644
@@ -272,7 +272,7 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 	if (rc) {
 		BNXT_TF_DBG(DEBUG,
 			    "Default flow rule creation for VFR->VF failed!\n");
-		return -EIO;
+		goto err;
 	}
 
 	BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VFR->VF! ***\n");
@@ -283,7 +283,7 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 	if (rc) {
 		BNXT_TF_DBG(DEBUG,
 			    "Failed to get action_ptr for VFR->VF dflt rule\n");
-		return -EIO;
+		goto rep2vf_free;
 	}
 	BNXT_TF_DBG(DEBUG, "tx_cfa_action = %d\n", vfr->vfr_tx_cfa_action);
 	rc = ulp_default_flow_create(parent_dev, param_list,
@@ -292,13 +292,24 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 	if (rc) {
 		BNXT_TF_DBG(DEBUG,
 			    "Default flow rule creation for VF->VFR failed!\n");
-		return -EIO;
+		goto rep2vf_free;
 	}
 
 	BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VF->VFR! ***\n");
 	BNXT_TF_DBG(DEBUG, "vfr2rep_flow_id = %d\n", vfr->vf2rep_flow_id);
 
+	rc = bnxt_hwrm_cfa_vfr_alloc(parent_bp, vfr->vf_id);
+	if (rc)
+		goto vf2rep_free;
+
 	return 0;
+
+vf2rep_free:
+	ulp_default_flow_destroy(vfr->parent_dev, vfr->vf2rep_flow_id);
+rep2vf_free:
+	ulp_default_flow_destroy(vfr->parent_dev, vfr->rep2vf_flow_id);
+err:
+	return -EIO;
 }
 
 static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
@@ -414,6 +425,8 @@ static int bnxt_vfr_free(struct bnxt_vf_representor *vfr)
 	vfr->vfr_tx_cfa_action = 0;
 	vfr->rx_cfa_code = 0;
 
+	rc = bnxt_hwrm_cfa_vfr_free(parent_bp, vfr->vf_id);
+
 	return rc;
 }
 
drivers/net/bnxt/hsi_struct_def_dpdk.h +138 -0

144 lines not on this page · raw message

Signature · 1 line
2.7.4
#37 lore raw

PATCH v2 16/20 net/bnxt: shadow tcam and tbl reference count modification

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Moved setting the refcnt for shadow tcam and table entries to the allocation path only. The insert can be called multiple times for updates and was resetting the refcnt to 1 each time. Now multiple insertion/modifications will not change the reference count.

---
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c  | 2 --
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/bnxt/tf_core/tf_shadow_tbl.c +0 -2
index 019a26e..a4207eb 100644
@@ -687,8 +687,6 @@ tf_shadow_tbl_insert(struct tf_shadow_tbl_insert_parms *parms)
 	if (!TF_SHADOW_HB_HANDLE_IS_VALID(sr_entry->hb_handle))
 		return 0;
 
-	sr_entry->refcnt = 1;
-
 	return 0;
 }
 
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +1 -1
index a0130d6..e2c347a 100644
@@ -472,6 +472,7 @@ tf_shadow_tcam_bind_index(struct tf_shadow_tcam_bind_index_parms *parms)
 	/* Write the result table */
 	sr_entry->key_size = parms->key_size;
 	sr_entry->hb_handle = parms->hb_handle;
+	sr_entry->refcnt = 1;
 
 	return 0;
 }
@@ -738,7 +739,6 @@ tf_shadow_tcam_insert(struct tf_shadow_tcam_insert_parms *parms)
 
 	memcpy(sr_entry->result, sparms->result, sparms->result_size);
 	sr_entry->result_size = sparms->result_size;
-	sr_entry->refcnt = 1;
 
 	return 0;
 }
Signature · 1 line
2.7.4
#38 lore raw

PATCH v2 17/20 net/bnxt: tcam table processing support for search and alloc

In reply to Somnath Kotur

From: Kishore Padmanabha <[email protected]>

Added support for tcam table processing to enable the search and allocate support. This also includes the tcam entry update support.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c           | 317 ++++++++++++++++---------
 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h |   5 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h  |   8 +-
 3 files changed, 213 insertions(+), 117 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +206 -111
index 4dee659..6ac4b0f 100644
@@ -1317,20 +1317,177 @@ ulp_mapper_mark_vfr_idx_process(struct bnxt_ulp_mapper_parms *parms,
 	return rc;
 }
 
+/*
+ * Tcam table - create the result blob.
+ * data [out] - the result blob data
+ */
+static int32_t
+ulp_mapper_tcam_tbl_result_create(struct bnxt_ulp_mapper_parms *parms,
+				  struct bnxt_ulp_mapper_tbl_info *tbl,
+				  struct ulp_blob *data)
+{
+	struct bnxt_ulp_mapper_result_field_info *dflds;
+	uint32_t num_dflds;
+	uint32_t encap_flds = 0;
+	uint32_t i;
+	int32_t rc = 0;
+
+	/* Create the result data blob */
+	dflds = ulp_mapper_result_fields_get(tbl, &num_dflds,
+					     &encap_flds);
+	if (!dflds || !num_dflds || encap_flds) {
+		BNXT_TF_DBG(ERR, "Failed to get data fields.\n");
+		return -EINVAL;
+	}
+
+	for (i = 0; i < num_dflds; i++) {
+		rc = ulp_mapper_result_field_process(parms,
+						     tbl->direction,
+						     &dflds[i],
+						     data,
+						     "TCAM Result");
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Failed to set data fields\n");
+			return -EINVAL;
+		}
+	}
+	return rc;
+}
+
+/* Tcam table scan the identifier list and allocate each identifier */
+static int32_t
+ulp_mapper_tcam_tbl_scan_ident_alloc(struct bnxt_ulp_mapper_parms *parms,
+				     struct bnxt_ulp_mapper_tbl_info *tbl)
+{
+	struct bnxt_ulp_mapper_ident_info *idents;
+	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(tbl, &num_idents);
+
+		for (i = 0; i < num_idents; i++) {
+			if (ulp_mapper_ident_process(parms, tbl,
+						     &idents[i], NULL))
+				return -EINVAL;
+		}
+	}
+	return 0;
+}
+
+/*
+ * Tcam table scan the identifier list and extract the identifier from
+ * the result blob.
+ */
+static int32_t
+ulp_mapper_tcam_tbl_scan_ident_extract(struct bnxt_ulp_mapper_parms *parms,
+				       struct bnxt_ulp_mapper_tbl_info *tbl,
+				       struct ulp_blob *data)
+{
+	struct bnxt_ulp_mapper_ident_info *idents;
+	uint32_t num_idents = 0, i;
+	int32_t rc = 0;
+
+	/*
+	 * Extract the listed identifiers from the result field,
+	 * no need to allocate them.
+	 */
+	idents = ulp_mapper_ident_fields_get(tbl, &num_idents);
+	for (i = 0; i < num_idents; i++) {
+		rc = ulp_mapper_ident_extract(parms, tbl, &idents[i], data);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Error in identifier extraction\n");
+			return rc;
+		}
+	}
+	return rc;
+}
+
+/* Internal function to write the tcam entry */
+static int32_t
+ulp_mapper_tcam_tbl_entry_write(struct bnxt_ulp_mapper_parms *parms,
+				struct bnxt_ulp_mapper_tbl_info *tbl,
+				struct ulp_blob *key,
+				struct ulp_blob *mask,
+				struct ulp_blob *data,
+				uint16_t idx)
+{
+	struct tf_set_tcam_entry_parms sparms = { 0 };
+	struct tf *tfp;
+	uint16_t tmplen;
+	int32_t rc;
+
+	tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
+	if (!tfp) {
+		BNXT_TF_DBG(ERR, "Failed to get truflow pointer\n");
+		return -EINVAL;
+	}
+
+	sparms.dir		= tbl->direction;
+	sparms.tcam_tbl_type	= tbl->resource_type;
+	sparms.idx		= idx;
+	/* Already verified the key/mask lengths */
+	sparms.key		= ulp_blob_data_get(key, &tmplen);
+	sparms.mask		= ulp_blob_data_get(mask, &tmplen);
+	sparms.key_sz_in_bits	= tbl->key_bit_size;
+	sparms.result		= ulp_blob_data_get(data, &tmplen);
+
+	if (tbl->result_bit_size != tmplen) {
+		BNXT_TF_DBG(ERR, "Result len (%d) != Expected (%d)\n",
+			    tmplen, tbl->result_bit_size);
+		return -EINVAL;
+	}
+	sparms.result_sz_in_bits = tbl->result_bit_size;
+	if (tf_set_tcam_entry(tfp, &sparms)) {
+		BNXT_TF_DBG(ERR, "tcam[%s][%s][%x] write failed.\n",
+			    tf_tcam_tbl_2_str(sparms.tcam_tbl_type),
+			    tf_dir_2_str(sparms.dir), sparms.idx);
+		return -EIO;
+	}
+	BNXT_TF_DBG(INFO, "tcam[%s][%s][%x] write success.\n",
+		    tf_tcam_tbl_2_str(sparms.tcam_tbl_type),
+		    tf_dir_2_str(sparms.dir), sparms.idx);
+
+	/* Update cache with TCAM index if the was cache allocated. */
+	if (parms->tcam_tbl_opc ==
+	    BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC) {
+		if (!parms->cache_ptr) {
+			BNXT_TF_DBG(ERR, "Unable to update cache");
+			return -EINVAL;
+		}
+		parms->cache_ptr->tcam_idx = idx;
+	}
+
+	/* Mark action */
+	rc = ulp_mapper_mark_act_ptr_process(parms, tbl);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "failed mark action processing\n");
+		return rc;
+	}
+
+	return rc;
+}
+
 static int32_t
 ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 			    struct bnxt_ulp_mapper_tbl_info *tbl)
 {
 	struct bnxt_ulp_mapper_class_key_field_info	*kflds;
-	struct ulp_blob key, mask, data;
+	struct ulp_blob key, mask, data, update_data;
 	uint32_t i, num_kflds;
 	struct tf *tfp;
 	int32_t rc, trc;
 	struct tf_alloc_tcam_entry_parms aparms		= { 0 };
 	struct tf_search_tcam_entry_parms searchparms   = { 0 };
-	struct tf_set_tcam_entry_parms sparms		= { 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;
@@ -1358,6 +1515,8 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	    !ulp_blob_init(&mask, tbl->key_bit_size,
 			   parms->device_params->byte_order) ||
 	    !ulp_blob_init(&data, tbl->result_bit_size,
+			   parms->device_params->byte_order) ||
+	    !ulp_blob_init(&update_data, tbl->result_bit_size,
 			   parms->device_params->byte_order)) {
 		BNXT_TF_DBG(ERR, "blob inits failed.\n");
 		return -EINVAL;
@@ -1388,7 +1547,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 	}
 
-	if (!tbl->srch_b4_alloc) {
+	if (tbl->srch_b4_alloc == BNXT_ULP_SEARCH_BEFORE_ALLOC_NO) {
 		/*
 		 * No search for re-use is requested, so simply allocate the
 		 * tcam index.
@@ -1455,113 +1614,49 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		hit = searchparms.hit;
 	}
 
-	/* Build the result */
-	if (!tbl->srch_b4_alloc || !hit) {
-		struct bnxt_ulp_mapper_result_field_info *dflds;
-		struct bnxt_ulp_mapper_ident_info *idents;
-		uint32_t num_dflds, num_idents;
-		uint32_t encap_flds = 0;
-
-		/*
-		 * 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(tbl, &num_idents);
-
-			for (i = 0; i < num_idents; i++) {
-				rc = ulp_mapper_ident_process(parms, tbl,
-							      &idents[i], NULL);
-				/* Already logged the error, just return */
-				if (rc)
-					goto error;
-			}
-		}
-
-		/* Create the result data blob */
-		dflds = ulp_mapper_result_fields_get(tbl, &num_dflds,
-						     &encap_flds);
-		if (!dflds || !num_dflds || encap_flds) {
-			BNXT_TF_DBG(ERR, "Failed to get data fields.\n");
-			rc = -EINVAL;
-			goto error;
-		}
-
-		for (i = 0; i < num_dflds; i++) {
-			rc = ulp_mapper_result_field_process(parms,
-							     tbl->direction,
-							     &dflds[i],
-							     &data,
-							     "TCAM Result");
-			if (rc) {
-				BNXT_TF_DBG(ERR, "Failed to set data fields\n");
-				goto error;
-			}
-		}
-
-		sparms.dir		= tbl->direction;
-		sparms.tcam_tbl_type	= tbl->resource_type;
-		sparms.idx		= idx;
-		/* Already verified the key/mask lengths */
-		sparms.key		= ulp_blob_data_get(&key, &tmplen);
-		sparms.mask		= ulp_blob_data_get(&mask, &tmplen);
-		sparms.key_sz_in_bits	= tbl->key_bit_size;
-		sparms.result		= ulp_blob_data_get(&data, &tmplen);
-
-		if (tbl->result_bit_size != tmplen) {
-			BNXT_TF_DBG(ERR, "Result len (%d) != Expected (%d)\n",
-				    tmplen, tbl->result_bit_size);
-			rc = -EINVAL;
-			goto error;
-		}
-		sparms.result_sz_in_bits = tbl->result_bit_size;
-
-		rc = tf_set_tcam_entry(tfp, &sparms);
-		if (rc) {
-			BNXT_TF_DBG(ERR, "tcam[%d][%s][%d] write failed.\n",
-				    sparms.tcam_tbl_type,
-				    (sparms.dir == TF_DIR_RX) ? "RX" : "TX",
-				    sparms.idx);
-			goto error;
-		}
-
-		/* Update cache with TCAM index if the was cache allocated. */
-		if (parms->tcam_tbl_opc ==
-		    BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC) {
-			if (!parms->cache_ptr) {
-				BNXT_TF_DBG(ERR, "Unable to update cache");
-				rc = -EINVAL;
-				goto error;
-			}
-			parms->cache_ptr->tcam_idx = idx;
-		}
-
-		/* Mark action */
-		rc = ulp_mapper_mark_act_ptr_process(parms, tbl);
-		if (rc)
-			goto error;
-
-	} else {
-		struct bnxt_ulp_mapper_ident_info *idents;
-		uint32_t num_idents;
-
-		/*
-		 * Extract the listed identifiers from the result field,
-		 * no need to allocate them.
-		 */
-		idents = ulp_mapper_ident_fields_get(tbl, &num_idents);
-		for (i = 0; i < num_idents; i++) {
-			rc = ulp_mapper_ident_extract(parms, tbl,
-						      &idents[i], &data);
-			if (rc) {
-				BNXT_TF_DBG(ERR,
-					    "Error in ident extraction\n");
-				goto error;
-			}
-		}
+	/* 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;
+
+	switch (search_flag) {
+	case BNXT_ULP_SEARCH_BEFORE_ALLOC_NO:
+		/*Scan identifier list, allocate identifier and update regfile*/
+		rc = ulp_mapper_tcam_tbl_scan_ident_alloc(parms, tbl);
+		/* Create the result blob */
+		if (!rc)
+			rc = ulp_mapper_tcam_tbl_result_create(parms, tbl,
+							       &data);
+		/* write the tcam entry */
+		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:
+		/*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
@@ -1598,11 +1693,11 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	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			= aparms.idx;
+	free_parms.idx			= idx;
 	trc = tf_free_tcam_entry(tfp, &free_parms);
 	if (trc)
 		BNXT_TF_DBG(ERR, "Failed to free tcam[%d][%d][%d] on failure\n",
-			    tbl->resource_type, tbl->direction, aparms.idx);
+			    tbl->resource_type, tbl->direction, idx);
 
 	return rc;
 }
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +3 -2
index ac651f6..9855918 100644
@@ -271,8 +271,9 @@ enum bnxt_ulp_regfile_index {
 
 enum bnxt_ulp_search_before_alloc {
 	BNXT_ULP_SEARCH_BEFORE_ALLOC_NO = 0,
-	BNXT_ULP_SEARCH_BEFORE_ALLOC_YES = 1,
-	BNXT_ULP_SEARCH_BEFORE_ALLOC_LAST = 2
+	BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP = 1,
+	BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_UPDATE = 2,
+	BNXT_ULP_SEARCH_BEFORE_ALLOC_LAST = 3
 };
 
 enum bnxt_ulp_fdb_resource_flags {
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +4 -4
index b9a25b0..6617ab9 100644
@@ -173,10 +173,10 @@ struct bnxt_ulp_mapper_tbl_info {
 	enum bnxt_ulp_resource_sub_type	resource_sub_type;
 	enum bnxt_ulp_cond_opcode	cond_opcode;
 	uint32_t			cond_operand;
-	uint8_t		direction;
-	uint32_t	priority;
-	uint8_t		srch_b4_alloc;
-	enum bnxt_ulp_critical_resource	critical_resource;
+	uint8_t				direction;
+	uint32_t			priority;
+	enum bnxt_ulp_search_before_alloc	srch_b4_alloc;
+	enum bnxt_ulp_critical_resource		critical_resource;
 
 	/* Information for accessing the ulp_key_field_list */
 	uint32_t	key_start_idx;
Signature · 1 line
2.7.4
#39 lore raw

PATCH v2 18/20 net/bnxt: added templates for search before alloc

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Search before alloc allows reuse of constrained resources such as tcam, encap, and source modifications. The new templates will search the entry and alloc only if necessary.

---
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c   |  6 +++---
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +3 -3
index 58b581c..14ce16e 100644
@@ -1052,7 +1052,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
 	.cond_opcode = BNXT_ULP_COND_OPCODE_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_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.result_start_idx = 96,
 	.result_bit_size = 0,
 	.result_num_fields = 0,
@@ -1069,7 +1069,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
 	.cond_opcode = BNXT_ULP_COND_OPCODE_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_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.result_start_idx = 99,
 	.result_bit_size = 0,
 	.result_num_fields = 0,
@@ -1084,7 +1084,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
 	.direction = TF_DIR_TX,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.result_start_idx = 102,
 	.result_bit_size = 0,
 	.result_num_fields = 0,
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +7 -7
index 41d1d87..94160a9 100644
@@ -3782,7 +3782,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 108,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4210,7 +4210,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 457,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4282,7 +4282,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 526,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4354,7 +4354,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 595,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4426,7 +4426,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 664,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4570,7 +4570,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 802,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4998,7 +4998,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_TX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_UPDATE,
 	.key_start_idx = 1151,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
Signature · 1 line
2.7.4
#40 lore raw

PATCH v2 19/20 net/bnxt: enabled shadow tables during session open

In reply to Somnath Kotur

From: Mike Baucom <[email protected]>

Turn on shadow memory in the core to allow search before allocate. This allows reuse of constrained resources.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +1 -1
index 2febd58..077527f 100644
@@ -81,7 +81,7 @@ ulp_ctx_session_open(struct bnxt *bp,
 		return rc;
 	}
 
-	params.shadow_copy = false;
+	params.shadow_copy = true;
 	params.device_type = TF_DEVICE_TYPE_WH;
 	resources = &params.resources;
 	/** RX **/
Signature · 1 line
2.7.4
#41 lore raw

PATCH v2 20/20 net/bnxt: cleanup of VF-representor dev ops

In reply to Somnath Kotur

No need to access rx_cfa_code, cfa_code_map from the VF-Rep functions anymore.

Fixes 322bd6e70272 ("net/bnxt: add port representor infrastructure")
---
 drivers/net/bnxt/bnxt.h      |  1 -
 drivers/net/bnxt/bnxt_reps.c | 75 +++++---------------------------------------
 2 files changed, 7 insertions(+), 69 deletions(-)
drivers/net/bnxt/bnxt.h +0 -1
index 41e7ae5..f4b2a3f 100644
@@ -799,7 +799,6 @@ struct bnxt_vf_representor {
 	uint16_t		dflt_vnic_id;
 	uint16_t		svif;
 	uint16_t		vfr_tx_cfa_action;
-	uint16_t		rx_cfa_code;
 	uint32_t		rep2vf_flow_id;
 	uint32_t		vf2rep_flow_id;
 	/* Private data store of associated PF/Trusted VF */
drivers/net/bnxt/bnxt_reps.c +7 -68

122 lines not on this page · raw message

Signature · 1 line
2.7.4
#42 lore raw

v3 cover bnxt patches

In reply to Somnath Kotur

Some fixes, cleanups and changes to augment pre-existing support in infrastructure

Please apply

v1->v2:
- Fixed some typos in patch [9/20].
v2->v3:
- Fixed coding style issues in patch [15/20] to use __rte_attribute.
- Updated commit messages.
- Added a patch to fix a logic error [21/22].
- Added a patch to fix compilation issue with -O and -g CFLAGS [22/22].

Ajit Khaparde (2):
net/bnxt: fix if condition
net/bnxt: fix build error with extra cflags

Kishore Padmanabha (7):
net/bnxt: add access to nat global register net/bnxt: configure parif for offload miss rules net/bnxt: update nat template
net/bnxt: configure parif for the egress rules net/bnxt: ignore VLAN priority mask
net/bnxt: add egress template with VLAN tag match net/bnxt: add tcam table processing for search and alloc

Mike Baucom (9):
net/bnxt: add shadow and search capability to tcam net/bnxt: modify ulp mapper to use tcam search net/bnxt: add tf hash API
net/bnxt: modify tf shadow tcam to use tf hash net/bnxt: add shadow table capability with search net/bnxt: modify ulp mapper to use tbl search net/bnxt: modify shadow tcam and tbl reference count logic net/bnxt: add templates for search before alloc net/bnxt: enable shadow tables during session open

Somnath Kotur (1):
net/bnxt: cleanup VF-representor dev ops

Venkat Duvvuru (3):
net/bnxt: skip mark id injection into mbuf net/bnxt: fix port default rule create and destroy net/bnxt: delete VF FW rules on representor create

 drivers/net/bnxt/bnxt.h                       |   6 +-
 drivers/net/bnxt/bnxt_ethdev.c                |  83 +-
 drivers/net/bnxt/bnxt_hwrm.c                  |  49 ++
 drivers/net/bnxt/bnxt_hwrm.h                  |   2 +
 drivers/net/bnxt/bnxt_reps.c                  |  94 +-
 drivers/net/bnxt/bnxt_rxr.c                   |   3 +
 drivers/net/bnxt/bnxt_txq.h                   |   1 -
 drivers/net/bnxt/bnxt_txr.c                   |  19 +-
 drivers/net/bnxt/hsi_struct_def_dpdk.h        | 138 +++
 drivers/net/bnxt/meson.build                  |   1 +
 drivers/net/bnxt/tf_core/Makefile             |   1 +
 drivers/net/bnxt/tf_core/tf_core.c            | 139 ++-
 drivers/net/bnxt/tf_core/tf_core.h            | 174 ++++
 drivers/net/bnxt/tf_core/tf_device_p4.c       |   4 +-
 drivers/net/bnxt/tf_core/tf_hash.c            | 106 +++
 drivers/net/bnxt/tf_core/tf_hash.h            |  27 +
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c      | 766 +++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.h      | 124 +--
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c     | 818 +++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h     | 258 +++---
 drivers/net/bnxt/tf_core/tf_tbl.c             | 246 +++++-
 drivers/net/bnxt/tf_core/tf_tbl.h             |  22 +-
 drivers/net/bnxt/tf_core/tf_tcam.c            | 300 ++++++-
 drivers/net/bnxt/tf_core/tf_tcam.h            |  31 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |  97 ++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |  18 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       | 127 ++-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h         |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 505 +++++++----
 drivers/net/bnxt/tf_ulp/ulp_port_db.c         |   2 +
 drivers/net/bnxt/tf_ulp/ulp_port_db.h         |   1 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |  81 ++
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c | 434 ++++++----
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 556 +++++++++++-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  73 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |   4 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   8 +-
 38 files changed, 4462 insertions(+), 860 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.h
Signature · 1 line
2.21.1 (Apple Git-122.3)
#43 lore raw

PATCH v3 1/22 net/bnxt: add shadow and search capability to tcam

From: Mike Baucom <[email protected]>

- Add TCAM shadow tables for searching
- Add Search API to allow reuse of TCAM entries

---
 drivers/net/bnxt/tf_core/tf_core.c        |  73 ++
 drivers/net/bnxt/tf_core/tf_core.h        | 101 +++
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   2 +-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 885 +++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h | 258 +++----
 drivers/net/bnxt/tf_core/tf_tcam.c        | 300 +++++++-
 drivers/net/bnxt/tf_core/tf_tcam.h        |  31 +-
 7 files changed, 1449 insertions(+), 201 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +73 -0
index 97e7952a9..ca3280b6b 100644
@@ -607,6 +607,79 @@ tf_search_identifier(struct tf *tfp,
 	return 0;
 }
 
+int
+tf_search_tcam_entry(struct tf *tfp,
+		     struct tf_search_tcam_entry_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+	struct tf_tcam_alloc_search_parms sparms;
+
+	TF_CHECK_PARMS2(tfp, parms);
+
+	memset(&sparms, 0, sizeof(struct tf_tcam_alloc_search_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_alloc_search_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;
+	}
+
+	sparms.dir = parms->dir;
+	sparms.type = parms->tcam_tbl_type;
+	sparms.key = parms->key;
+	sparms.key_size = TF_BITS2BYTES_WORD_ALIGN(parms->key_sz_in_bits);
+	sparms.mask = parms->mask;
+	sparms.priority = parms->priority;
+	sparms.alloc = parms->alloc;
+
+	/* Result is an in/out and so no need to copy during outputs */
+	sparms.result = parms->result;
+	sparms.result_size =
+		TF_BITS2BYTES_WORD_ALIGN(parms->result_sz_in_bits);
+
+	rc = dev->ops->tf_dev_alloc_search_tcam(tfp, &sparms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: TCAM allocation failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Copy the outputs */
+	parms->hit = sparms.hit;
+	parms->search_status = sparms.search_status;
+	parms->ref_cnt = sparms.ref_cnt;
+	parms->idx = sparms.idx;
+
+	return 0;
+}
+
 int
 tf_alloc_tcam_entry(struct tf *tfp,
 		    struct tf_alloc_tcam_entry_parms *parms)
drivers/net/bnxt/tf_core/tf_core.h +101 -0

119 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device_p4.c +1 -1
index f38c38efb..afb60989e 100644
@@ -133,7 +133,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_alloc_search_tcam = NULL,
+	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
 	.tf_dev_get_tcam = NULL,
 	.tf_dev_insert_int_em_entry = tf_em_insert_int_entry,
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +863 -22

924 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tcam.h +107 -151

339 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.c +281 -19

445 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.h +23 -8
index ee5bacc09..563b08c23 100644
@@ -104,19 +104,19 @@ struct tf_tcam_alloc_search_parms {
 	 */
 	enum tf_tcam_tbl_type type;
 	/**
-	 * [in] Enable search for matching entry
+	 * [in] Type of HCAPI
 	 */
-	uint8_t search_enable;
+	uint16_t hcapi_type;
 	/**
-	 * [in] Key data to match on (if search)
+	 * [in] Key data to match on
 	 */
 	uint8_t *key;
 	/**
-	 * [in] key size (if search)
+	 * [in] key size in bits
 	 */
 	uint16_t key_size;
 	/**
-	 * [in] Mask data to match on (if search)
+	 * [in] Mask data to match on
 	 */
 	uint8_t *mask;
 	/**
@@ -124,16 +124,31 @@ struct tf_tcam_alloc_search_parms {
 	 */
 	uint32_t priority;
 	/**
-	 * [out] If search, set if matching entry found
+	 * [in] Allocate on miss.
+	 */
+	uint8_t alloc;
+	/**
+	 * [out] Set if matching entry found
 	 */
 	uint8_t hit;
+	/**
+	 * [out] Search result status (hit, miss, reject)
+	 */
+	enum tf_tcam_search_status search_status;
 	/**
 	 * [out] Current refcnt after allocation
 	 */
 	uint16_t ref_cnt;
 	/**
-	 * [out] Idx allocated
-	 *
+	 * [in,out] The result data from the search is copied here
+	 */
+	uint8_t *result;
+	/**
+	 * [in,out] result size in bits for the result data
+	 */
+	uint16_t result_size;
+	/**
+	 * [out] Index found
 	 */
 	uint16_t idx;
 };
Signature · 1 line
2.21.1 (Apple Git-122.3)
#44 lore raw

Re: [dpdk-dev] [PATCH v3 01/22] net/bnxt: add shadow and search capability to tcam

drivers/net/bnxt/tf_core/tf_core.c tf_search_identifier(struct tf *tfp, · line 621

Quoted 12 lines · On Thu, 23 Jul 2020 22:32:14 -0700 Ajit Khaparde <[email protected]>…
drivers/net/bnxt/tf_core/tf_core.c +12 -0
+int
+tf_search_tcam_entry(struct tf *tfp,
+		     struct tf_search_tcam_entry_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+	struct tf_tcam_alloc_search_parms sparms;
+
+	TF_CHECK_PARMS2(tfp, parms);
+
+	memset(&sparms, 0, sizeof(struct tf_tcam_alloc_search_parms));

FYI simpler way to initialize stack variable is:

	struct tf_tcam_alloc_search_parms sparms = { };
#45 lore raw

PATCH v3 2/22 net/bnxt: add access to nat global register

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Add support to enable or disable the NAT global registers. The NAT feature is enabled in hardware during initialization and disabled at deinitialization of the application.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 83 ++++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h |  4 ++
 2 files changed, 87 insertions(+)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +83 -0
index 0869231a0..7c65a4b1b 100644
@@ -596,6 +596,52 @@ ulp_session_deinit(struct bnxt_ulp_session_state *session)
 	}
 }
 
+/*
+ * Internal api to enable NAT feature.
+ * Set set_flag to 1 to set the value or zero to reset the value.
+ * returns 0 on success.
+ */
+static int32_t
+bnxt_ulp_global_cfg_update(struct bnxt *bp,
+			   enum tf_dir dir,
+			   enum tf_global_config_type type,
+			   uint32_t offset,
+			   uint32_t value,
+			   uint32_t set_flag)
+{
+	uint32_t global_cfg = 0;
+	int rc;
+	struct tf_global_cfg_parms parms;
+
+	/* Initialize the params */
+	parms.dir = dir,
+	parms.type = type,
+	parms.offset = offset,
+	parms.config = (uint8_t *)&global_cfg,
+	parms.config_sz_in_bytes = sizeof(global_cfg);
+
+	rc = tf_get_global_cfg(&bp->tfp, &parms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to get global cfg 0x%x rc:%d\n",
+			    type, rc);
+		return rc;
+	}
+
+	if (set_flag)
+		global_cfg |= value;
+	else
+		global_cfg &= ~value;
+
+	/* SET the register RE_CFA_REG_ACT_TECT */
+	rc = tf_set_global_cfg(&bp->tfp, &parms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set global cfg 0x%x rc:%d\n",
+			    type, rc);
+		return rc;
+	}
+	return rc;
+}
+
 /*
  * When a port is initialized by dpdk. This functions is called
  * and this function initializes the ULP context and rest of the
@@ -732,6 +778,29 @@ bnxt_ulp_init(struct bnxt *bp)
 		goto jump_to_error;
 	}
 
+	/*
+	 * Enable NAT feature. Set the global configuration register
+	 * Tunnel encap to enable NAT with the reuse of existing inner
+	 * L2 header smac and dmac
+	 */
+	rc = bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,
+					TF_TUNNEL_ENCAP_NAT,
+					(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					BNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set rx global configuration\n");
+		goto jump_to_error;
+	}
+
+	rc = bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,
+					TF_TUNNEL_ENCAP_NAT,
+					(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					BNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set tx global configuration\n");
+		goto jump_to_error;
+	}
+
 	return rc;
 
 jump_to_error:
@@ -785,6 +854,19 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	/* Delete the Port database */
 	ulp_port_db_deinit(bp->ulp_ctx);
 
+	/* Disable NAT feature */
+	(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,
+					 TF_TUNNEL_ENCAP_NAT,
+					 (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),
+					 0);
+
+	(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,
+					 TF_TUNNEL_ENCAP_NAT,
+					 (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),
+					 0);
+
 	/* Delete the ulp context and tf session */
 	ulp_ctx_detach(bp, session);
 
@@ -942,6 +1024,7 @@ bnxt_ulp_eth_dev_ptr2_cntxt_get(struct rte_eth_dev	*dev)
 
 	if (BNXT_ETH_DEV_IS_REPRESENTOR(dev)) {
 		struct bnxt_vf_representor *vfr = dev->data->dev_private;
+
 		bp = vfr->parent_dev->data->dev_private;
 	}
 
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +4 -0
index f9e5e2ba6..7c95ead55 100644
@@ -14,6 +14,10 @@
 
 #include "ulp_template_db_enum.h"
 
+/* NAT defines to reuse existing inner L2 SMAC and DMAC */
+#define BNXT_ULP_NAT_INNER_L2_HEADER_SMAC	0x2000
+#define BNXT_ULP_NAT_INNER_L2_HEADER_DMAC	0x100
+
 /* defines for the ulp_flags */
 #define BNXT_ULP_VF_REP_ENABLED		0x1
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
Signature · 1 line
2.21.1 (Apple Git-122.3)
#46 lore raw

PATCH v3 3/22 net/bnxt: configure parif for offload miss rules

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

PARIF is handler to a partition of the physical port. For the offload miss rules, the parif miss path needs to be considered. The higher parif are reserved for handling this.

---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c  |  4 +--
 drivers/net/bnxt/tf_ulp/ulp_port_db.h    |  1 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 40 ++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +2 -2
index 4d4f7c4ea..d86e4c9ae 100644
@@ -12,8 +12,6 @@
 #include "ulp_flow_db.h"
 #include "ulp_mapper.h"
 
-#define BNXT_ULP_FREE_PARIF_BASE 11
-
 struct bnxt_ulp_def_param_handler {
 	int32_t (*vfr_func)(struct bnxt_ulp_context *ulp_ctx,
 			    struct ulp_tlv_param *param,
@@ -85,6 +83,8 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx,
 
 	if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
 		idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF;
+		/* Parif needs to be reset to a free partition */
+		parif += BNXT_ULP_FREE_PARIF_BASE;
 	} else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) {
 		idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF;
 		/* Parif needs to be reset to a free partition */
drivers/net/bnxt/tf_ulp/ulp_port_db.h +1 -0
index 393d01b7c..2b323d168 100644
@@ -10,6 +10,7 @@
 
 #define BNXT_PORT_DB_MAX_INTF_LIST		256
 #define BNXT_PORT_DB_MAX_FUNC			2048
+#define BNXT_ULP_FREE_PARIF_BASE		11
 
 enum bnxt_ulp_svif_type {
 	BNXT_ULP_DRV_FUNC_SVIF = 0,
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +40 -0
index 3891bcdc1..39f801b2f 100644
@@ -158,6 +158,43 @@ bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[],
 	return BNXT_TF_RC_SUCCESS;
 }
 
+/*
+ * Function to handle the post processing of the computed
+ * fields for the interface.
+ */
+static void
+bnxt_ulp_comp_fld_intf_update(struct ulp_rte_parser_params *params)
+{
+	uint32_t ifindex;
+	uint16_t port_id, parif;
+	enum bnxt_ulp_direction_type dir;
+
+	/* get the direction details */
+	dir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);
+
+	if (dir == BNXT_ULP_DIR_INGRESS) {
+		/* read the port id details */
+		port_id = ULP_COMP_FLD_IDX_RD(params,
+					      BNXT_ULP_CF_IDX_INCOMING_IF);
+		if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx,
+						      port_id,
+						      &ifindex)) {
+			BNXT_TF_DBG(ERR, "ParseErr:Portid is not valid\n");
+			return;
+		}
+		/* Set port PARIF */
+		if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
+					  BNXT_ULP_PHY_PORT_PARIF, &parif)) {
+			BNXT_TF_DBG(ERR, "ParseErr:ifindex is not valid\n");
+			return;
+		}
+		/* Parif needs to be reset to a free partition */
+		parif += BNXT_ULP_FREE_PARIF_BASE;
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_PHY_PORT_PARIF,
+				    parif);
+	}
+}
+
 /*
  * Function to handle the post processing of the parsing details
  */
@@ -213,6 +250,9 @@ bnxt_ulp_rte_parser_post_process(struct ulp_rte_parser_params *params)
 	/* Merge the hdr_fp_bit into the proto header bit */
 	params->hdr_bitmap.bits |= params->hdr_fp_bit.bits;
 
+	/* Update the computed interface parameters */
+	bnxt_ulp_comp_fld_intf_update(params);
+
 	/* TBD: Handle the flow rejection scenarios */
 	return 0;
 }
Signature · 1 line
2.21.1 (Apple Git-122.3)
#47 lore raw

PATCH v3 4/22 net/bnxt: modify ulp mapper to use tcam search

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

modified ulp mappper to use the new tf_search_tcam_entry API. When search before allocation is requested, mapper calls tc_search_tcam_entry with the alloc flag.

- On HIT, the result and tcam index is returned.
- On MISS, the tcam index is returned but the result is created and the tcam entry is set.
- On REJECT, the flow request is rejected.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c | 106 ++++++++++++++++++---------
 1 file changed, 71 insertions(+), 35 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +71 -35
index 6a727ed34..2d3373df2 100644
@@ -690,7 +690,7 @@ ulp_mapper_ident_extract(struct bnxt_ulp_mapper_parms *parms,
 {
 	struct ulp_flow_db_res_params	fid_parms;
 	uint64_t id = 0;
-	uint32_t idx;
+	uint32_t idx = 0;
 	struct tf_search_identifier_parms sparms = { 0 };
 	struct tf_free_identifier_parms free_parms = { 0 };
 	struct tf *tfp;
@@ -1292,12 +1292,13 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	struct tf *tfp;
 	int32_t rc, trc;
 	struct tf_alloc_tcam_entry_parms aparms		= { 0 };
+	struct tf_search_tcam_entry_parms searchparms   = { 0 };
 	struct tf_set_tcam_entry_parms sparms		= { 0 };
 	struct ulp_flow_db_res_params	fid_parms	= { 0 };
 	struct tf_free_tcam_entry_parms free_parms	= { 0 };
 	uint32_t hit = 0;
 	uint16_t tmplen = 0;
-	struct ulp_blob res_blob;
+	uint16_t idx;
 
 	/* Skip this if was handled by the cache. */
 	if (parms->tcam_tbl_opc == BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_SKIP) {
@@ -1352,37 +1353,72 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 	}
 
-	aparms.dir		= tbl->direction;
-	aparms.tcam_tbl_type	= tbl->resource_type;
-	aparms.search_enable	= tbl->srch_b4_alloc;
-	aparms.key_sz_in_bits	= tbl->key_bit_size;
-	aparms.key		= ulp_blob_data_get(&key, &tmplen);
-	if (tbl->key_bit_size != tmplen) {
-		BNXT_TF_DBG(ERR, "Key len (%d) != Expected (%d)\n",
-			    tmplen, tbl->key_bit_size);
-		return -EINVAL;
-	}
+	if (!tbl->srch_b4_alloc) {
+		/*
+		 * 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_sz_in_bits	= tbl->key_bit_size;
+		aparms.key		= ulp_blob_data_get(&key, &tmplen);
+		if (tbl->key_bit_size != tmplen) {
+			BNXT_TF_DBG(ERR, "Key len (%d) != Expected (%d)\n",
+				    tmplen, tbl->key_bit_size);
+			return -EINVAL;
+		}
 
-	aparms.mask		= ulp_blob_data_get(&mask, &tmplen);
-	if (tbl->key_bit_size != tmplen) {
-		BNXT_TF_DBG(ERR, "Mask len (%d) != Expected (%d)\n",
-			    tmplen, tbl->key_bit_size);
-		return -EINVAL;
-	}
+		aparms.mask		= ulp_blob_data_get(&mask, &tmplen);
+		if (tbl->key_bit_size != tmplen) {
+			BNXT_TF_DBG(ERR, "Mask len (%d) != Expected (%d)\n",
+				    tmplen, tbl->key_bit_size);
+			return -EINVAL;
+		}
 
-	aparms.priority		= tbl->priority;
+		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
-	 */
-	rc = tf_alloc_tcam_entry(tfp, &aparms);
-	if (rc) {
-		BNXT_TF_DBG(ERR, "tcam alloc failed rc=%d.\n", rc);
-		return rc;
-	}
+		/*
+		 * All failures after this succeeds require the entry to be
+		 * freed. cannot return directly on failure, but needs to goto
+		 * error.
+		 */
+		rc = tf_alloc_tcam_entry(tfp, &aparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "tcam alloc failed rc=%d.\n", rc);
+			return rc;
+		}
+		idx = aparms.idx;
+		hit = aparms.hit;
+	} else {
+		/*
+		 * Searching before allocation to see if we already have an
+		 * entry.  This allows re-use of a constrained resource.
+		 */
+		searchparms.dir = tbl->direction;
+		searchparms.tcam_tbl_type = tbl->resource_type;
+		searchparms.key = ulp_blob_data_get(&key, &tmplen);
+		searchparms.key_sz_in_bits = tbl->key_bit_size;
+		searchparms.mask = ulp_blob_data_get(&mask, &tmplen);
+		searchparms.priority = tbl->priority;
+		searchparms.alloc = 1;
+		searchparms.result = ulp_blob_data_get(&data, &tmplen);
+		searchparms.result_sz_in_bits = tbl->result_bit_size;
+
+		rc = tf_search_tcam_entry(tfp, &searchparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "tcam search failed rc=%d\n", rc);
+			return rc;
+		}
 
-	hit = aparms.hit;
+		/* Successful search, check the result */
+		if (searchparms.search_status == REJECT) {
+			BNXT_TF_DBG(ERR, "tcam alloc rejected\n");
+			return -ENOMEM;
+		}
+		idx = searchparms.idx;
+		hit = searchparms.hit;
+	}
 
 	/* Build the result */
 	if (!tbl->srch_b4_alloc || !hit) {
@@ -1430,9 +1466,9 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 			}
 		}
 
-		sparms.dir		= aparms.dir;
-		sparms.tcam_tbl_type	= aparms.tcam_tbl_type;
-		sparms.idx		= aparms.idx;
+		sparms.dir		= tbl->direction;
+		sparms.tcam_tbl_type	= tbl->resource_type;
+		sparms.idx		= idx;
 		/* Already verified the key/mask lengths */
 		sparms.key		= ulp_blob_data_get(&key, &tmplen);
 		sparms.mask		= ulp_blob_data_get(&mask, &tmplen);
@@ -1464,7 +1500,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 				rc = -EINVAL;
 				goto error;
 			}
-			parms->cache_ptr->tcam_idx = aparms.idx;
+			parms->cache_ptr->tcam_idx = idx;
 		}
 
 		/* Mark action */
@@ -1483,7 +1519,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		idents = ulp_mapper_ident_fields_get(tbl, &num_idents);
 		for (i = 0; i < num_idents; i++) {
 			rc = ulp_mapper_ident_extract(parms, tbl,
-						      &idents[i], &res_blob);
+						      &idents[i], &data);
 			if (rc) {
 				BNXT_TF_DBG(ERR,
 					    "Error in ident extraction\n");
@@ -1501,7 +1537,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		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	= aparms.idx;
+		fid_parms.resource_hndl	= idx;
 		rc = ulp_flow_db_resource_add(parms->ulp_ctx,
 					      parms->tbl_idx,
 					      parms->fid,
Signature · 1 line
2.21.1 (Apple Git-122.3)
#48 lore raw

PATCH v3 5/22 net/bnxt: add tf hash API

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Added tf_hash API for common hash uses across tf_core functions

---
 drivers/net/bnxt/meson.build       |   1 +
 drivers/net/bnxt/tf_core/Makefile  |   1 +
 drivers/net/bnxt/tf_core/tf_hash.c | 106 +++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_core/tf_hash.h |  27 ++++++++
 4 files changed, 135 insertions(+)
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.h
drivers/net/bnxt/meson.build +1 -0
index 8529b333c..190469e29 100644
@@ -47,6 +47,7 @@ sources = files('bnxt_cpr.c',
 	'tf_core/tf_global_cfg.c',
 	'tf_core/tf_em_host.c',
 	'tf_core/tf_shadow_identifier.c',
+	'tf_core/tf_hash.c',
 
 	'hcapi/hcapi_cfa_p4.c',
 
drivers/net/bnxt/tf_core/Makefile +1 -0
index cca0e2e85..cf6aaec6c 100644
@@ -32,3 +32,4 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_util.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_if_tbl.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_global_cfg.c
 SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_identifier.c
+SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_hash.c
drivers/net/bnxt/tf_core/tf_hash.c new file +106 -0

106 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_hash.h new file +27 -0
new file mode 100644
index 000000000..6b60afff1
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019-2020 Broadcom
+ * All rights reserved.
+ */
+
+#ifndef _TF_HASH_H_
+#define _TF_HASH_H_
+
+#include "tf_core.h"
+
+/**
+ * Calculate a crc32 on the buffer with an initial value and len
+ *
+ * Returns the crc32
+ */
+uint32_t
+tf_hash_calc_crc32i(uint32_t init, uint8_t *buf, uint32_t len);
+
+/**
+ * Calculate a crc32 on the buffer with a default initial value
+ *
+ * Returns the crc32
+ */
+uint32_t
+tf_hash_calc_crc32(uint8_t *buf, uint32_t len);
+
+#endif
Signature · 1 line
2.21.1 (Apple Git-122.3)
#50 lore raw

PATCH v3 6/22 net/bnxt: skip mark id injection into mbuf

In reply to Ajit Khaparde

From: Venkat Duvvuru <[email protected]>

When a packet is looped back from VF to VFR, it is marked to identify the VFR interface. However, this mark_id shouldn't be percolated up to the OVS as it is internal to pmd.
This patch fixes it by skipping mark injection into mbuf if the packet is received on VFR interface.

---
 drivers/net/bnxt/bnxt_rxr.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/bnxt/bnxt_rxr.c +3 -0
index baf73cb25..43b1256dc 100644
@@ -485,6 +485,9 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,
 	rc = ulp_mark_db_mark_get(bp->ulp_ctx, gfid,
 				  cfa_code, vfr_flag, &mark_id);
 	if (!rc) {
+		/* VF to VFR Rx path. So, skip mark_id injection in mbuf */
+		if (vfr_flag && *vfr_flag)
+			return mark_id;
 		/* Got the mark, write it to the mbuf and return */
 		mbuf->hash.fdir.hi = mark_id;
 		mbuf->udata64 = (cfa_code & 0xffffffffull) << 32;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#51 lore raw

PATCH v3 7/22 net/bnxt: update nat template

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

The template is updated to support additional combinations of NAT actions.

---
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c | 412 +++++++++++-------
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   |  16 +-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  26 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |   4 +-
 4 files changed, 285 insertions(+), 173 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +258 -154
index 0f19e8ed1..31fe90577 100644
@@ -12,80 +12,88 @@ uint16_t ulp_act_sig_tbl[BNXT_ULP_ACT_SIG_TBL_MAX_SZ] = {
 	[BNXT_ULP_ACT_HID_015a] = 1,
 	[BNXT_ULP_ACT_HID_00eb] = 2,
 	[BNXT_ULP_ACT_HID_0043] = 3,
-	[BNXT_ULP_ACT_HID_01d6] = 4,
-	[BNXT_ULP_ACT_HID_015e] = 5,
-	[BNXT_ULP_ACT_HID_00ef] = 6,
-	[BNXT_ULP_ACT_HID_0047] = 7,
-	[BNXT_ULP_ACT_HID_01da] = 8,
-	[BNXT_ULP_ACT_HID_025b] = 9,
-	[BNXT_ULP_ACT_HID_01ec] = 10,
-	[BNXT_ULP_ACT_HID_0144] = 11,
-	[BNXT_ULP_ACT_HID_02d7] = 12,
-	[BNXT_ULP_ACT_HID_025f] = 13,
-	[BNXT_ULP_ACT_HID_01f0] = 14,
-	[BNXT_ULP_ACT_HID_0148] = 15,
-	[BNXT_ULP_ACT_HID_02db] = 16,
-	[BNXT_ULP_ACT_HID_0000] = 17,
-	[BNXT_ULP_ACT_HID_0002] = 18,
-	[BNXT_ULP_ACT_HID_0800] = 19,
-	[BNXT_ULP_ACT_HID_0101] = 20,
-	[BNXT_ULP_ACT_HID_0020] = 21,
-	[BNXT_ULP_ACT_HID_0901] = 22,
-	[BNXT_ULP_ACT_HID_0121] = 23,
-	[BNXT_ULP_ACT_HID_0004] = 24,
-	[BNXT_ULP_ACT_HID_0804] = 25,
-	[BNXT_ULP_ACT_HID_0105] = 26,
-	[BNXT_ULP_ACT_HID_0024] = 27,
-	[BNXT_ULP_ACT_HID_0905] = 28,
-	[BNXT_ULP_ACT_HID_0125] = 29,
-	[BNXT_ULP_ACT_HID_0001] = 30,
-	[BNXT_ULP_ACT_HID_0005] = 31,
-	[BNXT_ULP_ACT_HID_0009] = 32,
-	[BNXT_ULP_ACT_HID_000d] = 33,
-	[BNXT_ULP_ACT_HID_0021] = 34,
-	[BNXT_ULP_ACT_HID_0029] = 35,
-	[BNXT_ULP_ACT_HID_0025] = 36,
-	[BNXT_ULP_ACT_HID_002d] = 37,
-	[BNXT_ULP_ACT_HID_0801] = 38,
-	[BNXT_ULP_ACT_HID_0809] = 39,
-	[BNXT_ULP_ACT_HID_0805] = 40,
-	[BNXT_ULP_ACT_HID_080d] = 41,
-	[BNXT_ULP_ACT_HID_0c15] = 42,
-	[BNXT_ULP_ACT_HID_0c19] = 43,
-	[BNXT_ULP_ACT_HID_02f6] = 44,
-	[BNXT_ULP_ACT_HID_04f8] = 45,
-	[BNXT_ULP_ACT_HID_01df] = 46,
-	[BNXT_ULP_ACT_HID_05e3] = 47,
-	[BNXT_ULP_ACT_HID_02fa] = 48,
-	[BNXT_ULP_ACT_HID_04fc] = 49,
-	[BNXT_ULP_ACT_HID_01e3] = 50,
-	[BNXT_ULP_ACT_HID_05e7] = 51,
-	[BNXT_ULP_ACT_HID_03f7] = 52,
-	[BNXT_ULP_ACT_HID_05f9] = 53,
-	[BNXT_ULP_ACT_HID_02e0] = 54,
-	[BNXT_ULP_ACT_HID_06e4] = 55,
-	[BNXT_ULP_ACT_HID_03fb] = 56,
-	[BNXT_ULP_ACT_HID_05fd] = 57,
-	[BNXT_ULP_ACT_HID_02e4] = 58,
-	[BNXT_ULP_ACT_HID_06e8] = 59,
-	[BNXT_ULP_ACT_HID_040d] = 60,
-	[BNXT_ULP_ACT_HID_040f] = 61,
-	[BNXT_ULP_ACT_HID_0413] = 62,
-	[BNXT_ULP_ACT_HID_0c0d] = 63,
-	[BNXT_ULP_ACT_HID_0567] = 64,
-	[BNXT_ULP_ACT_HID_0a49] = 65,
-	[BNXT_ULP_ACT_HID_050e] = 66,
-	[BNXT_ULP_ACT_HID_0d0e] = 67,
-	[BNXT_ULP_ACT_HID_0668] = 68,
-	[BNXT_ULP_ACT_HID_0b4a] = 69,
-	[BNXT_ULP_ACT_HID_0411] = 70,
-	[BNXT_ULP_ACT_HID_056b] = 71,
-	[BNXT_ULP_ACT_HID_0a4d] = 72,
-	[BNXT_ULP_ACT_HID_0c11] = 73,
-	[BNXT_ULP_ACT_HID_0512] = 74,
-	[BNXT_ULP_ACT_HID_0d12] = 75,
-	[BNXT_ULP_ACT_HID_066c] = 76,
-	[BNXT_ULP_ACT_HID_0b4e] = 77
+	[BNXT_ULP_ACT_HID_03d8] = 4,
+	[BNXT_ULP_ACT_HID_02c1] = 5,
+	[BNXT_ULP_ACT_HID_015e] = 6,
+	[BNXT_ULP_ACT_HID_00ef] = 7,
+	[BNXT_ULP_ACT_HID_0047] = 8,
+	[BNXT_ULP_ACT_HID_03dc] = 9,
+	[BNXT_ULP_ACT_HID_02c5] = 10,
+	[BNXT_ULP_ACT_HID_025b] = 11,
+	[BNXT_ULP_ACT_HID_01ec] = 12,
+	[BNXT_ULP_ACT_HID_0144] = 13,
+	[BNXT_ULP_ACT_HID_04d9] = 14,
+	[BNXT_ULP_ACT_HID_03c2] = 15,
+	[BNXT_ULP_ACT_HID_025f] = 16,
+	[BNXT_ULP_ACT_HID_01f0] = 17,
+	[BNXT_ULP_ACT_HID_0148] = 18,
+	[BNXT_ULP_ACT_HID_04dd] = 19,
+	[BNXT_ULP_ACT_HID_03c6] = 20,
+	[BNXT_ULP_ACT_HID_0000] = 21,
+	[BNXT_ULP_ACT_HID_0002] = 22,
+	[BNXT_ULP_ACT_HID_0800] = 23,
+	[BNXT_ULP_ACT_HID_0101] = 24,
+	[BNXT_ULP_ACT_HID_0020] = 25,
+	[BNXT_ULP_ACT_HID_0901] = 26,
+	[BNXT_ULP_ACT_HID_0121] = 27,
+	[BNXT_ULP_ACT_HID_0004] = 28,
+	[BNXT_ULP_ACT_HID_0804] = 29,
+	[BNXT_ULP_ACT_HID_0105] = 30,
+	[BNXT_ULP_ACT_HID_0024] = 31,
+	[BNXT_ULP_ACT_HID_0905] = 32,
+	[BNXT_ULP_ACT_HID_0125] = 33,
+	[BNXT_ULP_ACT_HID_0001] = 34,
+	[BNXT_ULP_ACT_HID_0005] = 35,
+	[BNXT_ULP_ACT_HID_0009] = 36,
+	[BNXT_ULP_ACT_HID_000d] = 37,
+	[BNXT_ULP_ACT_HID_0021] = 38,
+	[BNXT_ULP_ACT_HID_0029] = 39,
+	[BNXT_ULP_ACT_HID_0025] = 40,
+	[BNXT_ULP_ACT_HID_002d] = 41,
+	[BNXT_ULP_ACT_HID_0801] = 42,
+	[BNXT_ULP_ACT_HID_0809] = 43,
+	[BNXT_ULP_ACT_HID_0805] = 44,
+	[BNXT_ULP_ACT_HID_080d] = 45,
+	[BNXT_ULP_ACT_HID_0c15] = 46,
+	[BNXT_ULP_ACT_HID_0c19] = 47,
+	[BNXT_ULP_ACT_HID_02f6] = 48,
+	[BNXT_ULP_ACT_HID_04f8] = 49,
+	[BNXT_ULP_ACT_HID_01df] = 50,
+	[BNXT_ULP_ACT_HID_07e5] = 51,
+	[BNXT_ULP_ACT_HID_06ce] = 52,
+	[BNXT_ULP_ACT_HID_02fa] = 53,
+	[BNXT_ULP_ACT_HID_04fc] = 54,
+	[BNXT_ULP_ACT_HID_01e3] = 55,
+	[BNXT_ULP_ACT_HID_07e9] = 56,
+	[BNXT_ULP_ACT_HID_06d2] = 57,
+	[BNXT_ULP_ACT_HID_03f7] = 58,
+	[BNXT_ULP_ACT_HID_05f9] = 59,
+	[BNXT_ULP_ACT_HID_02e0] = 60,
+	[BNXT_ULP_ACT_HID_08e6] = 61,
+	[BNXT_ULP_ACT_HID_07cf] = 62,
+	[BNXT_ULP_ACT_HID_03fb] = 63,
+	[BNXT_ULP_ACT_HID_05fd] = 64,
+	[BNXT_ULP_ACT_HID_02e4] = 65,
+	[BNXT_ULP_ACT_HID_08ea] = 66,
+	[BNXT_ULP_ACT_HID_07d3] = 67,
+	[BNXT_ULP_ACT_HID_040d] = 68,
+	[BNXT_ULP_ACT_HID_040f] = 69,
+	[BNXT_ULP_ACT_HID_0413] = 70,
+	[BNXT_ULP_ACT_HID_0c0d] = 71,
+	[BNXT_ULP_ACT_HID_0567] = 72,
+	[BNXT_ULP_ACT_HID_0a49] = 73,
+	[BNXT_ULP_ACT_HID_050e] = 74,
+	[BNXT_ULP_ACT_HID_0d0e] = 75,
+	[BNXT_ULP_ACT_HID_0668] = 76,
+	[BNXT_ULP_ACT_HID_0b4a] = 77,
+	[BNXT_ULP_ACT_HID_0411] = 78,
+	[BNXT_ULP_ACT_HID_056b] = 79,
+	[BNXT_ULP_ACT_HID_0a4d] = 80,
+	[BNXT_ULP_ACT_HID_0c11] = 81,
+	[BNXT_ULP_ACT_HID_0512] = 82,
+	[BNXT_ULP_ACT_HID_0d12] = 83,
+	[BNXT_ULP_ACT_HID_066c] = 84,
+	[BNXT_ULP_ACT_HID_0b4e] = 85
 };
 
 struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
@@ -112,14 +120,25 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 	.act_tid = 1
 	},
 	[4] = {
-	.act_hid = BNXT_ULP_ACT_HID_01d6,
+	.act_hid = BNXT_ULP_ACT_HID_03d8,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
 	[5] = {
+	.act_hid = BNXT_ULP_ACT_HID_02c1,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[6] = {
 	.act_hid = BNXT_ULP_ACT_HID_015e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -127,7 +146,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[6] = {
+	[7] = {
 	.act_hid = BNXT_ULP_ACT_HID_00ef,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -136,7 +155,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[7] = {
+	[8] = {
 	.act_hid = BNXT_ULP_ACT_HID_0047,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -144,16 +163,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[8] = {
-	.act_hid = BNXT_ULP_ACT_HID_01da,
+	[9] = {
+	.act_hid = BNXT_ULP_ACT_HID_03dc,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[9] = {
+	[10] = {
+	.act_hid = BNXT_ULP_ACT_HID_02c5,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[11] = {
 	.act_hid = BNXT_ULP_ACT_HID_025b,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -161,7 +192,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[10] = {
+	[12] = {
 	.act_hid = BNXT_ULP_ACT_HID_01ec,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -170,7 +201,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[11] = {
+	[13] = {
 	.act_hid = BNXT_ULP_ACT_HID_0144,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -178,16 +209,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[12] = {
-	.act_hid = BNXT_ULP_ACT_HID_02d7,
+	[14] = {
+	.act_hid = BNXT_ULP_ACT_HID_04d9,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[13] = {
+	[15] = {
+	.act_hid = BNXT_ULP_ACT_HID_03c2,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[16] = {
 	.act_hid = BNXT_ULP_ACT_HID_025f,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -196,7 +239,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[14] = {
+	[17] = {
 	.act_hid = BNXT_ULP_ACT_HID_01f0,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -206,7 +249,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[15] = {
+	[18] = {
 	.act_hid = BNXT_ULP_ACT_HID_0148,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -215,51 +258,64 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[16] = {
-	.act_hid = BNXT_ULP_ACT_HID_02db,
+	[19] = {
+	.act_hid = BNXT_ULP_ACT_HID_04dd,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 1
 	},
-	[17] = {
+	[20] = {
+	.act_hid = BNXT_ULP_ACT_HID_03c6,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_ING },
+	.act_tid = 1
+	},
+	[21] = {
 	.act_hid = BNXT_ULP_ACT_HID_0000,
 	.act_sig = { .bits =
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[18] = {
+	[22] = {
 	.act_hid = BNXT_ULP_ACT_HID_0002,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DROP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[19] = {
+	[23] = {
 	.act_hid = BNXT_ULP_ACT_HID_0800,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_POP_VLAN |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[20] = {
+	[24] = {
 	.act_hid = BNXT_ULP_ACT_HID_0101,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[21] = {
+	[25] = {
 	.act_hid = BNXT_ULP_ACT_HID_0020,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_DECAP |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[22] = {
+	[26] = {
 	.act_hid = BNXT_ULP_ACT_HID_0901,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -267,7 +323,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[23] = {
+	[27] = {
 	.act_hid = BNXT_ULP_ACT_HID_0121,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_DECAP |
@@ -275,14 +331,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[24] = {
+	[28] = {
 	.act_hid = BNXT_ULP_ACT_HID_0004,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[25] = {
+	[29] = {
 	.act_hid = BNXT_ULP_ACT_HID_0804,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -290,7 +346,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[26] = {
+	[30] = {
 	.act_hid = BNXT_ULP_ACT_HID_0105,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -298,7 +354,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[27] = {
+	[31] = {
 	.act_hid = BNXT_ULP_ACT_HID_0024,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -306,7 +362,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[28] = {
+	[32] = {
 	.act_hid = BNXT_ULP_ACT_HID_0905,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -315,7 +371,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[29] = {
+	[33] = {
 	.act_hid = BNXT_ULP_ACT_HID_0125,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -324,14 +380,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 2
 	},
-	[30] = {
+	[34] = {
 	.act_hid = BNXT_ULP_ACT_HID_0001,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[31] = {
+	[35] = {
 	.act_hid = BNXT_ULP_ACT_HID_0005,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -339,7 +395,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[32] = {
+	[36] = {
 	.act_hid = BNXT_ULP_ACT_HID_0009,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -347,7 +403,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[33] = {
+	[37] = {
 	.act_hid = BNXT_ULP_ACT_HID_000d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -356,7 +412,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[34] = {
+	[38] = {
 	.act_hid = BNXT_ULP_ACT_HID_0021,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -364,7 +420,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[35] = {
+	[39] = {
 	.act_hid = BNXT_ULP_ACT_HID_0029,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -373,7 +429,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[36] = {
+	[40] = {
 	.act_hid = BNXT_ULP_ACT_HID_0025,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -382,7 +438,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[37] = {
+	[41] = {
 	.act_hid = BNXT_ULP_ACT_HID_002d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -392,7 +448,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[38] = {
+	[42] = {
 	.act_hid = BNXT_ULP_ACT_HID_0801,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -400,7 +456,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[39] = {
+	[43] = {
 	.act_hid = BNXT_ULP_ACT_HID_0809,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -409,7 +465,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[40] = {
+	[44] = {
 	.act_hid = BNXT_ULP_ACT_HID_0805,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -418,7 +474,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[41] = {
+	[45] = {
 	.act_hid = BNXT_ULP_ACT_HID_080d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_MARK |
@@ -428,14 +484,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_ING },
 	.act_tid = 3
 	},
-	[42] = {
+	[46] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c15,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_ENCAP |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 4
 	},
-	[43] = {
+	[47] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c19,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_VXLAN_ENCAP |
@@ -443,14 +499,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 4
 	},
-	[44] = {
+	[48] = {
 	.act_hid = BNXT_ULP_ACT_HID_02f6,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[45] = {
+	[49] = {
 	.act_hid = BNXT_ULP_ACT_HID_04f8,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
@@ -458,22 +514,33 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[46] = {
+	[50] = {
 	.act_hid = BNXT_ULP_ACT_HID_01df,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[47] = {
-	.act_hid = BNXT_ULP_ACT_HID_05e3,
+	[51] = {
+	.act_hid = BNXT_ULP_ACT_HID_07e5,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[48] = {
+	[52] = {
+	.act_hid = BNXT_ULP_ACT_HID_06ce,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[53] = {
 	.act_hid = BNXT_ULP_ACT_HID_02fa,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -481,7 +548,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[49] = {
+	[54] = {
 	.act_hid = BNXT_ULP_ACT_HID_04fc,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -490,7 +557,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[50] = {
+	[55] = {
 	.act_hid = BNXT_ULP_ACT_HID_01e3,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -498,16 +565,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[51] = {
-	.act_hid = BNXT_ULP_ACT_HID_05e7,
+	[56] = {
+	.act_hid = BNXT_ULP_ACT_HID_07e9,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[52] = {
+	[57] = {
+	.act_hid = BNXT_ULP_ACT_HID_06d2,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[58] = {
 	.act_hid = BNXT_ULP_ACT_HID_03f7,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -515,7 +594,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[53] = {
+	[59] = {
 	.act_hid = BNXT_ULP_ACT_HID_05f9,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -524,7 +603,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[54] = {
+	[60] = {
 	.act_hid = BNXT_ULP_ACT_HID_02e0,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -532,16 +611,28 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[55] = {
-	.act_hid = BNXT_ULP_ACT_HID_06e4,
+	[61] = {
+	.act_hid = BNXT_ULP_ACT_HID_08e6,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[56] = {
+	[62] = {
+	.act_hid = BNXT_ULP_ACT_HID_07cf,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[63] = {
 	.act_hid = BNXT_ULP_ACT_HID_03fb,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -550,7 +641,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[57] = {
+	[64] = {
 	.act_hid = BNXT_ULP_ACT_HID_05fd,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -560,7 +651,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[58] = {
+	[65] = {
 	.act_hid = BNXT_ULP_ACT_HID_02e4,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -569,30 +660,43 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[59] = {
-	.act_hid = BNXT_ULP_ACT_HID_06e8,
+	[66] = {
+	.act_hid = BNXT_ULP_ACT_HID_08ea,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
 		BNXT_ULP_ACTION_BIT_SET_TP_DST |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 5
 	},
-	[60] = {
+	[67] = {
+	.act_hid = BNXT_ULP_ACT_HID_07d3,
+	.act_sig = { .bits =
+		BNXT_ULP_ACTION_BIT_DEC_TTL |
+		BNXT_ULP_ACTION_BIT_COUNT |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_SRC |
+		BNXT_ULP_ACTION_BIT_SET_IPV4_DST |
+		BNXT_ULP_ACTION_BIT_SET_TP_SRC |
+		BNXT_ULP_ACTION_BIT_SET_TP_DST |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.act_tid = 5
+	},
+	[68] = {
 	.act_hid = BNXT_ULP_ACT_HID_040d,
 	.act_sig = { .bits =
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[61] = {
+	[69] = {
 	.act_hid = BNXT_ULP_ACT_HID_040f,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DROP |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[62] = {
+	[70] = {
 	.act_hid = BNXT_ULP_ACT_HID_0413,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DROP |
@@ -600,14 +704,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[63] = {
+	[71] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c0d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_POP_VLAN |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[64] = {
+	[72] = {
 	.act_hid = BNXT_ULP_ACT_HID_0567,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_VLAN_PCP |
@@ -616,7 +720,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[65] = {
+	[73] = {
 	.act_hid = BNXT_ULP_ACT_HID_0a49,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_SET_VLAN_VID |
@@ -624,14 +728,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[66] = {
+	[74] = {
 	.act_hid = BNXT_ULP_ACT_HID_050e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[67] = {
+	[75] = {
 	.act_hid = BNXT_ULP_ACT_HID_0d0e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -639,7 +743,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[68] = {
+	[76] = {
 	.act_hid = BNXT_ULP_ACT_HID_0668,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -649,7 +753,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[69] = {
+	[77] = {
 	.act_hid = BNXT_ULP_ACT_HID_0b4a,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_DEC_TTL |
@@ -658,14 +762,14 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[70] = {
+	[78] = {
 	.act_hid = BNXT_ULP_ACT_HID_0411,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[71] = {
+	[79] = {
 	.act_hid = BNXT_ULP_ACT_HID_056b,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -675,7 +779,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[72] = {
+	[80] = {
 	.act_hid = BNXT_ULP_ACT_HID_0a4d,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -684,7 +788,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[73] = {
+	[81] = {
 	.act_hid = BNXT_ULP_ACT_HID_0c11,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -692,7 +796,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[74] = {
+	[82] = {
 	.act_hid = BNXT_ULP_ACT_HID_0512,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -700,7 +804,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[75] = {
+	[83] = {
 	.act_hid = BNXT_ULP_ACT_HID_0d12,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -709,7 +813,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[76] = {
+	[84] = {
 	.act_hid = BNXT_ULP_ACT_HID_066c,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
@@ -720,7 +824,7 @@ struct bnxt_ulp_act_match_info ulp_act_match_list[] = {
 		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
 	.act_tid = 6
 	},
-	[77] = {
+	[85] = {
 	.act_hid = BNXT_ULP_ACT_HID_0b4e,
 	.act_sig = { .bits =
 		BNXT_ULP_ACTION_BIT_COUNT |
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +8 -8
index 200a5a6cc..9de45cdc4 100644
@@ -17241,7 +17241,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17311,7 +17311,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17325,7 +17325,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17339,7 +17339,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17353,7 +17353,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17367,7 +17367,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17381,7 +17381,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
@@ -17451,7 +17451,7 @@ struct bnxt_ulp_mapper_ident_info ulp_ident_list[] = {
 	.ident_type = TF_IDENT_TYPE_L2_CTXT_HIGH,
 	.regfile_idx = BNXT_ULP_REGFILE_INDEX_L2_CNTXT_ID_0,
 	.ident_bit_size = 10,
-	.ident_bit_pos = 54
+	.ident_bit_pos = 0
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +17 -9
index b5deaf6c6..c9fe1bc47 100644
@@ -18,7 +18,7 @@
 #define BNXT_ULP_CLASS_HID_SHFTL 31
 #define BNXT_ULP_CLASS_HID_MASK 2047
 #define BNXT_ULP_ACT_SIG_TBL_MAX_SZ 4096
-#define BNXT_ULP_ACT_MATCH_LIST_MAX_SZ 78
+#define BNXT_ULP_ACT_MATCH_LIST_MAX_SZ 86
 #define BNXT_ULP_ACT_HID_LOW_PRIME 7919
 #define BNXT_ULP_ACT_HID_HIGH_PRIME 4721
 #define BNXT_ULP_ACT_HID_SHFTR 23
@@ -786,19 +786,23 @@ enum bnxt_ulp_act_hid {
 	BNXT_ULP_ACT_HID_015a = 0x015a,
 	BNXT_ULP_ACT_HID_00eb = 0x00eb,
 	BNXT_ULP_ACT_HID_0043 = 0x0043,
-	BNXT_ULP_ACT_HID_01d6 = 0x01d6,
+	BNXT_ULP_ACT_HID_03d8 = 0x03d8,
+	BNXT_ULP_ACT_HID_02c1 = 0x02c1,
 	BNXT_ULP_ACT_HID_015e = 0x015e,
 	BNXT_ULP_ACT_HID_00ef = 0x00ef,
 	BNXT_ULP_ACT_HID_0047 = 0x0047,
-	BNXT_ULP_ACT_HID_01da = 0x01da,
+	BNXT_ULP_ACT_HID_03dc = 0x03dc,
+	BNXT_ULP_ACT_HID_02c5 = 0x02c5,
 	BNXT_ULP_ACT_HID_025b = 0x025b,
 	BNXT_ULP_ACT_HID_01ec = 0x01ec,
 	BNXT_ULP_ACT_HID_0144 = 0x0144,
-	BNXT_ULP_ACT_HID_02d7 = 0x02d7,
+	BNXT_ULP_ACT_HID_04d9 = 0x04d9,
+	BNXT_ULP_ACT_HID_03c2 = 0x03c2,
 	BNXT_ULP_ACT_HID_025f = 0x025f,
 	BNXT_ULP_ACT_HID_01f0 = 0x01f0,
 	BNXT_ULP_ACT_HID_0148 = 0x0148,
-	BNXT_ULP_ACT_HID_02db = 0x02db,
+	BNXT_ULP_ACT_HID_04dd = 0x04dd,
+	BNXT_ULP_ACT_HID_03c6 = 0x03c6,
 	BNXT_ULP_ACT_HID_0000 = 0x0000,
 	BNXT_ULP_ACT_HID_0002 = 0x0002,
 	BNXT_ULP_ACT_HID_0800 = 0x0800,
@@ -829,19 +833,23 @@ enum bnxt_ulp_act_hid {
 	BNXT_ULP_ACT_HID_02f6 = 0x02f6,
 	BNXT_ULP_ACT_HID_04f8 = 0x04f8,
 	BNXT_ULP_ACT_HID_01df = 0x01df,
-	BNXT_ULP_ACT_HID_05e3 = 0x05e3,
+	BNXT_ULP_ACT_HID_07e5 = 0x07e5,
+	BNXT_ULP_ACT_HID_06ce = 0x06ce,
 	BNXT_ULP_ACT_HID_02fa = 0x02fa,
 	BNXT_ULP_ACT_HID_04fc = 0x04fc,
 	BNXT_ULP_ACT_HID_01e3 = 0x01e3,
-	BNXT_ULP_ACT_HID_05e7 = 0x05e7,
+	BNXT_ULP_ACT_HID_07e9 = 0x07e9,
+	BNXT_ULP_ACT_HID_06d2 = 0x06d2,
 	BNXT_ULP_ACT_HID_03f7 = 0x03f7,
 	BNXT_ULP_ACT_HID_05f9 = 0x05f9,
 	BNXT_ULP_ACT_HID_02e0 = 0x02e0,
-	BNXT_ULP_ACT_HID_06e4 = 0x06e4,
+	BNXT_ULP_ACT_HID_08e6 = 0x08e6,
+	BNXT_ULP_ACT_HID_07cf = 0x07cf,
 	BNXT_ULP_ACT_HID_03fb = 0x03fb,
 	BNXT_ULP_ACT_HID_05fd = 0x05fd,
 	BNXT_ULP_ACT_HID_02e4 = 0x02e4,
-	BNXT_ULP_ACT_HID_06e8 = 0x06e8,
+	BNXT_ULP_ACT_HID_08ea = 0x08ea,
+	BNXT_ULP_ACT_HID_07d3 = 0x07d3,
 	BNXT_ULP_ACT_HID_040d = 0x040d,
 	BNXT_ULP_ACT_HID_040f = 0x040f,
 	BNXT_ULP_ACT_HID_0413 = 0x0413,
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +2 -2
index 4388a0a42..f2e2a5950 100644
@@ -259,8 +259,8 @@ struct bnxt_ulp_rte_act_info ulp_act_info[] = {
 	.proto_act_func          = NULL
 	},
 	[RTE_FLOW_ACTION_TYPE_DEC_TTL] = {
-		.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,
-		.proto_act_func          = ulp_rte_dec_ttl_act_handler
+	.act_type                = BNXT_ULP_ACT_TYPE_SUPPORTED,
+	.proto_act_func          = ulp_rte_dec_ttl_act_handler
 	},
 	[RTE_FLOW_ACTION_TYPE_SET_TTL] = {
 	.act_type                = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
Signature · 1 line
2.21.1 (Apple Git-122.3)
#52 lore raw

PATCH v3 8/22 net/bnxt: configure parif for the egress rules

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

The parif for the egress rules need to be dynamically configured based on the port type.
PARIF is handler to a partition of the physical port.

---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       | 11 ++--
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 35 ++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_port_db.c         |  2 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 54 +++++++++++++++----
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c | 16 ++++--
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 25 +++++++--
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    | 14 ++---
 7 files changed, 123 insertions(+), 34 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +3 -8
index d86e4c9ae..ddc6da8a8 100644
@@ -81,17 +81,12 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx,
 	if (rc)
 		return rc;
 
-	if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
+	if (parif_type == BNXT_ULP_PHY_PORT_PARIF)
 		idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF;
-		/* Parif needs to be reset to a free partition */
-		parif += BNXT_ULP_FREE_PARIF_BASE;
-	} else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) {
+	else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF)
 		idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF;
-		/* Parif needs to be reset to a free partition */
-		parif += BNXT_ULP_FREE_PARIF_BASE;
-	} else {
+	else
 		idx = BNXT_ULP_CF_IDX_VF_FUNC_PARIF;
-	}
 
 	ULP_COMP_FLD_IDX_WR(mapper_params, idx, parif);
 
drivers/net/bnxt/tf_ulp/ulp_mapper.c +35 -0
index 2d3373df2..a071c0750 100644
@@ -998,6 +998,41 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 			return -EINVAL;
 		}
 		break;
+	case BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF:
+		if (!ulp_operand_read(fld->result_operand,
+				      (uint8_t *)&idx,
+				      sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "%s key operand read failed.\n", name);
+			return -EINVAL;
+		}
+		idx = tfp_be_to_cpu_16(idx);
+		if (idx >= BNXT_ULP_CF_IDX_LAST) {
+			BNXT_TF_DBG(ERR, "%s invalid index %u\n", name, idx);
+			return -EINVAL;
+		}
+		/* check if the computed field is set */
+		if (ULP_COMP_FLD_IDX_RD(parms, idx))
+			val = fld->result_operand_true;
+		else
+			val = fld->result_operand_false;
+
+		/* read the appropriate computed field */
+		if (!ulp_operand_read(val, (uint8_t *)&idx, sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "%s val operand read failed\n", name);
+			return -EINVAL;
+		}
+		idx = tfp_be_to_cpu_16(idx);
+		if (idx >= BNXT_ULP_CF_IDX_LAST) {
+			BNXT_TF_DBG(ERR, "%s invalid index %u\n", name, idx);
+			return -EINVAL;
+		}
+		val = ulp_blob_push_32(blob, &parms->comp_fld[idx],
+				       fld->field_bit_size);
+		if (!val) {
+			BNXT_TF_DBG(ERR, "%s push to key blob failed\n", name);
+			return -EINVAL;
+		}
+		break;
 	default:
 		BNXT_TF_DBG(ERR, "invalid result mapper opcode 0x%x\n",
 			    fld->result_opcode);
drivers/net/bnxt/tf_ulp/ulp_port_db.c +2 -0
index 0fc7c0ab2..30876478d 100644
@@ -372,6 +372,8 @@ ulp_port_db_parif_get(struct bnxt_ulp_context *ulp_ctxt,
 		phy_port_id = port_db->ulp_func_id_tbl[func_id].phy_port_id;
 		*parif = port_db->phy_port_list[phy_port_id].port_parif;
 	}
+	/* Parif needs to be reset to a free partition */
+	*parif += BNXT_ULP_FREE_PARIF_BASE;
 
 	return 0;
 }
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +43 -11

74 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +12 -4
index 31fe90577..58b581cf6 100644
@@ -1808,11 +1808,19 @@ struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_CONST_ELSE_CONST,
 	.result_operand = {
-		BNXT_ULP_SYM_DECAP_FUNC_THRU_TUN,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 56) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 48) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 40) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 32) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 24) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 16) & 0xff,
+		((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 8) & 0xff,
+		(uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 12,
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +20 -5
index 9de45cdc4..330c5ecdd 100644
@@ -5058,7 +5058,9 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 2,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
 	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
 	.spec_operand = {0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
@@ -5149,7 +5151,9 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 2,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
 	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
 	.spec_operand = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
@@ -17054,11 +17058,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +8 -6
index c9fe1bc47..f08065b28 100644
@@ -127,11 +127,12 @@ enum bnxt_ulp_cf_idx {
 	BNXT_ULP_CF_IDX_ACT_PORT_IS_SET = 35,
 	BNXT_ULP_CF_IDX_ACT_PORT_TYPE = 36,
 	BNXT_ULP_CF_IDX_MATCH_PORT_TYPE = 37,
-	BNXT_ULP_CF_IDX_VF_TO_VF = 38,
-	BNXT_ULP_CF_IDX_L3_HDR_CNT = 39,
-	BNXT_ULP_CF_IDX_L4_HDR_CNT = 40,
-	BNXT_ULP_CF_IDX_VFR_MODE = 41,
-	BNXT_ULP_CF_IDX_LAST = 42
+	BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP = 38,
+	BNXT_ULP_CF_IDX_VF_TO_VF = 39,
+	BNXT_ULP_CF_IDX_L3_HDR_CNT = 40,
+	BNXT_ULP_CF_IDX_L4_HDR_CNT = 41,
+	BNXT_ULP_CF_IDX_VFR_MODE = 42,
+	BNXT_ULP_CF_IDX_LAST = 43
 };
 
 enum bnxt_ulp_cond_opcode {
@@ -215,7 +216,8 @@ enum bnxt_ulp_mapper_opc {
 	BNXT_ULP_MAPPER_OPC_SET_TO_ENCAP_ACT_PROP_SZ = 8,
 	BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_ACT_PROP_ELSE_CONST = 9,
 	BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_CONST_ELSE_CONST = 10,
-	BNXT_ULP_MAPPER_OPC_LAST = 11
+	BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF = 11,
+	BNXT_ULP_MAPPER_OPC_LAST = 12
 };
 
 enum bnxt_ulp_mark_db_opcode {
Signature · 1 line
2.21.1 (Apple Git-122.3)
#53 lore raw

PATCH v3 9/22 net/bnxt: ignore VLAN priority mask

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

This is a work around for the OVS setting offload rules that are passing vlan priority mask as wild card and currently we do not support it.

---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +9 -0
index 67f9319d6..665f5d381 100644
@@ -709,8 +709,17 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,
 			vlan_tag |= ~ULP_VLAN_TAG_MASK;
 		vlan_tag = htons(vlan_tag);
 
+#ifdef ULP_DONT_IGNORE_TOS
 		ulp_rte_prsr_mask_copy(params, &idx, &priority,
 				       sizeof(priority));
+#else
+		/*
+		 * The priority field is ignored since OVS is setting it as
+		 * wild card match and it is not supported. This is a work
+		 * around and shall be addressed in the future.
+		 */
+		idx += 1;
+#endif
 		ulp_rte_prsr_mask_copy(params, &idx, &vlan_tag,
 				       sizeof(vlan_tag));
 		ulp_rte_prsr_mask_copy(params, &idx, &vlan_mask->inner_type,
Signature · 1 line
2.21.1 (Apple Git-122.3)
#54 lore raw

Re: [dpdk-dev] [PATCH v3 09/22] net/bnxt: ignore VLAN priority mask

Quoted 25 lines · Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

This is a work around for the OVS setting offload rules that are passing vlan priority mask as wild card and currently we do not support it.

---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +2 -0
index 67f9319d6..665f5d381 100644
@@ -709,8 +709,17 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,
 			vlan_tag |= ~ULP_VLAN_TAG_MASK;
 		vlan_tag = htons(vlan_tag);
 
+#ifdef ULP_DONT_IGNORE_TOS
 		ulp_rte_prsr_mask_copy(params, &idx, &priority,
 				       sizeof(priority));
+#else

drivers/net/bnxt/tf_ulp/ulp_rte_parser.c ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item, · line 725

Quoted 10 lines
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +7 -0
+		/*
+		 * The priority field is ignored since OVS is setting it as
+		 * wild card match and it is not supported. This is a work
+		 * around and shall be addressed in the future.
+		 */
+		idx += 1;
+#endif
 		ulp_rte_prsr_mask_copy(params, &idx, &vlan_tag,
 				       sizeof(vlan_tag));
 		ulp_rte_prsr_mask_copy(params, &idx, &vlan_mask->inner_type,

Hi Ajit,

What sets the 'ULP_DONT_IGNORE_TOS', I don't see it in our build system. If ways 'else' leg is taken, why not drop the macro completely?

#55 lore raw

Re: [dpdk-dev] [PATCH v3 09/22] net/bnxt: ignore VLAN priority mask

Quoted 40 lines · Ferruh Yigit
Quoted 6 lines · Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

This is a work around for the OVS setting offload rules that are passing vlan priority mask as wild card and currently we do not support it.

Review

Quoted 7 lines
---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 9 +++++++++
 1 file changed, 9 insertions(+)
(quoted diff) +0 -0

b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c

drivers/net/bnxt/tf_ulp/ulp_rte_parser.c ulp_rte_vlan_hdr_handler(const struct rte_flow_item

Quoted 4 lines

index 67f9319d6..665f5d381 100644

drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +0 -0
@@ -709,8 +709,17 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item

*item,

Quoted 7 lines
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +2 -0
                      vlan_tag |= ~ULP_VLAN_TAG_MASK;
              vlan_tag = htons(vlan_tag);
 
+#ifdef ULP_DONT_IGNORE_TOS
              ulp_rte_prsr_mask_copy(params, &idx, &priority,
                                     sizeof(priority));
+#else

drivers/net/bnxt/tf_ulp/ulp_rte_parser.c ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,

Quoted 10 lines
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +7 -0
+             /*
+              * The priority field is ignored since OVS is setting it as
+              * wild card match and it is not supported. This is a work
+              * around and shall be addressed in the future.
+              */
+             idx += 1;
+#endif
              ulp_rte_prsr_mask_copy(params, &idx, &vlan_tag,
                                     sizeof(vlan_tag));
              ulp_rte_prsr_mask_copy(params, &idx,

&vlan_mask->inner_type,

Quoted 1 line
Quoted 6 lines

Hi Ajit,

What sets the 'ULP_DONT_IGNORE_TOS', I don't see it in our build system. If ways
'else' leg is taken, why not drop the macro completely?

Ferruh,
Yes. I will submit a v4 to take care of that.

Thanks
Ajit

#56 lore raw

PATCH v3 10/22 net/bnxt: add egress template with VLAN tag match

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Added egress template with VLAN tag match

---
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 501 +++++++++++++++++-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  28 +-
 2 files changed, 509 insertions(+), 20 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +483 -18
index 330c5ecdd..41d1d8772 100644
@@ -162,7 +162,31 @@ uint16_t ulp_class_sig_tbl[BNXT_ULP_CLASS_SIG_TBL_MAX_SZ] = {
 	[BNXT_ULP_CLASS_HID_01d1] = 151,
 	[BNXT_ULP_CLASS_HID_0319] = 152,
 	[BNXT_ULP_CLASS_HID_01cd] = 153,
-	[BNXT_ULP_CLASS_HID_0305] = 154
+	[BNXT_ULP_CLASS_HID_0305] = 154,
+	[BNXT_ULP_CLASS_HID_01e2] = 155,
+	[BNXT_ULP_CLASS_HID_032a] = 156,
+	[BNXT_ULP_CLASS_HID_0650] = 157,
+	[BNXT_ULP_CLASS_HID_0198] = 158,
+	[BNXT_ULP_CLASS_HID_01de] = 159,
+	[BNXT_ULP_CLASS_HID_0316] = 160,
+	[BNXT_ULP_CLASS_HID_066c] = 161,
+	[BNXT_ULP_CLASS_HID_01a4] = 162,
+	[BNXT_ULP_CLASS_HID_01c2] = 163,
+	[BNXT_ULP_CLASS_HID_030a] = 164,
+	[BNXT_ULP_CLASS_HID_0670] = 165,
+	[BNXT_ULP_CLASS_HID_01b8] = 166,
+	[BNXT_ULP_CLASS_HID_003e] = 167,
+	[BNXT_ULP_CLASS_HID_02f6] = 168,
+	[BNXT_ULP_CLASS_HID_078c] = 169,
+	[BNXT_ULP_CLASS_HID_0044] = 170,
+	[BNXT_ULP_CLASS_HID_01d2] = 171,
+	[BNXT_ULP_CLASS_HID_031a] = 172,
+	[BNXT_ULP_CLASS_HID_0660] = 173,
+	[BNXT_ULP_CLASS_HID_01a8] = 174,
+	[BNXT_ULP_CLASS_HID_01ce] = 175,
+	[BNXT_ULP_CLASS_HID_0306] = 176,
+	[BNXT_ULP_CLASS_HID_067c] = 177,
+	[BNXT_ULP_CLASS_HID_01b4] = 178
 };
 
 struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
@@ -2833,6 +2857,382 @@ struct bnxt_ulp_class_match_info ulp_class_match_list[] = {
 		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
 	.class_tid = 21,
 	.wc_pri = 11
+	},
+	[155] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01e2,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 12
+	},
+	[156] = {
+	.class_hid = BNXT_ULP_CLASS_HID_032a,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 13
+	},
+	[157] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0650,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 14
+	},
+	[158] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0198,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV4 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 15
+	},
+	[159] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01de,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 16
+	},
+	[160] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0316,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 17
+	},
+	[161] = {
+	.class_hid = BNXT_ULP_CLASS_HID_066c,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 18
+	},
+	[162] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01a4,
+	.hdr_sig = { .bits =
+		BNXT_ULP_HDR_BIT_O_ETH |
+		BNXT_ULP_HDR_BIT_OO_VLAN |
+		BNXT_ULP_HDR_BIT_O_IPV6 |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 19
+	},
+	[163] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01c2,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 20
+	},
+	[164] = {
+	.class_hid = BNXT_ULP_CLASS_HID_030a,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 21
+	},
+	[165] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0670,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 22
+	},
+	[166] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01b8,
+	.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_UDP |
+		BNXT_ULP_FLOW_DIR_BITMASK_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 23
+	},
+	[167] = {
+	.class_hid = BNXT_ULP_CLASS_HID_003e,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 24
+	},
+	[168] = {
+	.class_hid = BNXT_ULP_CLASS_HID_02f6,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 25
+	},
+	[169] = {
+	.class_hid = BNXT_ULP_CLASS_HID_078c,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 26
+	},
+	[170] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0044,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 27
+	},
+	[171] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01d2,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 28
+	},
+	[172] = {
+	.class_hid = BNXT_ULP_CLASS_HID_031a,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 29
+	},
+	[173] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0660,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 30
+	},
+	[174] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01a8,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 31
+	},
+	[175] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01ce,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 32
+	},
+	[176] = {
+	.class_hid = BNXT_ULP_CLASS_HID_0306,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 33
+	},
+	[177] = {
+	.class_hid = BNXT_ULP_CLASS_HID_067c,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_TYPE |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 34
+	},
+	[178] = {
+	.class_hid = BNXT_ULP_CLASS_HID_01b4,
+	.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_EGR },
+	.field_sig = { .bits =
+		BNXT_ULP_HF21_BITMASK_O_ETH_SMAC |
+		BNXT_ULP_HF21_BITMASK_O_ETH_DMAC |
+		BNXT_ULP_HF21_BITMASK_OO_VLAN_VID |
+		BNXT_ULP_MATCH_TYPE_BITMASK_EM },
+	.class_tid = 21,
+	.wc_pri = 35
 	}
 };
 
@@ -3236,7 +3636,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
-	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
+	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -3255,7 +3655,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
-	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
+	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -3346,7 +3746,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	},
 	{
 	.resource_func = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
-	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW,
+	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
 	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
@@ -12534,8 +12934,18 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 12,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
-	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_HDR_FIELD,
+	.mask_operand = {
+		(BNXT_ULP_HF21_IDX_OO_VLAN_VID >> 8) & 0xff,
+		BNXT_ULP_HF21_IDX_OO_VLAN_VID & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_HDR_FIELD,
+	.spec_operand = {
+		(BNXT_ULP_HF21_IDX_OO_VLAN_VID >> 8) & 0xff,
+		BNXT_ULP_HF21_IDX_OO_VLAN_VID & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 12,
@@ -12594,8 +13004,15 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	},
 	{
 	.field_bit_size = 2,
-	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
-	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO
+	.mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
+	.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_COMP_FIELD,
+	.spec_operand = {
+		(BNXT_ULP_CF_IDX_O_VTAG_NUM >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_O_VTAG_NUM & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 2,
@@ -16307,11 +16724,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
@@ -16498,11 +16926,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
@@ -16689,7 +17128,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
+	.result_operand = {
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
@@ -16876,11 +17330,22 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 4,
-	.result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+	.result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
 	.result_operand = {
-		BNXT_ULP_SYM_VF_FUNC_PARIF,
+		(BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_true = {
+		(BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+	.result_operand_false = {
+		(BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+		BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
 	{
 	.field_bit_size = 8,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +26 -2
index f08065b28..ac651f63f 100644
@@ -11,7 +11,7 @@
 #define BNXT_ULP_LOG2_MAX_NUM_DEV 2
 #define BNXT_ULP_CACHE_TBL_MAX_SZ 4
 #define BNXT_ULP_CLASS_SIG_TBL_MAX_SZ 2048
-#define BNXT_ULP_CLASS_MATCH_LIST_MAX_SZ 155
+#define BNXT_ULP_CLASS_MATCH_LIST_MAX_SZ 179
 #define BNXT_ULP_CLASS_HID_LOW_PRIME 7919
 #define BNXT_ULP_CLASS_HID_HIGH_PRIME 7907
 #define BNXT_ULP_CLASS_HID_SHFTR 32
@@ -781,7 +781,31 @@ enum bnxt_ulp_class_hid {
 	BNXT_ULP_CLASS_HID_01d1 = 0x01d1,
 	BNXT_ULP_CLASS_HID_0319 = 0x0319,
 	BNXT_ULP_CLASS_HID_01cd = 0x01cd,
-	BNXT_ULP_CLASS_HID_0305 = 0x0305
+	BNXT_ULP_CLASS_HID_0305 = 0x0305,
+	BNXT_ULP_CLASS_HID_01e2 = 0x01e2,
+	BNXT_ULP_CLASS_HID_032a = 0x032a,
+	BNXT_ULP_CLASS_HID_0650 = 0x0650,
+	BNXT_ULP_CLASS_HID_0198 = 0x0198,
+	BNXT_ULP_CLASS_HID_01de = 0x01de,
+	BNXT_ULP_CLASS_HID_0316 = 0x0316,
+	BNXT_ULP_CLASS_HID_066c = 0x066c,
+	BNXT_ULP_CLASS_HID_01a4 = 0x01a4,
+	BNXT_ULP_CLASS_HID_01c2 = 0x01c2,
+	BNXT_ULP_CLASS_HID_030a = 0x030a,
+	BNXT_ULP_CLASS_HID_0670 = 0x0670,
+	BNXT_ULP_CLASS_HID_01b8 = 0x01b8,
+	BNXT_ULP_CLASS_HID_003e = 0x003e,
+	BNXT_ULP_CLASS_HID_02f6 = 0x02f6,
+	BNXT_ULP_CLASS_HID_078c = 0x078c,
+	BNXT_ULP_CLASS_HID_0044 = 0x0044,
+	BNXT_ULP_CLASS_HID_01d2 = 0x01d2,
+	BNXT_ULP_CLASS_HID_031a = 0x031a,
+	BNXT_ULP_CLASS_HID_0660 = 0x0660,
+	BNXT_ULP_CLASS_HID_01a8 = 0x01a8,
+	BNXT_ULP_CLASS_HID_01ce = 0x01ce,
+	BNXT_ULP_CLASS_HID_0306 = 0x0306,
+	BNXT_ULP_CLASS_HID_067c = 0x067c,
+	BNXT_ULP_CLASS_HID_01b4 = 0x01b4
 };
 
 enum bnxt_ulp_act_hid {
Signature · 1 line
2.21.1 (Apple Git-122.3)
#57 lore raw

PATCH v3 11/22 net/bnxt: modify tf shadow tcam to use tf hash

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Removed the hash calculation from tf_shadow_tcam in favor of using a new common implementation.

---
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 77 +----------------------
 1 file changed, 2 insertions(+), 75 deletions(-)
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +2 -75
index 51aae4ff6..beaea0340 100644
@@ -7,6 +7,7 @@
 #include "tf_util.h"
 #include "tfp.h"
 #include "tf_shadow_tcam.h"
+#include "tf_hash.h"
 
 /**
  * The implementation includes 3 tables per tcam table type.
@@ -164,74 +165,6 @@ struct tf_shadow_tcam_db {
 	struct tf_shadow_tcam_ctxt *ctxt[TF_TCAM_TBL_TYPE_MAX];
 };
 
-/* CRC polynomial 0xedb88320 */
-static const uint32_t tf_shadow_tcam_crc32tbl[] = {
-	0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
-	0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
-	0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
-	0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
-	0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
-	0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
-	0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
-	0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
-	0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
-	0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
-	0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
-	0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
-	0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
-	0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
-	0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
-	0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
-	0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
-	0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
-	0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
-	0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
-	0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
-	0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
-	0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
-	0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
-	0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
-	0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
-	0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
-	0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
-	0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
-	0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
-	0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
-	0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
-	0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
-	0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
-	0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
-	0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
-	0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
-	0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
-	0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
-	0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
-	0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
-	0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
-	0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
-	0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
-	0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
-	0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
-	0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
-	0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
-	0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
-	0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
-	0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
-	0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
-	0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
-	0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
-	0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
-	0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
-	0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
-	0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
-	0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
-	0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
-	0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
-	0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
-	0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
-	0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
-};
-
 /**
  * Returns the number of entries in the contexts shadow table.
  */
@@ -289,13 +222,7 @@ tf_shadow_tcam_res_cpy(struct tf_shadow_tcam_ctxt *ctxt,
 static uint32_t
 tf_shadow_tcam_crc32_calc(uint8_t *key, uint32_t len)
 {
-	uint32_t crc = ~0U;
-
-	while (len--)
-		crc = tf_shadow_tcam_crc32tbl[(crc ^ key[len]) & 0xff] ^
-			(crc >> 8);
-
-	return ~crc;
+	return tf_hash_calc_crc32(key, len);
 }
 
 /**
Signature · 1 line
2.21.1 (Apple Git-122.3)
#58 lore raw

PATCH v3 12/22 net/bnxt: add shadow table capability with search

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

- Added Index Table shadow tables for searching
- Added Search API to allow reuse of Table entries

---
 drivers/net/bnxt/tf_core/tf_core.c        |  66 +-
 drivers/net/bnxt/tf_core/tf_core.h        |  79 ++-
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   2 +-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c  | 768 +++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.h  | 124 ++--
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c |   6 +
 drivers/net/bnxt/tf_core/tf_tbl.c         | 246 ++++++-
 drivers/net/bnxt/tf_core/tf_tbl.h         |  22 +-
 drivers/net/bnxt/tf_core/tf_tcam.h        |   2 +-
 9 files changed, 1211 insertions(+), 104 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +65 -1
index ca3280b6b..0dbde1de2 100644
@@ -75,7 +75,6 @@ tf_open_session(struct tf *tfp,
 	/* Session vs session client is decided in
 	 * tf_session_open_session()
 	 */
-	printf("TF_OPEN, %s\n", parms->ctrl_chan_name);
 	rc = tf_session_open_session(tfp, &oparms);
 	/* Logging handled by tf_session_open_session */
 	if (rc)
@@ -953,6 +952,71 @@ tf_alloc_tbl_entry(struct tf *tfp,
 	return 0;
 }
 
+int
+tf_search_tbl_entry(struct tf *tfp,
+		    struct tf_search_tbl_entry_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+	struct tf_tbl_alloc_search_parms sparms;
+
+	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_alloc_search_tbl == NULL) {
+		rc = -EOPNOTSUPP;
+		TFP_DRV_LOG(ERR,
+			    "%s: Operation not supported, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	memset(&sparms, 0, sizeof(struct tf_tbl_alloc_search_parms));
+	sparms.dir = parms->dir;
+	sparms.type = parms->type;
+	sparms.result = parms->result;
+	sparms.result_sz_in_bytes = parms->result_sz_in_bytes;
+	sparms.alloc = parms->alloc;
+	sparms.tbl_scope_id = parms->tbl_scope_id;
+	rc = dev->ops->tf_dev_alloc_search_tbl(tfp, &sparms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: TBL allocation failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Return the outputs from the search */
+	parms->hit = sparms.hit;
+	parms->search_status = sparms.search_status;
+	parms->ref_cnt = sparms.ref_cnt;
+	parms->idx = sparms.idx;
+
+	return 0;
+}
+
 int
 tf_free_tbl_entry(struct tf *tfp,
 		  struct tf_free_tbl_entry_parms *parms)
drivers/net/bnxt/tf_core/tf_core.h +76 -3

98 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device_p4.c +1 -1
index afb60989e..fe8dec3af 100644
@@ -126,7 +126,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_alloc_ext_tbl = tf_tbl_ext_alloc,
 	.tf_dev_free_tbl = tf_tbl_free,
 	.tf_dev_free_ext_tbl = tf_tbl_ext_free,
-	.tf_dev_alloc_search_tbl = NULL,
+	.tf_dev_alloc_search_tbl = tf_tbl_alloc_search,
 	.tf_dev_set_tbl = tf_tbl_set,
 	.tf_dev_set_ext_tbl = tf_tbl_ext_common_set,
 	.tf_dev_get_tbl = tf_tbl_get,
drivers/net/bnxt/tf_core/tf_shadow_tbl.c +746 -22

807 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tbl.h +70 -54

211 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tcam.c +6 -0
index beaea0340..a0130d6a8 100644
@@ -373,6 +373,12 @@ tf_shadow_tcam_clear_hash_entry(struct tf_shadow_tcam_ctxt *ctxt,
 	case 3:
 		*bucket = TF_SHADOW_TCAM_BE2_MASK_CLEAR(*bucket);
 		break;
+	default:
+		/*
+		 * Since the BE_GET masks non-inclusive bits, this will not
+		 * happen.
+		 */
+		break;
 	}
 }
 
drivers/net/bnxt/tf_core/tf_tbl.c +234 -12

324 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tbl.h +12 -10
index f20e8d729..930fcc324 100644
@@ -144,29 +144,31 @@ struct tf_tbl_alloc_search_parms {
 	 */
 	uint32_t tbl_scope_id;
 	/**
-	 * [in] Enable search for matching entry. If the table type is
-	 * internal the shadow copy will be searched before
-	 * alloc. Session must be configured with shadow copy enabled.
-	 */
-	uint8_t search_enable;
-	/**
-	 * [in] Result data to search for (if search_enable)
+	 * [in] Result data to search for
 	 */
 	uint8_t *result;
 	/**
-	 * [in] Result data size in bytes (if search_enable)
+	 * [in] Result data size in bytes
 	 */
 	uint16_t result_sz_in_bytes;
+	/**
+	 * [in] Whether or not to allocate on MISS, 1 is allocate.
+	 */
+	uint8_t alloc;
 	/**
 	 * [out] If search_enable, set if matching entry found
 	 */
 	uint8_t hit;
 	/**
-	 * [out] Current ref count after allocation (if search_enable)
+	 * [out] The status of the search (REJECT, MISS, HIT)
+	 */
+	enum tf_search_status search_status;
+	/**
+	 * [out] Current ref count after allocation
 	 */
 	uint16_t ref_cnt;
 	/**
-	 * [out] Idx of allocated entry or found entry (if search_enable)
+	 * [out] Idx of allocated entry or found entry
 	 */
 	uint32_t idx;
 };
drivers/net/bnxt/tf_core/tf_tcam.h +1 -1
index 563b08c23..280f138dd 100644
@@ -134,7 +134,7 @@ struct tf_tcam_alloc_search_parms {
 	/**
 	 * [out] Search result status (hit, miss, reject)
 	 */
-	enum tf_tcam_search_status search_status;
+	enum tf_search_status search_status;
 	/**
 	 * [out] Current refcnt after allocation
 	 */
Signature · 1 line
2.21.1 (Apple Git-122.3)
#59 lore raw

PATCH v3 13/22 net/bnxt: modify ulp mapper to use tbl search

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

modified ulp mappper to use the new tf_search_tbl_entry API. When search before allocation is requested, mapper calls tc_search_tbl_entry with the alloc flag.

- On HIT, the result and table index is returned.
- On MISS, the table index is returned but the result is created and the table entry is set.
- On REJECT, the flow request is rejected.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c | 75 +++++++++++++++++++---------
 1 file changed, 51 insertions(+), 24 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +51 -24
index a071c0750..4dee65971 100644
@@ -1764,9 +1764,10 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	struct ulp_blob	data;
 	uint64_t idx = 0;
 	uint16_t tmplen;
-	uint32_t i, num_flds;
+	uint32_t i, num_flds, index, hit;
 	int32_t rc = 0, trc = 0;
 	struct tf_alloc_tbl_entry_parms	aparms = { 0 };
+	struct tf_search_tbl_entry_parms srchparms = { 0 };
 	struct tf_set_tbl_entry_parms	sparms = { 0 };
 	struct tf_free_tbl_entry_parms	free_parms = { 0 };
 	uint32_t tbl_scope_id;
@@ -1868,33 +1869,59 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		return 0; /* success */
 	}
 
+	index = 0;
+	hit = 0;
 	/* Perform the tf table allocation by filling the alloc params */
-	aparms.dir		= tbl->direction;
-	aparms.type		= tbl->resource_type;
-	aparms.search_enable	= tbl->srch_b4_alloc;
-	aparms.result		= ulp_blob_data_get(&data, &tmplen);
-	aparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
-	aparms.tbl_scope_id	= tbl_scope_id;
-
-	/* All failures after the alloc succeeds require a free */
-	rc = tf_alloc_tbl_entry(tfp, &aparms);
-	if (rc) {
-		BNXT_TF_DBG(ERR, "Alloc table[%d][%s] failed rc=%d\n",
-			    aparms.type,
-			    (aparms.dir == TF_DIR_RX) ? "RX" : "TX",
-			    rc);
-		return rc;
-	}
+	if (tbl->srch_b4_alloc) {
+		memset(&srchparms, 0, sizeof(srchparms));
+		srchparms.dir = tbl->direction;
+		srchparms.type = tbl->resource_type;
+		srchparms.alloc	= 1;
+		srchparms.result = ulp_blob_data_get(&data, &tmplen);
+		srchparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
+		srchparms.tbl_scope_id = tbl_scope_id;
+		rc = tf_search_tbl_entry(tfp, &srchparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Alloc table[%s][%s] failed rc=%d\n",
+				    tf_tbl_type_2_str(tbl->resource_type),
+				    tf_dir_2_str(tbl->direction), rc);
+			return rc;
+		}
+		if (srchparms.search_status == REJECT) {
+			BNXT_TF_DBG(ERR, "Alloc table[%s][%s] rejected.\n",
+				    tf_tbl_type_2_str(tbl->resource_type),
+				    tf_dir_2_str(tbl->direction));
+			return -ENOMEM;
+		}
+		index = srchparms.idx;
+		hit = srchparms.hit;
+	} else {
+		aparms.dir		= tbl->direction;
+		aparms.type		= tbl->resource_type;
+		aparms.search_enable	= tbl->srch_b4_alloc;
+		aparms.result		= ulp_blob_data_get(&data, &tmplen);
+		aparms.result_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
+		aparms.tbl_scope_id	= tbl_scope_id;
 
+		/* All failures after the alloc succeeds require a free */
+		rc = tf_alloc_tbl_entry(tfp, &aparms);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Alloc table[%s][%s] failed rc=%d\n",
+				    tf_tbl_type_2_str(tbl->resource_type),
+				    tf_dir_2_str(tbl->direction), rc);
+			return rc;
+		}
+		index = aparms.idx;
+	}
 	/*
 	 * calculate the idx for the result record, for external EM the offset
 	 * needs to be shifted accordingly. If external non-inline table types
 	 * are used then need to revisit this logic.
 	 */
-	if (aparms.type == TF_TBL_TYPE_EXT)
-		idx = TF_ACT_REC_OFFSET_2_PTR(aparms.idx);
+	if (tbl->resource_type == TF_TBL_TYPE_EXT)
+		idx = TF_ACT_REC_OFFSET_2_PTR(index);
 	else
-		idx = aparms.idx;
+		idx = index;
 
 	/* Always storing values in Regfile in BE */
 	idx = tfp_cpu_to_be_64(idx);
@@ -1908,12 +1935,12 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	}
 
 	/* Perform the tf table set by filling the set params */
-	if (!tbl->srch_b4_alloc || !aparms.hit) {
+	if (!tbl->srch_b4_alloc || !hit) {
 		sparms.dir		= tbl->direction;
 		sparms.type		= tbl->resource_type;
 		sparms.data		= ulp_blob_data_get(&data, &tmplen);
 		sparms.data_sz_in_bytes = ULP_BITS_2_BYTE(tmplen);
-		sparms.idx		= aparms.idx;
+		sparms.idx		= index;
 		sparms.tbl_scope_id	= tbl_scope_id;
 
 		rc = tf_set_tbl_entry(tfp, &sparms);
@@ -1933,7 +1960,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	fid_parms.resource_func	= tbl->resource_func;
 	fid_parms.resource_type	= tbl->resource_type;
 	fid_parms.resource_sub_type = tbl->resource_sub_type;
-	fid_parms.resource_hndl	= aparms.idx;
+	fid_parms.resource_hndl	= index;
 	fid_parms.critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
 
 	rc = ulp_flow_db_resource_add(parms->ulp_ctx,
@@ -1960,7 +1987,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	 */
 	free_parms.dir	= tbl->direction;
 	free_parms.type	= tbl->resource_type;
-	free_parms.idx	= aparms.idx;
+	free_parms.idx	= index;
 	free_parms.tbl_scope_id = tbl_scope_id;
 
 	trc = tf_free_tbl_entry(tfp, &free_parms);
Signature · 1 line
2.21.1 (Apple Git-122.3)
#60 lore raw

Re: [dpdk-dev] [PATCH v3 13/22] net/bnxt: modify ulp mapper to use tbl search

Quoted 6 lines · Ajit Khaparde

From: Mike Baucom <[email protected]>

modified ulp mappper to use the new tf_search_tbl_entry API. When search before allocation is requested, mapper calls tc_search_tbl_entry with the alloc flag.

Quoted 8 lines

- On HIT, the result and table index is returned.
- On MISS, the table index is returned but the result is created and the table entry is set.
- On REJECT, the flow request is rejected.

Is 'tbl' in patch title, short for 'table'?

#61 lore raw

Re: [dpdk-dev] [PATCH v3 13/22] net/bnxt: modify ulp mapper to use tbl search

Quoted 13 lines · Ferruh Yigit
Quoted 11 lines · Ajit Khaparde

From: Mike Baucom <[email protected]>

modified ulp mappper to use the new tf_search_tbl_entry API. When search before allocation is requested, mapper calls tc_search_tbl_entry with the alloc flag.

- On HIT, the result and table index is returned.
- On MISS, the table index is returned but the result is created and the table entry is set.
- On REJECT, the flow request is rejected.

Quoted 6 lines
Quoted 3 lines

Is 'tbl' in patch title, short for 'table'?

I believe your guess is right Ferruh

Thanks
Som

#62 lore raw

PATCH v3 14/22 net/bnxt: fix port default rule create and destroy

In reply to Ajit Khaparde

From: Venkat Duvvuru <[email protected]>

Currently, the flow_ids of port_to_app/app_to_port & tx_cfa_action for the first port are getting over-written by the second port because these fields are stored in the ulp context which is common across the ports.

This patch fixes the problem by having per port structure to store these fields.

Fixes 9f702636d7ba ("net/bnxt: add port default rules for ingress and egress")
---
 drivers/net/bnxt/bnxt.h                 |   5 +-
 drivers/net/bnxt/bnxt_ethdev.c          |  81 +----------------
 drivers/net/bnxt/bnxt_txq.h             |   1 -
 drivers/net/bnxt/bnxt_txr.c             |   6 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c      |  12 ++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h      |  14 ++-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 116 ++++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c   |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h   |   2 +-
 9 files changed, 151 insertions(+), 88 deletions(-)
drivers/net/bnxt/bnxt.h +4 -1
index 50f93ff5b..41e7ae5bd 100644
@@ -784,6 +784,7 @@ struct bnxt {
 	struct bnxt_flow_stat_info *flow_stat;
 	uint8_t			flow_xstat;
 	uint16_t		max_num_kflows;
+	uint16_t		tx_cfa_action;
 };
 
 #define BNXT_FC_TIMER	1 /* Timer freq in Sec Flow Counters */
@@ -797,7 +798,7 @@ struct bnxt_vf_representor {
 	uint16_t		fw_fid;
 	uint16_t		dflt_vnic_id;
 	uint16_t		svif;
-	uint32_t		vfr_tx_cfa_action;
+	uint16_t		vfr_tx_cfa_action;
 	uint16_t		rx_cfa_code;
 	uint32_t		rep2vf_flow_id;
 	uint32_t		vf2rep_flow_id;
@@ -872,6 +873,8 @@ extern int bnxt_logtype_driver;
 extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;
 int32_t bnxt_ulp_init(struct bnxt *bp);
 void bnxt_ulp_deinit(struct bnxt *bp);
+int32_t bnxt_ulp_create_df_rules(struct bnxt *bp);
+void bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global);
 
 uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
 uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif,
drivers/net/bnxt/bnxt_ethdev.c +5 -76

111 lines not on this page · raw message

drivers/net/bnxt/bnxt_txq.h +0 -1
index a1ab3f39a..83a98536d 100644
@@ -29,7 +29,6 @@ struct bnxt_tx_queue {
 	struct bnxt		*bp;
 	int			index;
 	int			tx_wake_thresh;
-	uint32_t                tx_cfa_action;
 	uint32_t		vfr_tx_cfa_action;
 	struct bnxt_tx_ring_info	*tx_ring;
 
drivers/net/bnxt/bnxt_txr.c +2 -4
index c741c7188..1113aca44 100644
@@ -133,8 +133,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 				PKT_TX_TUNNEL_GENEVE | PKT_TX_IEEE1588_TMST |
 				PKT_TX_QINQ_PKT) ||
 	     (BNXT_TRUFLOW_EN(txq->bp) &&
-	      (txq->bp->ulp_ctx->cfg_data->tx_cfa_action ||
-	       txq->vfr_tx_cfa_action)))
+	      (txq->bp->tx_cfa_action || txq->vfr_tx_cfa_action)))
 		long_bd = true;
 
 	nr_bds = long_bd + tx_pkt->nb_segs;
@@ -192,8 +191,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 			if (txq->vfr_tx_cfa_action)
 				cfa_action = txq->vfr_tx_cfa_action;
 			else
-				cfa_action =
-				      txq->bp->ulp_ctx->cfg_data->tx_cfa_action;
+				cfa_action = txq->bp->tx_cfa_action;
 		}
 
 		/* HW can accelerate only outer vlan in QinQ mode */
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +11 -1
index 7c65a4b1b..2febd5814 100644
@@ -9,9 +9,9 @@
 #include <rte_flow_driver.h>
 #include <rte_tailq.h>
 
+#include "bnxt.h"
 #include "bnxt_ulp.h"
 #include "bnxt_tf_common.h"
-#include "bnxt.h"
 #include "tf_core.h"
 #include "tf_ext_flow_handle.h"
 
@@ -381,6 +381,7 @@ ulp_ctx_init(struct bnxt *bp,
 		(void)ulp_ctx_deinit(bp, session);
 		return rc;
 	}
+
 	bnxt_ulp_cntxt_tfp_set(bp->ulp_ctx, session->g_tfp);
 	return rc;
 }
@@ -654,6 +655,9 @@ bnxt_ulp_init(struct bnxt *bp)
 	bool init;
 	int rc;
 
+	if (!BNXT_TRUFLOW_EN(bp))
+		return 0;
+
 	if (bp->ulp_ctx) {
 		BNXT_TF_DBG(DEBUG, "ulp ctx already allocated\n");
 		return -EINVAL;
@@ -822,6 +826,9 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	struct rte_pci_device		*pci_dev;
 	struct rte_pci_addr		*pci_addr;
 
+	if (!BNXT_TRUFLOW_EN(bp))
+		return;
+
 	/* Get the session first */
 	pci_dev = RTE_DEV_TO_PCI(bp->eth_dev->device);
 	pci_addr = &pci_dev->addr;
@@ -833,6 +840,9 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	if (!session)
 		return;
 
+	/* clean up default flows */
+	bnxt_ulp_destroy_df_rules(bp, true);
+
 	/* clean up regular flows */
 	ulp_flow_db_flush_flows(bp->ulp_ctx, BNXT_ULP_REGULAR_FLOW_TABLE);
 
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +11 -3
index 7c95ead55..d53245215 100644
@@ -22,6 +22,12 @@
 #define BNXT_ULP_VF_REP_ENABLED		0x1
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
 
+struct bnxt_ulp_df_rule_info {
+	uint32_t			port_to_app_flow_id;
+	uint32_t			app_to_port_flow_id;
+	uint8_t				valid;
+};
+
 struct bnxt_ulp_data {
 	uint32_t			tbl_scope_id;
 	struct bnxt_ulp_mark_tbl	*mark_tbl;
@@ -32,9 +38,7 @@ struct bnxt_ulp_data {
 	struct bnxt_ulp_port_db		*port_db;
 	struct bnxt_ulp_fc_info		*fc_info;
 	uint32_t			ulp_flags;
-	uint32_t			port_to_app_flow_id;
-	uint32_t			app_to_port_flow_id;
-	uint32_t			tx_cfa_action;
+	struct bnxt_ulp_df_rule_info   df_rule_info[RTE_MAX_ETHPORTS];
 };
 
 struct bnxt_ulp_context {
@@ -175,4 +179,8 @@ int32_t
 bnxt_ulp_cntxt_ptr2_ulp_flags_get(struct bnxt_ulp_context *ulp_ctx,
 				  uint32_t *flags);
 
+int32_t
+bnxt_ulp_get_df_rule_info(uint8_t port_id, struct bnxt_ulp_context *ulp_ctx,
+			  struct bnxt_ulp_df_rule_info *info);
+
 #endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +116 -0

119 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_flow_db.c +1 -1
index a3cfe54bf..714451740 100644
@@ -962,7 +962,7 @@ ulp_flow_db_resource_hndl_get(struct bnxt_ulp_context *ulp_ctx,
 int32_t
 ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
 				   uint32_t flow_id,
-				   uint32_t *cfa_action)
+				   uint16_t *cfa_action)
 {
 	uint8_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_VFR_CFA_ACTION;
 	uint64_t hndl;
drivers/net/bnxt/tf_ulp/ulp_flow_db.h +1 -1
index 1fc06012f..117e250d6 100644
@@ -234,7 +234,7 @@ ulp_flow_db_validate_flow_func(struct bnxt_ulp_context *ulp_ctx,
 int32_t
 ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
 				   uint32_t flow_id,
-				   uint32_t *cfa_action);
+				   uint16_t *cfa_action);
 
 #ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
 /*
Signature · 1 line
2.21.1 (Apple Git-122.3)
#63 lore raw

PATCH v3 15/22 net/bnxt: delete VF FW rules on representor create

In reply to Ajit Khaparde

From: Venkat Duvvuru <[email protected]>

Truflow stack adds VFR to VF and VF to VFR conduits when VF representor is created. However, in the ingress direction the VF's fw rules conflict with Truflow rules, resulting in not hitting the Truflow VFR rules. To fix this, fw is going to remove it’s VF rules when vf representor is created in Truflow mode and will restore the removed rules when vf representor is destroyed.

This patch invokes the vf representor alloc and free hwrm commands as part of which fw will do the above mentioned actions.

---
 drivers/net/bnxt/bnxt_hwrm.c           |  49 +++++++++
 drivers/net/bnxt/bnxt_hwrm.h           |   2 +
 drivers/net/bnxt/bnxt_reps.c           |  19 +++-
 drivers/net/bnxt/hsi_struct_def_dpdk.h | 138 +++++++++++++++++++++++++
 4 files changed, 205 insertions(+), 3 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +49 -0
index 7ea13a8b2..f5f0dfe73 100644
@@ -5486,6 +5486,55 @@ int bnxt_hwrm_cfa_counter_qstats(struct bnxt *bp,
 	return 0;
 }
 
+int bnxt_hwrm_cfa_vfr_alloc(struct bnxt *bp, uint16_t vf_idx)
+{
+	struct hwrm_cfa_vfr_alloc_output *resp = bp->hwrm_cmd_resp_addr;
+	struct hwrm_cfa_vfr_alloc_input req = {0};
+	int rc;
+
+	if (!(BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))) {
+		PMD_DRV_LOG(DEBUG,
+			    "Not a PF or trusted VF. Command not supported\n");
+		return 0;
+	}
+
+	HWRM_PREP(&req, HWRM_CFA_VFR_ALLOC, BNXT_USE_CHIMP_MB);
+	req.vf_id = rte_cpu_to_le_16(vf_idx);
+	snprintf(req.vfr_name, sizeof(req.vfr_name), "%svfr%d",
+		 bp->eth_dev->data->name, vf_idx);
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+	HWRM_CHECK_RESULT();
+
+	HWRM_UNLOCK();
+	PMD_DRV_LOG(DEBUG, "VFR %d allocated\n", vf_idx);
+	return rc;
+}
+
+int bnxt_hwrm_cfa_vfr_free(struct bnxt *bp, uint16_t vf_idx)
+{
+	struct hwrm_cfa_vfr_free_output *resp = bp->hwrm_cmd_resp_addr;
+	struct hwrm_cfa_vfr_free_input req = {0};
+	int rc;
+
+	if (!(BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp))) {
+		PMD_DRV_LOG(DEBUG,
+			    "Not a PF or trusted VF. Command not supported\n");
+		return 0;
+	}
+
+	HWRM_PREP(&req, HWRM_CFA_VFR_FREE, BNXT_USE_CHIMP_MB);
+	req.vf_id = rte_cpu_to_le_16(vf_idx);
+	snprintf(req.vfr_name, sizeof(req.vfr_name), "%svfr%d",
+		 bp->eth_dev->data->name, vf_idx);
+
+	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
+	HWRM_CHECK_RESULT();
+	HWRM_UNLOCK();
+	PMD_DRV_LOG(DEBUG, "VFR %d freed\n", vf_idx);
+	return rc;
+}
+
 #ifdef RTE_LIBRTE_BNXT_PMD_SYSTEM
 int
 bnxt_hwrm_oem_cmd(struct bnxt *bp, uint32_t entry_num)
drivers/net/bnxt/bnxt_hwrm.h +2 -0
index 01201a7a4..4a2af13c9 100644
@@ -278,4 +278,6 @@ int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp);
 int bnxt_hwrm_oem_cmd(struct bnxt *bp, uint32_t entry_num);
 int bnxt_clear_one_vnic_filter(struct bnxt *bp,
 			       struct bnxt_filter_info *filter);
+int bnxt_hwrm_cfa_vfr_alloc(struct bnxt *bp, uint16_t vf_idx);
+int bnxt_hwrm_cfa_vfr_free(struct bnxt *bp, uint16_t vf_idx);
 #endif
drivers/net/bnxt/bnxt_reps.c +16 -3
index c425e69aa..2f775e0c0 100644
@@ -272,7 +272,7 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 	if (rc) {
 		BNXT_TF_DBG(DEBUG,
 			    "Default flow rule creation for VFR->VF failed!\n");
-		return -EIO;
+		goto err;
 	}
 
 	BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VFR->VF! ***\n");
@@ -283,7 +283,7 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 	if (rc) {
 		BNXT_TF_DBG(DEBUG,
 			    "Failed to get action_ptr for VFR->VF dflt rule\n");
-		return -EIO;
+		goto rep2vf_free;
 	}
 	BNXT_TF_DBG(DEBUG, "tx_cfa_action = %d\n", vfr->vfr_tx_cfa_action);
 	rc = ulp_default_flow_create(parent_dev, param_list,
@@ -292,13 +292,24 @@ static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
 	if (rc) {
 		BNXT_TF_DBG(DEBUG,
 			    "Default flow rule creation for VF->VFR failed!\n");
-		return -EIO;
+		goto rep2vf_free;
 	}
 
 	BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VF->VFR! ***\n");
 	BNXT_TF_DBG(DEBUG, "vfr2rep_flow_id = %d\n", vfr->vf2rep_flow_id);
 
+	rc = bnxt_hwrm_cfa_vfr_alloc(parent_bp, vfr->vf_id);
+	if (rc)
+		goto vf2rep_free;
+
 	return 0;
+
+vf2rep_free:
+	ulp_default_flow_destroy(vfr->parent_dev, vfr->vf2rep_flow_id);
+rep2vf_free:
+	ulp_default_flow_destroy(vfr->parent_dev, vfr->rep2vf_flow_id);
+err:
+	return -EIO;
 }
 
 static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
@@ -414,6 +425,8 @@ static int bnxt_vfr_free(struct bnxt_vf_representor *vfr)
 	vfr->vfr_tx_cfa_action = 0;
 	vfr->rx_cfa_code = 0;
 
+	rc = bnxt_hwrm_cfa_vfr_free(parent_bp, vfr->vf_id);
+
 	return rc;
 }
 
drivers/net/bnxt/hsi_struct_def_dpdk.h +138 -0

144 lines not on this page · raw message

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

PATCH v3 16/22 net/bnxt: modify shadow tcam and tbl reference count logic

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Moved setting the refcnt for shadow tcam and table entries to the allocation path only. The insert can be called multiple times for updates and was resetting the refcnt to 1 each time. Now multiple insertion/modifications will not change the reference count.

---
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c  | 2 --
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/bnxt/tf_core/tf_shadow_tbl.c +0 -2
index 019a26eba..a4207eb3a 100644
@@ -687,8 +687,6 @@ tf_shadow_tbl_insert(struct tf_shadow_tbl_insert_parms *parms)
 	if (!TF_SHADOW_HB_HANDLE_IS_VALID(sr_entry->hb_handle))
 		return 0;
 
-	sr_entry->refcnt = 1;
-
 	return 0;
 }
 
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +1 -1
index a0130d6a8..e2c347a1e 100644
@@ -472,6 +472,7 @@ tf_shadow_tcam_bind_index(struct tf_shadow_tcam_bind_index_parms *parms)
 	/* Write the result table */
 	sr_entry->key_size = parms->key_size;
 	sr_entry->hb_handle = parms->hb_handle;
+	sr_entry->refcnt = 1;
 
 	return 0;
 }
@@ -738,7 +739,6 @@ tf_shadow_tcam_insert(struct tf_shadow_tcam_insert_parms *parms)
 
 	memcpy(sr_entry->result, sparms->result, sparms->result_size);
 	sr_entry->result_size = sparms->result_size;
-	sr_entry->refcnt = 1;
 
 	return 0;
 }
Signature · 1 line
2.21.1 (Apple Git-122.3)
#65 lore raw

PATCH v3 17/22 net/bnxt: add tcam table processing for search and alloc

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Added support for tcam table processing to enable the search and allocate support. This also includes the tcam entry update support.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 317 ++++++++++++------
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   5 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   8 +-
 3 files changed, 213 insertions(+), 117 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +206 -111
index 4dee65971..6ac4b0f83 100644
@@ -1317,20 +1317,177 @@ ulp_mapper_mark_vfr_idx_process(struct bnxt_ulp_mapper_parms *parms,
 	return rc;
 }
 
+/*
+ * Tcam table - create the result blob.
+ * data [out] - the result blob data
+ */
+static int32_t
+ulp_mapper_tcam_tbl_result_create(struct bnxt_ulp_mapper_parms *parms,
+				  struct bnxt_ulp_mapper_tbl_info *tbl,
+				  struct ulp_blob *data)
+{
+	struct bnxt_ulp_mapper_result_field_info *dflds;
+	uint32_t num_dflds;
+	uint32_t encap_flds = 0;
+	uint32_t i;
+	int32_t rc = 0;
+
+	/* Create the result data blob */
+	dflds = ulp_mapper_result_fields_get(tbl, &num_dflds,
+					     &encap_flds);
+	if (!dflds || !num_dflds || encap_flds) {
+		BNXT_TF_DBG(ERR, "Failed to get data fields.\n");
+		return -EINVAL;
+	}
+
+	for (i = 0; i < num_dflds; i++) {
+		rc = ulp_mapper_result_field_process(parms,
+						     tbl->direction,
+						     &dflds[i],
+						     data,
+						     "TCAM Result");
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Failed to set data fields\n");
+			return -EINVAL;
+		}
+	}
+	return rc;
+}
+
+/* Tcam table scan the identifier list and allocate each identifier */
+static int32_t
+ulp_mapper_tcam_tbl_scan_ident_alloc(struct bnxt_ulp_mapper_parms *parms,
+				     struct bnxt_ulp_mapper_tbl_info *tbl)
+{
+	struct bnxt_ulp_mapper_ident_info *idents;
+	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(tbl, &num_idents);
+
+		for (i = 0; i < num_idents; i++) {
+			if (ulp_mapper_ident_process(parms, tbl,
+						     &idents[i], NULL))
+				return -EINVAL;
+		}
+	}
+	return 0;
+}
+
+/*
+ * Tcam table scan the identifier list and extract the identifier from
+ * the result blob.
+ */
+static int32_t
+ulp_mapper_tcam_tbl_scan_ident_extract(struct bnxt_ulp_mapper_parms *parms,
+				       struct bnxt_ulp_mapper_tbl_info *tbl,
+				       struct ulp_blob *data)
+{
+	struct bnxt_ulp_mapper_ident_info *idents;
+	uint32_t num_idents = 0, i;
+	int32_t rc = 0;
+
+	/*
+	 * Extract the listed identifiers from the result field,
+	 * no need to allocate them.
+	 */
+	idents = ulp_mapper_ident_fields_get(tbl, &num_idents);
+	for (i = 0; i < num_idents; i++) {
+		rc = ulp_mapper_ident_extract(parms, tbl, &idents[i], data);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Error in identifier extraction\n");
+			return rc;
+		}
+	}
+	return rc;
+}
+
+/* Internal function to write the tcam entry */
+static int32_t
+ulp_mapper_tcam_tbl_entry_write(struct bnxt_ulp_mapper_parms *parms,
+				struct bnxt_ulp_mapper_tbl_info *tbl,
+				struct ulp_blob *key,
+				struct ulp_blob *mask,
+				struct ulp_blob *data,
+				uint16_t idx)
+{
+	struct tf_set_tcam_entry_parms sparms = { 0 };
+	struct tf *tfp;
+	uint16_t tmplen;
+	int32_t rc;
+
+	tfp = bnxt_ulp_cntxt_tfp_get(parms->ulp_ctx);
+	if (!tfp) {
+		BNXT_TF_DBG(ERR, "Failed to get truflow pointer\n");
+		return -EINVAL;
+	}
+
+	sparms.dir		= tbl->direction;
+	sparms.tcam_tbl_type	= tbl->resource_type;
+	sparms.idx		= idx;
+	/* Already verified the key/mask lengths */
+	sparms.key		= ulp_blob_data_get(key, &tmplen);
+	sparms.mask		= ulp_blob_data_get(mask, &tmplen);
+	sparms.key_sz_in_bits	= tbl->key_bit_size;
+	sparms.result		= ulp_blob_data_get(data, &tmplen);
+
+	if (tbl->result_bit_size != tmplen) {
+		BNXT_TF_DBG(ERR, "Result len (%d) != Expected (%d)\n",
+			    tmplen, tbl->result_bit_size);
+		return -EINVAL;
+	}
+	sparms.result_sz_in_bits = tbl->result_bit_size;
+	if (tf_set_tcam_entry(tfp, &sparms)) {
+		BNXT_TF_DBG(ERR, "tcam[%s][%s][%x] write failed.\n",
+			    tf_tcam_tbl_2_str(sparms.tcam_tbl_type),
+			    tf_dir_2_str(sparms.dir), sparms.idx);
+		return -EIO;
+	}
+	BNXT_TF_DBG(INFO, "tcam[%s][%s][%x] write success.\n",
+		    tf_tcam_tbl_2_str(sparms.tcam_tbl_type),
+		    tf_dir_2_str(sparms.dir), sparms.idx);
+
+	/* Update cache with TCAM index if the was cache allocated. */
+	if (parms->tcam_tbl_opc ==
+	    BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC) {
+		if (!parms->cache_ptr) {
+			BNXT_TF_DBG(ERR, "Unable to update cache");
+			return -EINVAL;
+		}
+		parms->cache_ptr->tcam_idx = idx;
+	}
+
+	/* Mark action */
+	rc = ulp_mapper_mark_act_ptr_process(parms, tbl);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "failed mark action processing\n");
+		return rc;
+	}
+
+	return rc;
+}
+
 static int32_t
 ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 			    struct bnxt_ulp_mapper_tbl_info *tbl)
 {
 	struct bnxt_ulp_mapper_class_key_field_info	*kflds;
-	struct ulp_blob key, mask, data;
+	struct ulp_blob key, mask, data, update_data;
 	uint32_t i, num_kflds;
 	struct tf *tfp;
 	int32_t rc, trc;
 	struct tf_alloc_tcam_entry_parms aparms		= { 0 };
 	struct tf_search_tcam_entry_parms searchparms   = { 0 };
-	struct tf_set_tcam_entry_parms sparms		= { 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;
@@ -1358,6 +1515,8 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	    !ulp_blob_init(&mask, tbl->key_bit_size,
 			   parms->device_params->byte_order) ||
 	    !ulp_blob_init(&data, tbl->result_bit_size,
+			   parms->device_params->byte_order) ||
+	    !ulp_blob_init(&update_data, tbl->result_bit_size,
 			   parms->device_params->byte_order)) {
 		BNXT_TF_DBG(ERR, "blob inits failed.\n");
 		return -EINVAL;
@@ -1388,7 +1547,7 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 	}
 
-	if (!tbl->srch_b4_alloc) {
+	if (tbl->srch_b4_alloc == BNXT_ULP_SEARCH_BEFORE_ALLOC_NO) {
 		/*
 		 * No search for re-use is requested, so simply allocate the
 		 * tcam index.
@@ -1455,113 +1614,49 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		hit = searchparms.hit;
 	}
 
-	/* Build the result */
-	if (!tbl->srch_b4_alloc || !hit) {
-		struct bnxt_ulp_mapper_result_field_info *dflds;
-		struct bnxt_ulp_mapper_ident_info *idents;
-		uint32_t num_dflds, num_idents;
-		uint32_t encap_flds = 0;
-
-		/*
-		 * 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(tbl, &num_idents);
-
-			for (i = 0; i < num_idents; i++) {
-				rc = ulp_mapper_ident_process(parms, tbl,
-							      &idents[i], NULL);
-				/* Already logged the error, just return */
-				if (rc)
-					goto error;
-			}
-		}
-
-		/* Create the result data blob */
-		dflds = ulp_mapper_result_fields_get(tbl, &num_dflds,
-						     &encap_flds);
-		if (!dflds || !num_dflds || encap_flds) {
-			BNXT_TF_DBG(ERR, "Failed to get data fields.\n");
-			rc = -EINVAL;
-			goto error;
-		}
-
-		for (i = 0; i < num_dflds; i++) {
-			rc = ulp_mapper_result_field_process(parms,
-							     tbl->direction,
-							     &dflds[i],
-							     &data,
-							     "TCAM Result");
-			if (rc) {
-				BNXT_TF_DBG(ERR, "Failed to set data fields\n");
-				goto error;
-			}
-		}
-
-		sparms.dir		= tbl->direction;
-		sparms.tcam_tbl_type	= tbl->resource_type;
-		sparms.idx		= idx;
-		/* Already verified the key/mask lengths */
-		sparms.key		= ulp_blob_data_get(&key, &tmplen);
-		sparms.mask		= ulp_blob_data_get(&mask, &tmplen);
-		sparms.key_sz_in_bits	= tbl->key_bit_size;
-		sparms.result		= ulp_blob_data_get(&data, &tmplen);
-
-		if (tbl->result_bit_size != tmplen) {
-			BNXT_TF_DBG(ERR, "Result len (%d) != Expected (%d)\n",
-				    tmplen, tbl->result_bit_size);
-			rc = -EINVAL;
-			goto error;
-		}
-		sparms.result_sz_in_bits = tbl->result_bit_size;
-
-		rc = tf_set_tcam_entry(tfp, &sparms);
-		if (rc) {
-			BNXT_TF_DBG(ERR, "tcam[%d][%s][%d] write failed.\n",
-				    sparms.tcam_tbl_type,
-				    (sparms.dir == TF_DIR_RX) ? "RX" : "TX",
-				    sparms.idx);
-			goto error;
-		}
-
-		/* Update cache with TCAM index if the was cache allocated. */
-		if (parms->tcam_tbl_opc ==
-		    BNXT_ULP_MAPPER_TCAM_TBL_OPC_CACHE_ALLOC) {
-			if (!parms->cache_ptr) {
-				BNXT_TF_DBG(ERR, "Unable to update cache");
-				rc = -EINVAL;
-				goto error;
-			}
-			parms->cache_ptr->tcam_idx = idx;
-		}
-
-		/* Mark action */
-		rc = ulp_mapper_mark_act_ptr_process(parms, tbl);
-		if (rc)
-			goto error;
-
-	} else {
-		struct bnxt_ulp_mapper_ident_info *idents;
-		uint32_t num_idents;
-
-		/*
-		 * Extract the listed identifiers from the result field,
-		 * no need to allocate them.
-		 */
-		idents = ulp_mapper_ident_fields_get(tbl, &num_idents);
-		for (i = 0; i < num_idents; i++) {
-			rc = ulp_mapper_ident_extract(parms, tbl,
-						      &idents[i], &data);
-			if (rc) {
-				BNXT_TF_DBG(ERR,
-					    "Error in ident extraction\n");
-				goto error;
-			}
-		}
+	/* 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;
+
+	switch (search_flag) {
+	case BNXT_ULP_SEARCH_BEFORE_ALLOC_NO:
+		/*Scan identifier list, allocate identifier and update regfile*/
+		rc = ulp_mapper_tcam_tbl_scan_ident_alloc(parms, tbl);
+		/* Create the result blob */
+		if (!rc)
+			rc = ulp_mapper_tcam_tbl_result_create(parms, tbl,
+							       &data);
+		/* write the tcam entry */
+		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:
+		/*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
@@ -1598,11 +1693,11 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	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			= aparms.idx;
+	free_parms.idx			= idx;
 	trc = tf_free_tcam_entry(tfp, &free_parms);
 	if (trc)
 		BNXT_TF_DBG(ERR, "Failed to free tcam[%d][%d][%d] on failure\n",
-			    tbl->resource_type, tbl->direction, aparms.idx);
+			    tbl->resource_type, tbl->direction, idx);
 
 	return rc;
 }
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +3 -2
index ac651f63f..985591844 100644
@@ -271,8 +271,9 @@ enum bnxt_ulp_regfile_index {
 
 enum bnxt_ulp_search_before_alloc {
 	BNXT_ULP_SEARCH_BEFORE_ALLOC_NO = 0,
-	BNXT_ULP_SEARCH_BEFORE_ALLOC_YES = 1,
-	BNXT_ULP_SEARCH_BEFORE_ALLOC_LAST = 2
+	BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP = 1,
+	BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_UPDATE = 2,
+	BNXT_ULP_SEARCH_BEFORE_ALLOC_LAST = 3
 };
 
 enum bnxt_ulp_fdb_resource_flags {
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +4 -4
index b9a25b064..6617ab9d4 100644
@@ -173,10 +173,10 @@ struct bnxt_ulp_mapper_tbl_info {
 	enum bnxt_ulp_resource_sub_type	resource_sub_type;
 	enum bnxt_ulp_cond_opcode	cond_opcode;
 	uint32_t			cond_operand;
-	uint8_t		direction;
-	uint32_t	priority;
-	uint8_t		srch_b4_alloc;
-	enum bnxt_ulp_critical_resource	critical_resource;
+	uint8_t				direction;
+	uint32_t			priority;
+	enum bnxt_ulp_search_before_alloc	srch_b4_alloc;
+	enum bnxt_ulp_critical_resource		critical_resource;
 
 	/* Information for accessing the ulp_key_field_list */
 	uint32_t	key_start_idx;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#66 lore raw

PATCH v3 18/22 net/bnxt: add templates for search before alloc

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Search before alloc allows reuse of constrained resources such as tcam, encap, and source modifications. The new templates will search the entry and alloc only if necessary.

---
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c   |  6 +++---
 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c | 14 +++++++-------
 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +3 -3
index 58b581cf6..14ce16ebd 100644
@@ -1052,7 +1052,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
 	.cond_opcode = BNXT_ULP_COND_OPCODE_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_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.result_start_idx = 96,
 	.result_bit_size = 0,
 	.result_num_fields = 0,
@@ -1069,7 +1069,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
 	.cond_opcode = BNXT_ULP_COND_OPCODE_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_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.result_start_idx = 99,
 	.result_bit_size = 0,
 	.result_num_fields = 0,
@@ -1084,7 +1084,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
 	.resource_sub_type =
 		BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
 	.direction = TF_DIR_TX,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.result_start_idx = 102,
 	.result_bit_size = 0,
 	.result_num_fields = 0,
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +7 -7
index 41d1d8772..94160a902 100644
@@ -3782,7 +3782,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 108,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4210,7 +4210,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 457,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4282,7 +4282,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 526,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4354,7 +4354,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 595,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4426,7 +4426,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 664,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4570,7 +4570,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_RX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_SKIP,
 	.key_start_idx = 802,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
@@ -4998,7 +4998,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = {
 	.resource_type = TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH,
 	.direction = TF_DIR_TX,
 	.priority = BNXT_ULP_PRIORITY_LEVEL_0,
-	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
+	.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_SEARCH_IF_HIT_UPDATE,
 	.key_start_idx = 1151,
 	.blob_key_bit_size = 167,
 	.key_bit_size = 167,
Signature · 1 line
2.21.1 (Apple Git-122.3)
#67 lore raw

PATCH v3 19/22 net/bnxt: enable shadow tables during session open

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Turn on shadow memory in the core to allow search before allocate. This allows reuse of constrained resources.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +1 -1
index 2febd5814..077527f78 100644
@@ -81,7 +81,7 @@ ulp_ctx_session_open(struct bnxt *bp,
 		return rc;
 	}
 
-	params.shadow_copy = false;
+	params.shadow_copy = true;
 	params.device_type = TF_DEVICE_TYPE_WH;
 	resources = &params.resources;
 	/** RX **/
Signature · 1 line
2.21.1 (Apple Git-122.3)
#68 lore raw

PATCH v3 20/22 net/bnxt: cleanup VF-representor dev ops

In reply to Ajit Khaparde

From: Somnath Kotur <[email protected]>

No need to access rx_cfa_code, cfa_code_map from the VF-Rep functions anymore.

Fixes 322bd6e70272 ("net/bnxt: add port representor infrastructure")
---
 drivers/net/bnxt/bnxt.h      |  1 -
 drivers/net/bnxt/bnxt_reps.c | 75 ++++--------------------------------
 2 files changed, 7 insertions(+), 69 deletions(-)
drivers/net/bnxt/bnxt.h +0 -1
index 41e7ae5bd..f4b2a3f92 100644
@@ -799,7 +799,6 @@ struct bnxt_vf_representor {
 	uint16_t		dflt_vnic_id;
 	uint16_t		svif;
 	uint16_t		vfr_tx_cfa_action;
-	uint16_t		rx_cfa_code;
 	uint32_t		rep2vf_flow_id;
 	uint32_t		vf2rep_flow_id;
 	/* Private data store of associated PF/Trusted VF */
drivers/net/bnxt/bnxt_reps.c +7 -68

122 lines not on this page · raw message

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

PATCH v3 21/22 net/bnxt: fix if condition

In reply to Ajit Khaparde

The if condition in bnxt_restore_mac_filters needs to check for the result of logical AND. But it was not doing it resulting in an incorrect check.

Fixes b02f1573cd07 ("net/bnxt: restore MAC filters during reset recovery")
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +1 -1
index dfc4b4190..510a0d9e0 100644
@@ -4372,7 +4372,7 @@ static int bnxt_restore_mac_filters(struct bnxt *bp)
 	uint16_t i;
 	int rc;
 
-	if (BNXT_VF(bp) & !BNXT_VF_IS_TRUSTED(bp))
+	if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp))
 		return 0;
 
 	rc = bnxt_dev_info_get_op(dev, &dev_info);
Signature · 1 line
2.21.1 (Apple Git-122.3)
#70 lore raw

PATCH v3 22/22 net/bnxt: fix build error with extra cflags

In reply to Ajit Khaparde

When we compile PMD with CFLAGS set to -O -g, build fails because of uninitialized error. This patch fixes it.

Fixes 1e46b3962620 ("net/bnxt: fill cfa action in Tx descriptor")

Bugzilla ID: 509

---
 drivers/net/bnxt/bnxt_txr.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/net/bnxt/bnxt_txr.c +5 -10
index 1113aca44..c7a2de67c 100644
@@ -111,7 +111,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 	uint32_t outer_tpid_bd = 0;
 	struct tx_bd_long *txbd;
 	struct tx_bd_long_hi *txbd1 = NULL;
-	uint32_t vlan_tag_flags, cfa_action;
+	uint32_t vlan_tag_flags;
 	bool long_bd = false;
 	unsigned short nr_bds = 0;
 	struct rte_mbuf *m_seg;
@@ -187,13 +187,6 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 		txbd->flags_type |= TX_BD_LONG_TYPE_TX_BD_LONG;
 		vlan_tag_flags = 0;
 
-		if (BNXT_TRUFLOW_EN(txq->bp)) {
-			if (txq->vfr_tx_cfa_action)
-				cfa_action = txq->vfr_tx_cfa_action;
-			else
-				cfa_action = txq->bp->tx_cfa_action;
-		}
-
 		/* HW can accelerate only outer vlan in QinQ mode */
 		if (tx_buf->mbuf->ol_flags & PKT_TX_QINQ_PKT) {
 			vlan_tag_flags = TX_BD_LONG_CFA_META_KEY_VLAN_TAG |
@@ -222,8 +215,10 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 		txbd1->lflags = 0;
 		txbd1->cfa_meta = vlan_tag_flags;
 
-		if (BNXT_TRUFLOW_EN(txq->bp))
-			txbd1->cfa_action = cfa_action;
+		if (txq->vfr_tx_cfa_action)
+			txbd1->cfa_action = txq->vfr_tx_cfa_action;
+		else
+			txbd1->cfa_action = txq->bp->tx_cfa_action;
 
 		if (tx_pkt->ol_flags & PKT_TX_TCP_SEG) {
 			uint16_t hdr_size;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#71 lore raw
In reply to Ajit Khaparde
Quoted 5 lines · Ajit Khaparde

Some fixes, cleanups and changes to augment pre-existing support in infrastructure

Please apply

Quoted 8 lines

v1->v2:
- Fixed some typos in patch [9/20].
v2->v3:
- Fixed coding style issues in patch [15/20] to use __rte_attribute.
- Updated commit messages.
- Added a patch to fix a logic error [21/22].
- Added a patch to fix compilation issue with -O and -g CFLAGS [22/22].

Patchset applied to dpdk-next-net-brcm.

Quoted 79 lines

Ajit Khaparde (2):
net/bnxt: fix if condition
net/bnxt: fix build error with extra cflags

Kishore Padmanabha (7):
net/bnxt: add access to nat global register net/bnxt: configure parif for offload miss rules net/bnxt: update nat template
net/bnxt: configure parif for the egress rules net/bnxt: ignore VLAN priority mask
net/bnxt: add egress template with VLAN tag match net/bnxt: add tcam table processing for search and alloc

Mike Baucom (9):
net/bnxt: add shadow and search capability to tcam net/bnxt: modify ulp mapper to use tcam search net/bnxt: add tf hash API
net/bnxt: modify tf shadow tcam to use tf hash net/bnxt: add shadow table capability with search net/bnxt: modify ulp mapper to use tbl search net/bnxt: modify shadow tcam and tbl reference count logic net/bnxt: add templates for search before alloc net/bnxt: enable shadow tables during session open

Somnath Kotur (1):
net/bnxt: cleanup VF-representor dev ops

Venkat Duvvuru (3):
net/bnxt: skip mark id injection into mbuf net/bnxt: fix port default rule create and destroy net/bnxt: delete VF FW rules on representor create

 drivers/net/bnxt/bnxt.h                       |   6 +-
 drivers/net/bnxt/bnxt_ethdev.c                |  83 +-
 drivers/net/bnxt/bnxt_hwrm.c                  |  49 ++
 drivers/net/bnxt/bnxt_hwrm.h                  |   2 +
 drivers/net/bnxt/bnxt_reps.c                  |  94 +-
 drivers/net/bnxt/bnxt_rxr.c                   |   3 +
 drivers/net/bnxt/bnxt_txq.h                   |   1 -
 drivers/net/bnxt/bnxt_txr.c                   |  19 +-
 drivers/net/bnxt/hsi_struct_def_dpdk.h        | 138 +++
 drivers/net/bnxt/meson.build                  |   1 +
 drivers/net/bnxt/tf_core/Makefile             |   1 +
 drivers/net/bnxt/tf_core/tf_core.c            | 139 ++-
 drivers/net/bnxt/tf_core/tf_core.h            | 174 ++++
 drivers/net/bnxt/tf_core/tf_device_p4.c       |   4 +-
 drivers/net/bnxt/tf_core/tf_hash.c            | 106 +++
 drivers/net/bnxt/tf_core/tf_hash.h            |  27 +
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c      | 766 +++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.h      | 124 +--
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c     | 818 +++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h     | 258 +++---
 drivers/net/bnxt/tf_core/tf_tbl.c             | 246 +++++-
 drivers/net/bnxt/tf_core/tf_tbl.h             |  22 +-
 drivers/net/bnxt/tf_core/tf_tcam.c            | 300 ++++++-
 drivers/net/bnxt/tf_core/tf_tcam.h            |  31 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |  97 ++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |  18 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       | 127 ++-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h         |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 505 +++++++----
 drivers/net/bnxt/tf_ulp/ulp_port_db.c         |   2 +
 drivers/net/bnxt/tf_ulp/ulp_port_db.h         |   1 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |  81 ++
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c | 434 ++++++----
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 556 +++++++++++-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  73 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |   4 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   8 +-
 38 files changed, 4462 insertions(+), 860 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.h

--
2.21.1 (Apple Git-122.3)

#72 lore raw
Quoted 18 lines · Ajit Khaparde

On Thu, Jul 23, 2020 at 10:32 PM Ajit Khaparde <[email protected] <mailto:[email protected]>> wrote:

Some fixes, cleanups and changes to augment pre-existing support in infrastructure

Please apply

v1->v2:
 - Fixed some typos in patch [9/20].
v2->v3:
 - Fixed coding style issues in patch [15/20] to use __rte_attribute.
 - Updated commit messages.
 - Added a patch to fix a logic error [21/22].
 - Added a patch to fix compilation issue with -O and -g CFLAGS [22/22].

Quoted 2 lines

Patchset applied to dpdk-next-net-brcm.

Hi Ajit,

Is a release note update required for the changes in this set, since not all patches are fixes?

If so can you please add release notes update and distribute it to the patches that adds the feature, instead of having a separate doc patch later?

Thanks,
ferruh

Quoted 35 lines

Ajit Khaparde (2):
  net/bnxt: fix if condition
  net/bnxt: fix build error with extra cflags

Kishore Padmanabha (7):
  net/bnxt: add access to nat global register net/bnxt: configure parif for offload miss rules net/bnxt: update nat template
  net/bnxt: configure parif for the egress rules net/bnxt: ignore VLAN priority mask
  net/bnxt: add egress template with VLAN tag match net/bnxt: add tcam table processing for search and alloc

Mike Baucom (9):
  net/bnxt: add shadow and search capability to tcam net/bnxt: modify ulp mapper to use tcam search net/bnxt: add tf hash API
  net/bnxt: modify tf shadow tcam to use tf hash net/bnxt: add shadow table capability with search net/bnxt: modify ulp mapper to use tbl search net/bnxt: modify shadow tcam and tbl reference count logic net/bnxt: add templates for search before alloc net/bnxt: enable shadow tables during session open

Somnath Kotur (1):
  net/bnxt: cleanup VF-representor dev ops

Venkat Duvvuru (3):
  net/bnxt: skip mark id injection into mbuf net/bnxt: fix port default rule create and destroy net/bnxt: delete VF FW rules on representor create

<...>

#73 lore raw
Quoted 21 lines · Ferruh Yigit
Quoted 3 lines · Ajit Khaparde

On Thu, Jul 23, 2020 at 10:32 PM Ajit Khaparde <

[email protected]

Quoted 7 lines

<mailto:[email protected]>> wrote:

Some fixes, cleanups and changes to augment pre-existing support in infrastructure

Please apply

Quoted 7 lines

v1->v2:
- Fixed some typos in patch [9/20].
v2->v3:
- Fixed coding style issues in patch [15/20] to use __rte_attribute.
- Updated commit messages.
- Added a patch to fix a logic error [21/22].
- Added a patch to fix compilation issue with -O and -g CFLAGS

[22/22].

Quoted 1 line
Quoted 9 lines
Quoted 2 lines

Patchset applied to dpdk-next-net-brcm.

Hi Ajit,

Is a release note update required for the changes in this set, since not all
patches are fixes?

Most likely not.
We had to change the implementation of some of the code to extend scalability and add support for more actions. But I will go through the patches and update the doc if needed.

Thanks
Ajit

Quoted 47 lines

If so can you please add release notes update and distribute it to the patches
that adds the feature, instead of having a separate doc patch later?

Thanks,
ferruh

Quoted 35 lines

Ajit Khaparde (2):
net/bnxt: fix if condition
net/bnxt: fix build error with extra cflags

Kishore Padmanabha (7):
net/bnxt: add access to nat global register net/bnxt: configure parif for offload miss rules net/bnxt: update nat template
net/bnxt: configure parif for the egress rules net/bnxt: ignore VLAN priority mask
net/bnxt: add egress template with VLAN tag match net/bnxt: add tcam table processing for search and alloc

Mike Baucom (9):
net/bnxt: add shadow and search capability to tcam net/bnxt: modify ulp mapper to use tcam search net/bnxt: add tf hash API
net/bnxt: modify tf shadow tcam to use tf hash net/bnxt: add shadow table capability with search net/bnxt: modify ulp mapper to use tbl search net/bnxt: modify shadow tcam and tbl reference count logic net/bnxt: add templates for search before alloc net/bnxt: enable shadow tables during session open

Somnath Kotur (1):
net/bnxt: cleanup VF-representor dev ops

Venkat Duvvuru (3):
net/bnxt: skip mark id injection into mbuf net/bnxt: fix port default rule create and destroy net/bnxt: delete VF FW rules on representor create

<...>

#74 lore raw

v4 cover bnxt patches

Some fixes, cleanups and changes to augment pre-existing support in infrastructure

Please apply

v1->v2:
- Fixed some typos in patch [9/20].
v2->v3:
- Fixed coding style issues in patch [15/20] to use __rte_attribute.
- Updated commit messages.
- Added a patch to fix a logic error [21/22].
- Added a patch to fix compilation issue with -O and -g CFLAGS [22/22].
v3->v4:
- Updated commit logs based on review comments.
- Updated fixes tag in commit logs for some patches.
- Removed unused code from patche [09/22].
- Updated doc where applicable.

Ajit Khaparde (2):
net/bnxt: fix if condition
net/bnxt: fix build error with extra cflags

Kishore Padmanabha (7):
net/bnxt: add access to nat global register net/bnxt: configure parif for offload miss rules net/bnxt: fix nat template
net/bnxt: configure parif for the egress rules net/bnxt: ignore VLAN priority mask
net/bnxt: add egress template with VLAN tag match net/bnxt: add tcam table processing for search and alloc

Mike Baucom (9):
net/bnxt: add shadow and search capability to tcam net/bnxt: modify ulp mapper to use tcam search net/bnxt: add TruFlow hash API
net/bnxt: update shadow tcam to use TruFlow hash net/bnxt: add shadow table capability with search net/bnxt: modify ulp mapper to use tbl search net/bnxt: fix table reference count for shadow tcam net/bnxt: add templates for search before alloc net/bnxt: enable shadow tables during session open

Somnath Kotur (1):
net/bnxt: cleanup VF-representor dev ops

Venkat Duvvuru (3):
net/bnxt: fix mark id update to mbuf net/bnxt: fix port default rule create and destroy net/bnxt: fix FW rule deletion on representor create

 doc/guides/nics/bnxt.rst                      |  46 +
 doc/guides/rel_notes/release_20_08.rst        |   1 +
 drivers/net/bnxt/bnxt.h                       |   6 +-
 drivers/net/bnxt/bnxt_ethdev.c                |  83 +-
 drivers/net/bnxt/bnxt_hwrm.c                  |  49 ++
 drivers/net/bnxt/bnxt_hwrm.h                  |   2 +
 drivers/net/bnxt/bnxt_reps.c                  |  94 +-
 drivers/net/bnxt/bnxt_rxr.c                   |   3 +
 drivers/net/bnxt/bnxt_txq.h                   |   1 -
 drivers/net/bnxt/bnxt_txr.c                   |  19 +-
 drivers/net/bnxt/hsi_struct_def_dpdk.h        | 138 +++
 drivers/net/bnxt/meson.build                  |   1 +
 drivers/net/bnxt/tf_core/Makefile             |   1 +
 drivers/net/bnxt/tf_core/tf_core.c            | 139 ++-
 drivers/net/bnxt/tf_core/tf_core.h            | 174 ++++
 drivers/net/bnxt/tf_core/tf_device_p4.c       |   4 +-
 drivers/net/bnxt/tf_core/tf_hash.c            | 106 +++
 drivers/net/bnxt/tf_core/tf_hash.h            |  27 +
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c      | 766 +++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.h      | 124 +--
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c     | 818 +++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h     | 258 +++---
 drivers/net/bnxt/tf_core/tf_tbl.c             | 246 +++++-
 drivers/net/bnxt/tf_core/tf_tbl.h             |  22 +-
 drivers/net/bnxt/tf_core/tf_tcam.c            | 300 ++++++-
 drivers/net/bnxt/tf_core/tf_tcam.h            |  31 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |  97 ++-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |  18 +-
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       | 127 ++-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h         |   2 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 505 +++++++----
 drivers/net/bnxt/tf_ulp/ulp_port_db.c         |   2 +
 drivers/net/bnxt/tf_ulp/ulp_port_db.h         |   1 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |  87 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c | 434 ++++++----
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 556 +++++++++++-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |  73 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |   4 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   8 +-
 40 files changed, 4507 insertions(+), 868 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_hash.h
Signature · 1 line
2.21.1 (Apple Git-122.3)
#75 lore raw

PATCH v4 1/22 net/bnxt: add shadow and search capability to tcam

From: Mike Baucom <[email protected]>

- Add TCAM shadow tables for searching
- Add Search API to allow reuse of TCAM entries

---
 drivers/net/bnxt/tf_core/tf_core.c        |  73 ++
 drivers/net/bnxt/tf_core/tf_core.h        | 101 +++
 drivers/net/bnxt/tf_core/tf_device_p4.c   |   2 +-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 885 +++++++++++++++++++++-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.h | 258 +++----
 drivers/net/bnxt/tf_core/tf_tcam.c        | 300 +++++++-
 drivers/net/bnxt/tf_core/tf_tcam.h        |  31 +-
 7 files changed, 1449 insertions(+), 201 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +73 -0
index 97e7952a9..ca3280b6b 100644
@@ -607,6 +607,79 @@ tf_search_identifier(struct tf *tfp,
 	return 0;
 }
 
+int
+tf_search_tcam_entry(struct tf *tfp,
+		     struct tf_search_tcam_entry_parms *parms)
+{
+	int rc;
+	struct tf_session *tfs;
+	struct tf_dev_info *dev;
+	struct tf_tcam_alloc_search_parms sparms;
+
+	TF_CHECK_PARMS2(tfp, parms);
+
+	memset(&sparms, 0, sizeof(struct tf_tcam_alloc_search_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_alloc_search_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;
+	}
+
+	sparms.dir = parms->dir;
+	sparms.type = parms->tcam_tbl_type;
+	sparms.key = parms->key;
+	sparms.key_size = TF_BITS2BYTES_WORD_ALIGN(parms->key_sz_in_bits);
+	sparms.mask = parms->mask;
+	sparms.priority = parms->priority;
+	sparms.alloc = parms->alloc;
+
+	/* Result is an in/out and so no need to copy during outputs */
+	sparms.result = parms->result;
+	sparms.result_size =
+		TF_BITS2BYTES_WORD_ALIGN(parms->result_sz_in_bits);
+
+	rc = dev->ops->tf_dev_alloc_search_tcam(tfp, &sparms);
+	if (rc) {
+		TFP_DRV_LOG(ERR,
+			    "%s: TCAM allocation failed, rc:%s\n",
+			    tf_dir_2_str(parms->dir),
+			    strerror(-rc));
+		return rc;
+	}
+
+	/* Copy the outputs */
+	parms->hit = sparms.hit;
+	parms->search_status = sparms.search_status;
+	parms->ref_cnt = sparms.ref_cnt;
+	parms->idx = sparms.idx;
+
+	return 0;
+}
+
 int
 tf_alloc_tcam_entry(struct tf *tfp,
 		    struct tf_alloc_tcam_entry_parms *parms)
drivers/net/bnxt/tf_core/tf_core.h +101 -0

119 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_device_p4.c +1 -1
index f38c38efb..afb60989e 100644
@@ -133,7 +133,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = {
 	.tf_dev_get_bulk_tbl = tf_tbl_bulk_get,
 	.tf_dev_alloc_tcam = tf_tcam_alloc,
 	.tf_dev_free_tcam = tf_tcam_free,
-	.tf_dev_alloc_search_tcam = NULL,
+	.tf_dev_alloc_search_tcam = tf_tcam_alloc_search,
 	.tf_dev_set_tcam = tf_tcam_set,
 	.tf_dev_get_tcam = NULL,
 	.tf_dev_insert_int_em_entry = tf_em_insert_int_entry,
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +863 -22

924 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_shadow_tcam.h +107 -151

339 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.c +281 -19

445 lines not on this page · raw message

drivers/net/bnxt/tf_core/tf_tcam.h +23 -8
index ee5bacc09..563b08c23 100644
@@ -104,19 +104,19 @@ struct tf_tcam_alloc_search_parms {
 	 */
 	enum tf_tcam_tbl_type type;
 	/**
-	 * [in] Enable search for matching entry
+	 * [in] Type of HCAPI
 	 */
-	uint8_t search_enable;
+	uint16_t hcapi_type;
 	/**
-	 * [in] Key data to match on (if search)
+	 * [in] Key data to match on
 	 */
 	uint8_t *key;
 	/**
-	 * [in] key size (if search)
+	 * [in] key size in bits
 	 */
 	uint16_t key_size;
 	/**
-	 * [in] Mask data to match on (if search)
+	 * [in] Mask data to match on
 	 */
 	uint8_t *mask;
 	/**
@@ -124,16 +124,31 @@ struct tf_tcam_alloc_search_parms {
 	 */
 	uint32_t priority;
 	/**
-	 * [out] If search, set if matching entry found
+	 * [in] Allocate on miss.
+	 */
+	uint8_t alloc;
+	/**
+	 * [out] Set if matching entry found
 	 */
 	uint8_t hit;
+	/**
+	 * [out] Search result status (hit, miss, reject)
+	 */
+	enum tf_tcam_search_status search_status;
 	/**
 	 * [out] Current refcnt after allocation
 	 */
 	uint16_t ref_cnt;
 	/**
-	 * [out] Idx allocated
-	 *
+	 * [in,out] The result data from the search is copied here
+	 */
+	uint8_t *result;
+	/**
+	 * [in,out] result size in bits for the result data
+	 */
+	uint16_t result_size;
+	/**
+	 * [out] Index found
 	 */
 	uint16_t idx;
 };
Signature · 1 line
2.21.1 (Apple Git-122.3)
#76 lore raw

PATCH v4 2/22 net/bnxt: add access to nat global register

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Add support to enable or disable the NAT global registers. The NAT feature is enabled in hardware during initialization and disabled at deinitialization of the application.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 83 ++++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h |  4 ++
 2 files changed, 87 insertions(+)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +83 -0
index 0869231a0..7c65a4b1b 100644
@@ -596,6 +596,52 @@ ulp_session_deinit(struct bnxt_ulp_session_state *session)
 	}
 }
 
+/*
+ * Internal api to enable NAT feature.
+ * Set set_flag to 1 to set the value or zero to reset the value.
+ * returns 0 on success.
+ */
+static int32_t
+bnxt_ulp_global_cfg_update(struct bnxt *bp,
+			   enum tf_dir dir,
+			   enum tf_global_config_type type,
+			   uint32_t offset,
+			   uint32_t value,
+			   uint32_t set_flag)
+{
+	uint32_t global_cfg = 0;
+	int rc;
+	struct tf_global_cfg_parms parms;
+
+	/* Initialize the params */
+	parms.dir = dir,
+	parms.type = type,
+	parms.offset = offset,
+	parms.config = (uint8_t *)&global_cfg,
+	parms.config_sz_in_bytes = sizeof(global_cfg);
+
+	rc = tf_get_global_cfg(&bp->tfp, &parms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to get global cfg 0x%x rc:%d\n",
+			    type, rc);
+		return rc;
+	}
+
+	if (set_flag)
+		global_cfg |= value;
+	else
+		global_cfg &= ~value;
+
+	/* SET the register RE_CFA_REG_ACT_TECT */
+	rc = tf_set_global_cfg(&bp->tfp, &parms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set global cfg 0x%x rc:%d\n",
+			    type, rc);
+		return rc;
+	}
+	return rc;
+}
+
 /*
  * When a port is initialized by dpdk. This functions is called
  * and this function initializes the ULP context and rest of the
@@ -732,6 +778,29 @@ bnxt_ulp_init(struct bnxt *bp)
 		goto jump_to_error;
 	}
 
+	/*
+	 * Enable NAT feature. Set the global configuration register
+	 * Tunnel encap to enable NAT with the reuse of existing inner
+	 * L2 header smac and dmac
+	 */
+	rc = bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,
+					TF_TUNNEL_ENCAP_NAT,
+					(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					BNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set rx global configuration\n");
+		goto jump_to_error;
+	}
+
+	rc = bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,
+					TF_TUNNEL_ENCAP_NAT,
+					(BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					BNXT_ULP_NAT_INNER_L2_HEADER_DMAC), 1);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to set tx global configuration\n");
+		goto jump_to_error;
+	}
+
 	return rc;
 
 jump_to_error:
@@ -785,6 +854,19 @@ bnxt_ulp_deinit(struct bnxt *bp)
 	/* Delete the Port database */
 	ulp_port_db_deinit(bp->ulp_ctx);
 
+	/* Disable NAT feature */
+	(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_RX, TF_TUNNEL_ENCAP,
+					 TF_TUNNEL_ENCAP_NAT,
+					 (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),
+					 0);
+
+	(void)bnxt_ulp_global_cfg_update(bp, TF_DIR_TX, TF_TUNNEL_ENCAP,
+					 TF_TUNNEL_ENCAP_NAT,
+					 (BNXT_ULP_NAT_INNER_L2_HEADER_SMAC |
+					  BNXT_ULP_NAT_INNER_L2_HEADER_DMAC),
+					 0);
+
 	/* Delete the ulp context and tf session */
 	ulp_ctx_detach(bp, session);
 
@@ -942,6 +1024,7 @@ bnxt_ulp_eth_dev_ptr2_cntxt_get(struct rte_eth_dev	*dev)
 
 	if (BNXT_ETH_DEV_IS_REPRESENTOR(dev)) {
 		struct bnxt_vf_representor *vfr = dev->data->dev_private;
+
 		bp = vfr->parent_dev->data->dev_private;
 	}
 
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +4 -0
index f9e5e2ba6..7c95ead55 100644
@@ -14,6 +14,10 @@
 
 #include "ulp_template_db_enum.h"
 
+/* NAT defines to reuse existing inner L2 SMAC and DMAC */
+#define BNXT_ULP_NAT_INNER_L2_HEADER_SMAC	0x2000
+#define BNXT_ULP_NAT_INNER_L2_HEADER_DMAC	0x100
+
 /* defines for the ulp_flags */
 #define BNXT_ULP_VF_REP_ENABLED		0x1
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
Signature · 1 line
2.21.1 (Apple Git-122.3)
#77 lore raw

PATCH v4 3/22 net/bnxt: configure parif for offload miss rules

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

PARIF is handler to a partition of the physical port. For the offload miss rules, the parif miss path needs to be considered. The higher parif are reserved for handling this.

---
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c  |  4 +--
 drivers/net/bnxt/tf_ulp/ulp_port_db.h    |  1 +
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 40 ++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +2 -2
index 4d4f7c4ea..d86e4c9ae 100644
@@ -12,8 +12,6 @@
 #include "ulp_flow_db.h"
 #include "ulp_mapper.h"
 
-#define BNXT_ULP_FREE_PARIF_BASE 11
-
 struct bnxt_ulp_def_param_handler {
 	int32_t (*vfr_func)(struct bnxt_ulp_context *ulp_ctx,
 			    struct ulp_tlv_param *param,
@@ -85,6 +83,8 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx,
 
 	if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
 		idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF;
+		/* Parif needs to be reset to a free partition */
+		parif += BNXT_ULP_FREE_PARIF_BASE;
 	} else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) {
 		idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF;
 		/* Parif needs to be reset to a free partition */
drivers/net/bnxt/tf_ulp/ulp_port_db.h +1 -0
index 393d01b7c..2b323d168 100644
@@ -10,6 +10,7 @@
 
 #define BNXT_PORT_DB_MAX_INTF_LIST		256
 #define BNXT_PORT_DB_MAX_FUNC			2048
+#define BNXT_ULP_FREE_PARIF_BASE		11
 
 enum bnxt_ulp_svif_type {
 	BNXT_ULP_DRV_FUNC_SVIF = 0,
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +40 -0
index 3891bcdc1..39f801b2f 100644
@@ -158,6 +158,43 @@ bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[],
 	return BNXT_TF_RC_SUCCESS;
 }
 
+/*
+ * Function to handle the post processing of the computed
+ * fields for the interface.
+ */
+static void
+bnxt_ulp_comp_fld_intf_update(struct ulp_rte_parser_params *params)
+{
+	uint32_t ifindex;
+	uint16_t port_id, parif;
+	enum bnxt_ulp_direction_type dir;
+
+	/* get the direction details */
+	dir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);
+
+	if (dir == BNXT_ULP_DIR_INGRESS) {
+		/* read the port id details */
+		port_id = ULP_COMP_FLD_IDX_RD(params,
+					      BNXT_ULP_CF_IDX_INCOMING_IF);
+		if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx,
+						      port_id,
+						      &ifindex)) {
+			BNXT_TF_DBG(ERR, "ParseErr:Portid is not valid\n");
+			return;
+		}
+		/* Set port PARIF */
+		if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
+					  BNXT_ULP_PHY_PORT_PARIF, &parif)) {
+			BNXT_TF_DBG(ERR, "ParseErr:ifindex is not valid\n");
+			return;
+		}
+		/* Parif needs to be reset to a free partition */
+		parif += BNXT_ULP_FREE_PARIF_BASE;
+		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_PHY_PORT_PARIF,
+				    parif);
+	}
+}
+
 /*
  * Function to handle the post processing of the parsing details
  */
@@ -213,6 +250,9 @@ bnxt_ulp_rte_parser_post_process(struct ulp_rte_parser_params *params)
 	/* Merge the hdr_fp_bit into the proto header bit */
 	params->hdr_bitmap.bits |= params->hdr_fp_bit.bits;
 
+	/* Update the computed interface parameters */
+	bnxt_ulp_comp_fld_intf_update(params);
+
 	/* TBD: Handle the flow rejection scenarios */
 	return 0;
 }
Signature · 1 line
2.21.1 (Apple Git-122.3)