DPDK patches and discussions
 help / color / mirror / Atom feed
From: Somnath Kotur <somnath.kotur@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH 10/36] net/bnxt: extend default identifier list to be global resource list
Date: Wed, 10 Jun 2020 12:27:07 +0530	[thread overview]
Message-ID: <20200610065733.18698-11-somnath.kotur@broadcom.com> (raw)
In-Reply-To: <20200610065733.18698-1-somnath.kotur@broadcom.com>

From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>

The default identifier list in ulp mapper is extended to support
other truflow resource types and not just identifiers.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          | 231 +++++++++++++++++---------
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |  11 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db.c     |  45 ++---
 drivers/net/bnxt/tf_ulp/ulp_template_db.h     |  18 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |  13 +-
 5 files changed, 196 insertions(+), 122 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
index 3b8ec43..158b430 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c
@@ -17,55 +17,111 @@
 #include "ulp_flow_db.h"
 #include "ulp_mapper.h"
 
-static struct bnxt_ulp_def_ident_info *
-ulp_mapper_def_ident_info_list_get(uint32_t *num_entries)
+static struct bnxt_ulp_glb_resource_info *
+ulp_mapper_glb_resource_info_list_get(uint32_t *num_entries)
 {
 	if (!num_entries)
 		return NULL;
-	*num_entries = BNXT_ULP_DEF_IDENT_INFO_TBL_MAX_SZ;
-	return ulp_def_ident_tbl;
+	*num_entries = BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ;
+	return ulp_glb_resource_tbl;
 }
 
 /*
- * Read a default identifier from the mapper regfile.
+ * Read the global resource from the mapper global resource list
  *
  * The regval is always returned in big-endian.
  *
  * returns 0 on success
  */
 static int32_t
-ulp_mapper_def_regfile_read(struct bnxt_ulp_mapper_data *mapper_data,
-			    enum tf_dir dir,
-			    uint16_t idx,
-			    uint64_t *regval)
+ulp_mapper_glb_resource_read(struct bnxt_ulp_mapper_data *mapper_data,
+			     enum tf_dir dir,
+			     uint16_t idx,
+			     uint64_t *regval)
 {
 	if (!mapper_data || !regval ||
-	    dir >= TF_DIR_MAX || idx >= BNXT_ULP_DEF_REGFILE_INDEX_LAST)
+	    dir >= TF_DIR_MAX || idx >= BNXT_ULP_GLB_REGFILE_INDEX_LAST)
 		return -EINVAL;
-	*regval = mapper_data->dflt_ids[dir][idx].ident;
+
+	*regval = mapper_data->glb_res_tbl[dir][idx].resource_hndl;
 	return 0;
 }
 
 /*
- * Write a default identifier to the mapper regfile
+ * Write a global resource to the mapper global resource list
  *
  * The regval value must be in big-endian.
  *
  * return 0 on success.
  */
 static int32_t
-ulp_mapper_def_regfile_write(struct bnxt_ulp_mapper_data *mapper_data,
-			     enum tf_dir dir,
-			     uint16_t idx,
-			     uint64_t regval)
+ulp_mapper_glb_resource_write(struct bnxt_ulp_mapper_data *data,
+			      struct bnxt_ulp_glb_resource_info *res,
+			      uint64_t regval)
 {
-	if (!mapper_data || dir >= TF_DIR_MAX ||
-	    idx >= BNXT_ULP_DEF_REGFILE_INDEX_LAST)
+	struct bnxt_ulp_mapper_glb_resource_entry *ent;
+
+	/* validate the arguments */
+	if (!data || res->direction >= TF_DIR_MAX ||
+	    res->glb_regfile_index >= BNXT_ULP_GLB_REGFILE_INDEX_LAST)
 		return -EINVAL;
-	mapper_data->dflt_ids[dir][idx].ident = regval;
+
+	/* write to the mapper data */
+	ent = &data->glb_res_tbl[res->direction][res->glb_regfile_index];
+	ent->resource_func = res->resource_func;
+	ent->resource_type = res->resource_type;
+	ent->resource_hndl = regval;
 	return 0;
 }
 
+/*
+ * Internal function to allocate identity resource and store it in mapper data.
+ *
+ * returns 0 on success
+ */
+static int32_t
+ulp_mapper_resource_ident_allocate(struct tf *tfp,
+				   struct bnxt_ulp_mapper_data *mapper_data,
+				   struct bnxt_ulp_glb_resource_info *glb_res)
+{
+	struct tf_alloc_identifier_parms iparms = { 0 };
+	struct tf_free_identifier_parms fparms;
+	uint64_t regval;
+	int32_t rc = 0;
+
+	iparms.ident_type = glb_res->resource_type;
+	iparms.dir = glb_res->direction;
+
+	/* Allocate the Identifier using tf api */
+	rc = tf_alloc_identifier(tfp, &iparms);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to alloc identifier [%s][%d]\n",
+			    (iparms.dir == TF_DIR_RX) ? "RX" : "TX",
+			    iparms.ident_type);
+		return rc;
+	}
+
+	/* entries are stored as big-endian format */
+	regval = tfp_cpu_to_be_64((uint64_t)iparms.id);
+	/* write to the mapper global resource */
+	rc = ulp_mapper_glb_resource_write(mapper_data, glb_res, regval);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to write to global resource id\n");
+		/* Free the identifer when update failed */
+		fparms.dir = iparms.dir;
+		fparms.ident_type = iparms.ident_type;
+		fparms.id = iparms.id;
+		tf_free_identifier(tfp, &fparms);
+		return rc;
+	}
+#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG
+	BNXT_TF_DBG(DEBUG, "Allocated Glb Res[%s][%d][%d] = 0x%04x\n",
+		    (iparms.dir == TF_DIR_RX) ? "RX" : "TX",
+		    glb_res->glb_regfile_index, iparms.ident_type, iparms.id);
+#endif
+	return rc;
+}
+
 /* Retrieve the cache initialization parameters for the tbl_idx */
 static struct bnxt_ulp_cache_tbl_params *
 ulp_mapper_cache_tbl_params_get(uint32_t tbl_idx)
@@ -323,7 +379,6 @@ ulp_mapper_cache_entry_free(struct bnxt_ulp_context *ulp,
 	 * formulate the args for tf calls.
 	 */
 	ulp_mapper_cache_res_type_get(res, &table_type, &table_id);
-
 	cache_entry = ulp_mapper_cache_entry_get(ulp, table_id,
 						 (uint16_t)res->resource_hndl);
 	if (!cache_entry || !cache_entry->ref_count) {
@@ -641,7 +696,7 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 			return -EINVAL;
 		}
 		break;
-	case BNXT_ULP_RESULT_OPC_SET_TO_DEF_REGFILE:
+	case BNXT_ULP_RESULT_OPC_SET_TO_GLB_REGFILE:
 		if (!ulp_operand_read(fld->result_operand,
 				      (uint8_t *)&idx,
 				      sizeof(uint16_t))) {
@@ -649,9 +704,9 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
-		if (ulp_mapper_def_regfile_read(parms->mapper_data,
-						dir,
-						idx, &regval)) {
+		if (ulp_mapper_glb_resource_read(parms->mapper_data,
+						 dir,
+						 idx, &regval)) {
 			BNXT_TF_DBG(ERR, "%s regfile[%d] read failed.\n",
 				    name, idx);
 			return -EINVAL;
@@ -789,16 +844,16 @@ ulp_mapper_keymask_field_process(struct bnxt_ulp_mapper_parms *parms,
 			return -EINVAL;
 		}
 		break;
-	case BNXT_ULP_SPEC_OPC_SET_TO_DEF_REGFILE:
+	case BNXT_ULP_SPEC_OPC_SET_TO_GLB_REGFILE:
 		if (!ulp_operand_read(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 (ulp_mapper_def_regfile_read(parms->mapper_data,
-						dir,
-						idx, &val64)) {
+		if (ulp_mapper_glb_resource_read(parms->mapper_data,
+						 dir,
+						 idx, &val64)) {
 			BNXT_TF_DBG(ERR, "%s regfile[%d] read failed.\n",
 				    name, idx);
 			return -EINVAL;
@@ -1736,6 +1791,37 @@ ulp_mapper_cache_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	return rc;
 }
 
+static int32_t
+ulp_mapper_glb_resource_info_init(struct tf *tfp,
+				  struct bnxt_ulp_mapper_data *mapper_data)
+{
+	struct bnxt_ulp_glb_resource_info *glb_res;
+	uint32_t num_glb_res_ids, idx;
+	int32_t rc = 0;
+
+	glb_res = ulp_mapper_glb_resource_info_list_get(&num_glb_res_ids);
+	if (!glb_res || !num_glb_res_ids) {
+		BNXT_TF_DBG(ERR, "Invalid Arguments\n");
+		return -EINVAL;
+	}
+
+	/* Iterate the global resources and process each one */
+	for (idx = 0; idx < num_glb_res_ids; idx++) {
+		switch (glb_res[idx].resource_func) {
+		case BNXT_ULP_RESOURCE_FUNC_IDENTIFIER:
+			rc = ulp_mapper_resource_ident_allocate(tfp,
+								mapper_data,
+								&glb_res[idx]);
+			break;
+		default:
+			BNXT_TF_DBG(ERR, "Global resource %x not supported\n",
+				    glb_res[idx].resource_func);
+			break;
+		}
+	}
+	return rc;
+}
+
 /*
  * Function to process the action template. Iterate through the list
  * action info templates and process it.
@@ -1911,6 +1997,32 @@ ulp_mapper_resources_free(struct bnxt_ulp_context	*ulp_ctx,
 	return rc;
 }
 
+static void
+ulp_mapper_glb_resource_info_deinit(struct bnxt_ulp_context *ulp_ctx,
+				    struct bnxt_ulp_mapper_data *mapper_data)
+{
+	struct bnxt_ulp_mapper_glb_resource_entry *ent;
+	struct ulp_flow_db_res_params res;
+	uint32_t dir, idx;
+
+	/* Iterate the global resources and process each one */
+	for (dir = TF_DIR_RX; dir < TF_DIR_MAX; dir++) {
+		for (idx = 0; idx < BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ;
+		      idx++) {
+			ent = &mapper_data->glb_res_tbl[dir][idx];
+			if (ent->resource_func ==
+			    BNXT_ULP_RESOURCE_FUNC_INVALID)
+				continue;
+			memset(&res, 0, sizeof(struct ulp_flow_db_res_params));
+			res.resource_func = ent->resource_func;
+			res.direction = dir;
+			res.resource_type = ent->resource_type;
+			res.resource_hndl = ent->resource_hndl;
+			ulp_mapper_resource_free(ulp_ctx, &res);
+		}
+	}
+}
+
 int32_t
 ulp_mapper_flow_destroy(struct bnxt_ulp_context	*ulp_ctx, uint32_t fid)
 {
@@ -2057,11 +2169,8 @@ int32_t
 ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx)
 {
 	struct bnxt_ulp_cache_tbl_params *tbl;
-	struct tf_alloc_identifier_parms iparms;
 	struct bnxt_ulp_mapper_data *data;
-	struct bnxt_ulp_def_ident_info *dflt_ids;
-	uint32_t i, num_dflt_ids, reg_idx;
-	uint64_t regval;
+	uint32_t i;
 	struct tf *tfp;
 	int32_t rc, csize;
 
@@ -2086,30 +2195,11 @@ ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx)
 		return -ENOMEM;
 	}
 
-	/* Allocate the default ids. */
-	dflt_ids = ulp_mapper_def_ident_info_list_get(&num_dflt_ids);
-	for (i = 0; i < num_dflt_ids; i++) {
-		iparms.ident_type = dflt_ids[i].ident_type;
-		iparms.dir = dflt_ids[i].direction;
-
-		rc = tf_alloc_identifier(tfp, &iparms);
-		if (rc) {
-			BNXT_TF_DBG(ERR, "Failed to alloc dflt "
-				    "identifier [%s][%d]\n",
-				    (iparms.dir == TF_DIR_RX) ? "RX" : "TX",
-				    iparms.ident_type);
-			goto error;
-		}
-		reg_idx = dflt_ids[i].def_regfile_index;
-		/* All regfile entries are stored as 64bit big-endian values. */
-		regval = tfp_cpu_to_be_64((uint64_t)iparms.id);
-		rc = ulp_mapper_def_regfile_write(data, iparms.dir,
-						  reg_idx, regval);
-		if (rc) {
-			BNXT_TF_DBG(ERR, "Failed to write to default "
-				    "regfile.\n");
-			goto error;
-		}
+	/* Allocate the global resource ids */
+	rc = ulp_mapper_glb_resource_info_init(tfp, data);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to initialize global resource ids\n");
+		goto error;
 	}
 
 	/* Allocate the ulp cache tables. */
@@ -2144,12 +2234,8 @@ ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx)
 void
 ulp_mapper_deinit(struct bnxt_ulp_context *ulp_ctx)
 {
-	struct tf_free_identifier_parms free_parms;
-	struct bnxt_ulp_def_ident_info *dflt_ids;
 	struct bnxt_ulp_mapper_data *data;
-	uint32_t i, num_dflt_ids, reg_idx;
-	enum tf_dir dir;
-	uint64_t regval;
+	uint32_t i;
 	struct tf *tfp;
 
 	if (!ulp_ctx) {
@@ -2174,27 +2260,8 @@ ulp_mapper_deinit(struct bnxt_ulp_context *ulp_ctx)
 		goto free_mapper_data;
 	}
 
-	/* Free the default prof func ids per direction. */
-	dflt_ids = ulp_mapper_def_ident_info_list_get(&num_dflt_ids);
-	for (i = 0; i < num_dflt_ids; i++) {
-		reg_idx = dflt_ids[i].def_regfile_index;
-		dir = dflt_ids[i].direction;
-		free_parms.ident_type = dflt_ids[i].ident_type;
-		free_parms.dir = dir;
-		if (ulp_mapper_def_regfile_read(data, dir, reg_idx, &regval)) {
-			BNXT_TF_DBG(ERR, "Failed to read def regfile to free "
-				    "identifier.\n");
-			continue;
-		}
-		/*
-		 * All regfile entries are stored as 64bit big-endian.  Need
-		 * to convert the value to cpu before calling tf.
-		 */
-		regval = tfp_be_to_cpu_64(regval);
-		free_parms.id = (uint16_t)regval;
-		/* Ignore errors and free the remaining identifiers. */
-		tf_free_identifier(tfp, &free_parms);
-	}
+	/* Free the global resource info table entries */
+	ulp_mapper_glb_resource_info_deinit(ulp_ctx, data);
 
 free_mapper_data:
 	/* Free the ulp cache tables */
diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.h b/drivers/net/bnxt/tf_ulp/ulp_mapper.h
index 3be04e8..0c9bb86 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_mapper.h
+++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.h
@@ -39,14 +39,15 @@ struct bnxt_ulp_mapper_cache_entry {
 	uint8_t ident_types[BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM];
 };
 
-struct bnxt_ulp_mapper_def_id_entry {
-	enum tf_identifier_type ident_type;
-	uint64_t ident;
+struct bnxt_ulp_mapper_glb_resource_entry {
+	enum bnxt_ulp_resource_func	resource_func;
+	uint32_t			resource_type; /* TF_ enum type */
+	uint64_t			resource_hndl;
 };
 
 struct bnxt_ulp_mapper_data {
-	struct bnxt_ulp_mapper_def_id_entry
-		dflt_ids[TF_DIR_MAX][BNXT_ULP_DEF_IDENT_INFO_TBL_MAX_SZ];
+	struct bnxt_ulp_mapper_glb_resource_entry
+		glb_res_tbl[TF_DIR_MAX][BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ];
 	struct bnxt_ulp_mapper_cache_entry
 		*cache_tbl[BNXT_ULP_CACHE_TBL_MAX_SZ];
 };
diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.c b/drivers/net/bnxt/tf_ulp/ulp_template_db.c
index 444373a..c6b1b9b 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_template_db.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.c
@@ -308,20 +308,10 @@ struct bnxt_ulp_cache_tbl_params ulp_cache_tbl_params[] = {
 	}
 };
 
-struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] = {
-	[0] = {
-		.ident_type              = TF_IDENT_TYPE_PROF_FUNC,
-		.def_regfile_index       =
-			BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID,
-		.direction               = TF_DIR_RX
-	}
-};
-
 struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = {
 	[BNXT_ULP_DEVICE_ID_WH_PLUS] = {
 		.global_fid_enable       = BNXT_ULP_SYM_YES,
-		.byte_order              = (enum bnxt_ulp_byte_order)
-						BNXT_ULP_SYM_LITTLE_ENDIAN,
+		.byte_order              = BNXT_ULP_BYTE_ORDER_LE,
 		.encap_byte_swap         = 1,
 		.lfid_entries            = 16384,
 		.lfid_entry_size         = 4,
@@ -332,6 +322,21 @@ struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = {
 	}
 };
 
+struct bnxt_ulp_glb_resource_info ulp_glb_resource_tbl[] = {
+	[0] = {
+	.resource_func           = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
+	.resource_type           = TF_IDENT_TYPE_PROF_FUNC,
+	.glb_regfile_index       = BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID,
+	.direction               = TF_DIR_RX
+	},
+	[1] = {
+	.resource_func           = BNXT_ULP_RESOURCE_FUNC_IDENTIFIER,
+	.resource_type           = TF_IDENT_TYPE_PROF_FUNC,
+	.glb_regfile_index       = BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID,
+	.direction               = TF_DIR_TX
+	}
+};
+
 struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {
 	[RTE_FLOW_ITEM_TYPE_END] = {
 		.hdr_type                = BNXT_ULP_HDR_TYPE_END,
@@ -846,10 +851,10 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	.mask_opcode = BNXT_ULP_MASK_OPC_SET_TO_CONSTANT,
 	.mask_operand = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
-	.spec_opcode = BNXT_ULP_SPEC_OPC_SET_TO_DEF_REGFILE,
+	.spec_opcode = BNXT_ULP_SPEC_OPC_SET_TO_GLB_REGFILE,
 	.spec_operand = {
-		(BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID >> 8) & 0xff,
-		BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID & 0xff,
+		(BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID >> 8) & 0xff,
+		BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
@@ -1208,10 +1213,10 @@ struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[] = {
 	.mask_opcode = BNXT_ULP_MASK_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_SPEC_OPC_SET_TO_DEF_REGFILE,
+	.spec_opcode = BNXT_ULP_SPEC_OPC_SET_TO_GLB_REGFILE,
 	.spec_operand = {
-		(BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID >> 8) & 0xff,
-		BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID & 0xff,
+		(BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID >> 8) & 0xff,
+		BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
@@ -1385,10 +1390,10 @@ struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[] = {
 	},
 	{
 	.field_bit_size = 7,
-	.result_opcode = BNXT_ULP_RESULT_OPC_SET_TO_DEF_REGFILE,
+	.result_opcode = BNXT_ULP_RESULT_OPC_SET_TO_GLB_REGFILE,
 	.result_operand = {
-		(BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID >> 8) & 0xff,
-		BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID & 0xff,
+		(BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID >> 8) & 0xff,
+		BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID & 0xff,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
 	},
diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.h b/drivers/net/bnxt/tf_ulp/ulp_template_db.h
index d087404..1bec4b6 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_template_db.h
+++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.h
@@ -26,7 +26,7 @@
 #define BNXT_ULP_ACT_HID_SHFTL 23
 #define BNXT_ULP_ACT_HID_MASK 255
 #define BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM 2
-#define BNXT_ULP_DEF_IDENT_INFO_TBL_MAX_SZ 1
+#define BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ 2
 
 enum bnxt_ulp_action_bit {
 	BNXT_ULP_ACTION_BIT_MARK             = 0x0000000000000001,
@@ -129,11 +129,6 @@ enum bnxt_ulp_cf_idx {
 	BNXT_ULP_CF_IDX_LAST = 29
 };
 
-enum bnxt_ulp_def_regfile_index {
-	BNXT_ULP_DEF_REGFILE_INDEX_DEF_PROF_FUNC_ID = 0,
-	BNXT_ULP_DEF_REGFILE_INDEX_LAST = 1
-};
-
 enum bnxt_ulp_device_id {
 	BNXT_ULP_DEVICE_ID_WH_PLUS = 0,
 	BNXT_ULP_DEVICE_ID_THOR = 1,
@@ -148,6 +143,11 @@ enum bnxt_ulp_direction {
 	BNXT_ULP_DIRECTION_LAST = 2
 };
 
+enum bnxt_ulp_glb_regfile_index {
+	BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID = 0,
+	BNXT_ULP_GLB_REGFILE_INDEX_LAST = 1
+};
+
 enum bnxt_ulp_hdr_type {
 	BNXT_ULP_HDR_TYPE_NOT_SUPPORTED = 0,
 	BNXT_ULP_HDR_TYPE_SUPPORTED = 1,
@@ -165,7 +165,7 @@ enum bnxt_ulp_mask_opc {
 	BNXT_ULP_MASK_OPC_SET_TO_CONSTANT = 0,
 	BNXT_ULP_MASK_OPC_SET_TO_HDR_FIELD = 1,
 	BNXT_ULP_MASK_OPC_SET_TO_REGFILE = 2,
-	BNXT_ULP_MASK_OPC_SET_TO_DEF_REGFILE = 3,
+	BNXT_ULP_MASK_OPC_SET_TO_GLB_REGFILE = 3,
 	BNXT_ULP_MASK_OPC_ADD_PAD = 4,
 	BNXT_ULP_MASK_OPC_LAST = 5
 };
@@ -227,7 +227,7 @@ enum bnxt_ulp_result_opc {
 	BNXT_ULP_RESULT_OPC_SET_TO_ACT_PROP = 1,
 	BNXT_ULP_RESULT_OPC_SET_TO_ENCAP_ACT_PROP_SZ = 2,
 	BNXT_ULP_RESULT_OPC_SET_TO_REGFILE = 3,
-	BNXT_ULP_RESULT_OPC_SET_TO_DEF_REGFILE = 4,
+	BNXT_ULP_RESULT_OPC_SET_TO_GLB_REGFILE = 4,
 	BNXT_ULP_RESULT_OPC_SET_TO_COMP_FIELD = 5,
 	BNXT_ULP_RESULT_OPC_LAST = 6
 };
@@ -243,7 +243,7 @@ enum bnxt_ulp_spec_opc {
 	BNXT_ULP_SPEC_OPC_SET_TO_HDR_FIELD = 1,
 	BNXT_ULP_SPEC_OPC_SET_TO_COMP_FIELD = 2,
 	BNXT_ULP_SPEC_OPC_SET_TO_REGFILE = 3,
-	BNXT_ULP_SPEC_OPC_SET_TO_DEF_REGFILE = 4,
+	BNXT_ULP_SPEC_OPC_SET_TO_GLB_REGFILE = 4,
 	BNXT_ULP_SPEC_OPC_ADD_PAD = 5,
 	BNXT_ULP_SPEC_OPC_LAST = 6
 };
diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h
index 22a2173..3cbed24 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_template_struct.h
+++ b/drivers/net/bnxt/tf_ulp/ulp_template_struct.h
@@ -224,10 +224,11 @@ struct bnxt_ulp_mapper_ident_info {
 	enum bnxt_ulp_regfile_index	regfile_wr_idx;
 };
 
-struct bnxt_ulp_def_ident_info {
-	enum tf_dir direction;
-	enum tf_identifier_type ident_type;
-	enum bnxt_ulp_def_regfile_index def_regfile_index;
+struct bnxt_ulp_glb_resource_info {
+	enum bnxt_ulp_resource_func	resource_func;
+	uint32_t			resource_type; /* TF_ enum type */
+	enum bnxt_ulp_glb_regfile_index	glb_regfile_index;
+	enum tf_dir			direction;
 };
 
 struct bnxt_ulp_cache_tbl_params {
@@ -298,10 +299,10 @@ extern struct bnxt_ulp_mapper_ident_info	ulp_ident_list[];
 extern uint32_t ulp_act_prop_map_table[];
 
 /*
- * The ulp_def_ident_tbl provides the list of default identifiers that need to
+ * The ulp_glb_resource_tbl provides the list of global resources that need to
  * be initialized and where to store them.
  */
-extern struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[];
+extern struct bnxt_ulp_glb_resource_info ulp_glb_resource_tbl[];
 
 /*
  * The ulp_cache_tbl_parms table provides the sizes of the cache tables the
-- 
2.7.4


  parent reply	other threads:[~2020-06-10  7:03 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10  6:56 [dpdk-dev] [PATCH 00/36] bnxt fixes and enhancements Somnath Kotur
2020-06-10  6:56 ` [dpdk-dev] [PATCH 01/36] net/bnxt: Makefile changes Somnath Kotur
2020-06-10  6:56 ` [dpdk-dev] [PATCH 02/36] net/bnxt: remove svif and vlan information from header bitmap Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 03/36] net/bnxt: add vfr flag to the mark manager Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 04/36] net/bnxt: support for mark action for LFID rules Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 05/36] net/bnxt: remove mem field from mapper class table Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 06/36] net/bnxt: support more resource functions in flow database Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 07/36] net/bnxt: rename the ulp action bitmap enumeration values Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 08/36] net/bnxt: add support for computed header field in result opcode Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 09/36] net/bnxt: updated compute field list and access macros Somnath Kotur
2020-06-10  6:57 ` Somnath Kotur [this message]
2020-06-10  6:57 ` [dpdk-dev] [PATCH 11/36] net/bnxt: add resource sub type to class and action tables Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 12/36] net/bnxt: remove cache tbl id from the mapper class table Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 13/36] net/bnxt: move vfr flag from computed field list to " Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 14/36] net/bnxt: add support for action bitmap opcode in result field processing Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 15/36] net/bnxt: direction bit needs to be added to the action bitmap Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 16/36] net/bnxt: remove cache_tbl_id enums Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 17/36] net/bnxt: extend index table processing to process action templates Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 18/36] net/bnxt: use vport in the phy port act handler Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 19/36] net/bnxt: add enum to the critical resource Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 20/36] net/bnxt: rename regfile_wr_idx to regfile_idx Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 21/36] net/bnxt: remove unused enum in regfile index Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 22/36] net/bnxt: rename an enum in the " Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 23/36] net/bnxt: rename the enums in the bnxt_ulp_resource_sub_type Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 24/36] net/bnxt: add a devarg to set max flow count Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 25/36] net/bnxt: add support for vxlan encap and decap templates Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 26/36] net/bnxt: flow db api to get vf rep action record Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 27/36] net/bnxt: parse ipv6 vtc_flow field for more granularly Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 28/36] net/bnxt: remove the implicit bitset update for vnic action Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 29/36] net/bnxt: divide the ulp template db file to smaller modules Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 30/36] net/bnxt: unify the mapper opcodes into single enum Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 31/36] net/bnxt: change opcode for adding pad to setting zero for common usage Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 32/36] net/bnxt: optimized key/mask/result fields to use set to zero opcode Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 33/36] net/bnxt: add support for internal exact match flows Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 34/36] net/bnxt: enable vfr flag processing with mark db opcode Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 35/36] net/bnxt: rename fields in the device params structure Somnath Kotur
2020-06-10  6:57 ` [dpdk-dev] [PATCH 36/36] net/bnxt: update ulp template database for new opcodes Somnath Kotur
2020-06-10 11:43 [dpdk-dev] [PATCH 00/36] bnxt patches Somnath Kotur
2020-06-10 11:44 ` [dpdk-dev] [PATCH 10/36] net/bnxt: extend default identifier list to be global resource list Somnath Kotur
2020-06-12 12:49 [dpdk-dev] [PATCH v3 00/36] bnxt patches Somnath Kotur
2020-06-12 12:49 ` [dpdk-dev] [PATCH 10/36] net/bnxt: extend default identifier list to be global resource list Somnath Kotur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200610065733.18698-11-somnath.kotur@broadcom.com \
    --to=somnath.kotur@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).