Skip to contentSkip to conversation

enhancements to host based flow table management

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

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

PATCH v2 49/58 net/bnxt: add field opcodes in ULP

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Add field opcodes that perform logical evaluation of multiple conditions. Also add more logging especially in error path.

---
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  806 +-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   71 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |  622 +-
 .../bnxt/tf_ulp/ulp_template_db_thor_act.c    |  196 -
 .../bnxt/tf_ulp/ulp_template_db_thor_class.c  | 6009 ++-------------
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c | 1734 ++---
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 6487 +++++++----------
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |    5 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.c           |    6 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.h           |    2 +-
 10 files changed, 4513 insertions(+), 11425 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +404 -402
index 58104eeedf..05e2106c38 100644
@@ -20,11 +20,18 @@
 #include "ulp_template_db_tbl.h"
 #include "ulp_port_db.h"
 
+static uint8_t mapper_fld_zeros[16] = { 0 };
+
 static uint8_t mapper_fld_ones[16] = {
 	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
 };
 
+static uint8_t mapper_fld_one[16] = {
+	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
+};
+
 static const char *
 ulp_mapper_tmpl_name_str(enum bnxt_ulp_template_type tmpl_type)
 {
@@ -882,7 +889,6 @@ ulp_mapper_ident_extract(struct bnxt_ulp_mapper_parms *parms,
 
 static int32_t
 ulp_mapper_field_port_db_process(struct bnxt_ulp_mapper_parms *parms,
-				 struct bnxt_ulp_mapper_field_info *fld,
 				 uint32_t port_id,
 				 uint16_t val16,
 				 uint8_t **val)
@@ -912,332 +918,122 @@ ulp_mapper_field_port_db_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 		break;
 	default:
-		BNXT_TF_DBG(ERR, "Invalid port_data %s\n", fld->description);
-		return -EINVAL;
-	}
-	return 0;
-}
-
-static int32_t
-ulp_mapper_field_process_inc_dec(struct bnxt_ulp_mapper_field_info *fld,
-				 struct ulp_blob *blob,
-				 uint64_t *val64,
-				 uint16_t const_val16,
-				 uint32_t bitlen,
-				 uint32_t *update_flag)
-{
-	uint64_t l_val64 = *val64;
-
-	if (fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_PLUS_CONST ||
-	    fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_PLUS_CONST_POST) {
-		l_val64 += const_val16;
-		l_val64 = tfp_be_to_cpu_64(l_val64);
-		ulp_blob_push_64(blob, &l_val64, bitlen);
-	} else if (fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_MINUS_CONST ||
-		   fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_MINUS_CONST_POST) {
-		l_val64 -= const_val16;
-		l_val64 = tfp_be_to_cpu_64(l_val64);
-		ulp_blob_push_64(blob, &l_val64, bitlen);
-	} else {
-		BNXT_TF_DBG(ERR, "Invalid field opcode %u\n", fld->field_opc);
+		BNXT_TF_DBG(ERR, "Invalid port_data %d\n", port_data);
 		return -EINVAL;
 	}
-
-	if (fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_MINUS_CONST_POST ||
-	    fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_PLUS_CONST_POST) {
-		*val64 = l_val64;
-		*update_flag = 1;
-	}
 	return 0;
 }
 
 static int32_t
-ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
-			 enum tf_dir dir,
-			 struct bnxt_ulp_mapper_field_info *fld,
-			 struct ulp_blob *blob,
-			 uint8_t is_key,
-			 const char *name)
+ulp_mapper_field_src_process(struct bnxt_ulp_mapper_parms *parms,
+			     enum bnxt_ulp_field_src field_src,
+			     uint8_t *field_opr,
+			     enum tf_dir dir,
+			     uint8_t is_key,
+			     uint32_t bitlen,
+			     uint8_t **val,
+			     uint32_t *val_len,
+			     uint64_t *value)
 {
-	uint32_t val_size = 0, field_size = 0;
-	uint64_t hdr_bit, act_bit, regval;
-	uint16_t write_idx = blob->write_idx;
-	uint16_t idx, size_idx, bitlen, offset;
-	uint8_t	*val = NULL;
-	uint8_t tmpval[16];
+	struct bnxt_ulp_mapper_data *m;
 	uint8_t bit;
-	uint32_t src1_sel = 0;
-	enum bnxt_ulp_field_src fld_src;
-	uint8_t *fld_src_oper;
-	enum bnxt_ulp_field_cond_src field_cond_src;
-	uint16_t const_val = 0;
-	uint32_t update_flag = 0;
-	uint64_t src1_val64;
-	uint32_t port_id;
+	uint32_t port_id, val_size, field_size;
+	uint16_t idx, size_idx, offset;
+	uint32_t bytelen = ULP_BITS_2_BYTE(bitlen);
+	uint8_t *buffer;
+	uint64_t lregval;
 	bool shared;
 
-	/* process the field opcode */
-	if (fld->field_opc != BNXT_ULP_FIELD_OPC_COND_OP) {
-		field_cond_src = BNXT_ULP_FIELD_COND_SRC_TRUE;
-		/* Read the constant from the second operand */
-		memcpy(&const_val, fld->field_opr2, sizeof(uint16_t));
-		const_val = tfp_be_to_cpu_16(const_val);
-	} else {
-		field_cond_src = fld->field_cond_src;
-	}
-
-	bitlen = fld->field_bit_size;
-	/* Evaluate the condition */
-	switch (field_cond_src) {
-	case BNXT_ULP_FIELD_COND_SRC_TRUE:
-		src1_sel = 1;
-		break;
-	case BNXT_ULP_FIELD_COND_SRC_CF:
-		if (!ulp_operand_read(fld->field_cond_opr,
-				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed.\n", name);
-			return -EINVAL;
-		}
-		idx = tfp_be_to_cpu_16(idx);
-		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))
-			src1_sel = 1;
-		break;
-	case BNXT_ULP_FIELD_COND_SRC_RF:
-		if (!ulp_operand_read(fld->field_cond_opr,
-				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
-			return -EINVAL;
-		}
-
-		idx = tfp_be_to_cpu_16(idx);
-		/* Uninitialized regfile entries return 0 */
-		if (!ulp_regfile_read(parms->regfile, idx, &regval)) {
-			BNXT_TF_DBG(ERR, "%s regfile[%d] read oob\n",
-				    name, idx);
-			return -EINVAL;
-		}
-		if (regval)
-			src1_sel = 1;
-		break;
-	case BNXT_ULP_FIELD_COND_SRC_ACT_BIT:
-		if (!ulp_operand_read(fld->field_cond_opr,
-				      (uint8_t *)&act_bit, sizeof(uint64_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
-			return -EINVAL;
-		}
-		act_bit = tfp_be_to_cpu_64(act_bit);
-		if (ULP_BITMAP_ISSET(parms->act_bitmap->bits, act_bit))
-			src1_sel = 1;
-		break;
-	case BNXT_ULP_FIELD_COND_SRC_HDR_BIT:
-		if (!ulp_operand_read(fld->field_cond_opr,
-				      (uint8_t *)&hdr_bit, sizeof(uint64_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
-			return -EINVAL;
-		}
-		hdr_bit = tfp_be_to_cpu_64(hdr_bit);
-		if (ULP_BITMAP_ISSET(parms->hdr_bitmap->bits, hdr_bit))
-			src1_sel = 1;
-		break;
-	case BNXT_ULP_FIELD_COND_SRC_FIELD_BIT:
-		if (!ulp_operand_read(fld->field_cond_opr, (uint8_t *)&idx,
-				      sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed.\n", name);
-			return -EINVAL;
-		}
-		idx = tfp_be_to_cpu_16(idx);
-		/* get the index from the global field list */
-		if (ulp_mapper_glb_field_tbl_get(parms, idx, &bit)) {
-			BNXT_TF_DBG(ERR, "invalid ulp_glb_field_tbl idx %d\n",
-				    idx);
-			return -EINVAL;
-		}
-		if (bit && (ULP_INDEX_BITMAP_GET(parms->fld_bitmap->bits, bit)))
-			src1_sel = 1;
-		break;
-	default:
-		BNXT_TF_DBG(ERR, "%s invalid field opcode 0x%x at %d\n",
-			    name, fld->field_cond_src, write_idx);
-		return -EINVAL;
-	}
-
-	/* pick the selected source */
-	if (src1_sel) {
-		fld_src = fld->field_src1;
-		fld_src_oper = fld->field_opr1;
-	} else {
-		fld_src = fld->field_src2;
-		fld_src_oper = fld->field_opr2;
-	}
-
+	*val_len = bitlen;
+	*value = 0;
 	/* Perform the action */
-	switch (fld_src) {
+	switch (field_src) {
 	case BNXT_ULP_FIELD_SRC_ZERO:
-		if (ulp_blob_pad_push(blob, bitlen) < 0) {
-			BNXT_TF_DBG(ERR, "%s too large for blob\n", name);
-			return -EINVAL;
-		}
+		*val = mapper_fld_zeros;
 		break;
 	case BNXT_ULP_FIELD_SRC_CONST:
-		val = fld_src_oper;
-		if (!ulp_blob_push(blob, val, bitlen)) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
-			return -EINVAL;
-		}
+		*val = field_opr;
 		break;
 	case BNXT_ULP_FIELD_SRC_ONES:
-		val = mapper_fld_ones;
-		if (!ulp_blob_push(blob, val, bitlen)) {
-			BNXT_TF_DBG(ERR, "%s too large for blob\n", name);
-			return -EINVAL;
-		}
+		*val = mapper_fld_ones;
+		*value = 1;
 		break;
 	case BNXT_ULP_FIELD_SRC_CF:
-		if (!ulp_operand_read(fld_src_oper,
+		if (!ulp_operand_read(field_opr,
 				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed.\n",
-				    name);
+			BNXT_TF_DBG(ERR, "CF operand read failed\n");
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
-		if (idx >= BNXT_ULP_CF_IDX_LAST) {
-			BNXT_TF_DBG(ERR, "%s comp field [%d] read oob\n",
-				    name, idx);
+		if (idx >= BNXT_ULP_CF_IDX_LAST || bytelen > sizeof(uint32_t)) {
+			BNXT_TF_DBG(ERR, "comp field [%d] read oob %d\n", idx,
+				    bytelen);
 			return -EINVAL;
 		}
-		if (fld->field_opc == BNXT_ULP_FIELD_OPC_COND_OP) {
-			val = ulp_blob_push_32(blob, &parms->comp_fld[idx],
-					       bitlen);
-			if (!val) {
-				BNXT_TF_DBG(ERR, "%s push to blob failed\n",
-					    name);
-				return -EINVAL;
-			}
-		} else if (fld->field_opc == BNXT_ULP_FIELD_OPC_PORT_TABLE) {
-			port_id = ULP_COMP_FLD_IDX_RD(parms, idx);
-			if (ulp_mapper_field_port_db_process(parms, fld,
-							     port_id, const_val,
-							     &val)) {
-				BNXT_TF_DBG(ERR, "%s field port table failed\n",
-					    name);
-				return -EINVAL;
-			}
-			if (!ulp_blob_push(blob, val, bitlen)) {
-				BNXT_TF_DBG(ERR, "%s push to blob failed\n",
-					    name);
-				return -EINVAL;
-			}
-		} else {
-			src1_val64 = ULP_COMP_FLD_IDX_RD(parms, idx);
-			if (ulp_mapper_field_process_inc_dec(fld, blob,
-							     &src1_val64,
-							     const_val,
-							     bitlen,
-							     &update_flag)) {
-				BNXT_TF_DBG(ERR, "%s field cond opc failed\n",
-					    name);
-				return -EINVAL;
-			}
-			if (update_flag) {
-				BNXT_TF_DBG(ERR, "%s invalid field cond opc\n",
-					    name);
-				return -EINVAL;
-			}
-		}
+		buffer = (uint8_t *)&parms->comp_fld[idx];
+		*val = &buffer[sizeof(uint32_t) - bytelen];
+		*value = ULP_COMP_FLD_IDX_RD(parms, idx);
 		break;
 	case BNXT_ULP_FIELD_SRC_RF:
-		if (!ulp_operand_read(fld_src_oper,
+		if (!ulp_operand_read(field_opr,
 				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
+			BNXT_TF_DBG(ERR, "RF operand read failed\n");
 			return -EINVAL;
 		}
 
 		idx = tfp_be_to_cpu_16(idx);
 		/* Uninitialized regfile entries return 0 */
-		if (!ulp_regfile_read(parms->regfile, idx, &regval)) {
-			BNXT_TF_DBG(ERR, "%s regfile[%d] read oob\n",
-				    name, idx);
+		if (!ulp_regfile_read(parms->regfile, idx, &lregval) ||
+		    sizeof(uint64_t) < bytelen) {
+			BNXT_TF_DBG(ERR, "regfile[%d] read oob %u\n", idx,
+				    bytelen);
 			return -EINVAL;
 		}
-		if (fld->field_opc == BNXT_ULP_FIELD_OPC_COND_OP) {
-			val = ulp_blob_push_64(blob, &regval, bitlen);
-			if (!val) {
-				BNXT_TF_DBG(ERR, "%s push to blob failed\n",
-					    name);
-				return -EINVAL;
-			}
-		} else {
-			if (ulp_mapper_field_process_inc_dec(fld, blob,
-							     &regval,
-							     const_val,
-							     bitlen,
-							     &update_flag)) {
-				BNXT_TF_DBG(ERR, "%s field cond opc failed\n",
-					    name);
-				return -EINVAL;
-			}
-			if (update_flag) {
-				regval = tfp_cpu_to_be_64(regval);
-				if (ulp_regfile_write(parms->regfile, idx,
-						      regval)) {
-					BNXT_TF_DBG(ERR,
-						    "Write regfile[%d] fail\n",
-						    idx);
-					return -EINVAL;
-				}
-			}
-		}
+		buffer = (uint8_t *)&parms->regfile->entry[idx].data;
+		*val = &buffer[sizeof(uint64_t) - bytelen];
+		*value = tfp_be_to_cpu_64(lregval);
 		break;
 	case BNXT_ULP_FIELD_SRC_ACT_PROP:
-		if (!ulp_operand_read(fld_src_oper,
+		if (!ulp_operand_read(field_opr,
 				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
+			BNXT_TF_DBG(ERR, "Action operand read failed\n");
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
-
 		if (idx >= BNXT_ULP_ACT_PROP_IDX_LAST) {
-			BNXT_TF_DBG(ERR, "%s act_prop[%d] oob\n", name, idx);
+			BNXT_TF_DBG(ERR, "act_prop[%d] oob\n", idx);
 			return -EINVAL;
 		}
-		val = &parms->act_prop->act_details[idx];
+		buffer = &parms->act_prop->act_details[idx];
 		field_size = ulp_mapper_act_prop_size_get(idx);
-		if (bitlen < ULP_BYTE_2_BITS(field_size)) {
-			field_size  = field_size - ((bitlen + 7) / 8);
-			val += field_size;
-		}
-		if (!ulp_blob_push(blob, val, bitlen)) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
+		if (bytelen > field_size) {
+			BNXT_TF_DBG(ERR, "act_prop[%d] field size small %u\n",
+				    idx, field_size);
 			return -EINVAL;
 		}
+		*val = &buffer[field_size - bytelen];
 		break;
 	case BNXT_ULP_FIELD_SRC_ACT_PROP_SZ:
-		if (!ulp_operand_read(fld_src_oper,
+		if (!ulp_operand_read(field_opr,
 				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
+			BNXT_TF_DBG(ERR, "Action sz operand read failed\n");
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
 
 		if (idx >= BNXT_ULP_ACT_PROP_IDX_LAST) {
-			BNXT_TF_DBG(ERR, "%s act_prop[%d] oob\n", name, idx);
+			BNXT_TF_DBG(ERR, "act_prop_sz[%d] oob\n", idx);
 			return -EINVAL;
 		}
-		val = &parms->act_prop->act_details[idx];
+		*val = &parms->act_prop->act_details[idx];
 
 		/* get the size index next */
-		if (!ulp_operand_read(&fld_src_oper[sizeof(uint16_t)],
+		if (!ulp_operand_read(&field_opr[sizeof(uint16_t)],
 				      (uint8_t *)&size_idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
+			BNXT_TF_DBG(ERR, "Action sz operand read failed\n");
 			return -EINVAL;
 		}
 		size_idx = tfp_be_to_cpu_16(size_idx);
-
 		if (size_idx >= BNXT_ULP_ACT_PROP_IDX_LAST) {
 			BNXT_TF_DBG(ERR, "act_prop[%d] oob\n", size_idx);
 			return -EINVAL;
@@ -1245,51 +1041,32 @@ ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 		memcpy(&val_size, &parms->act_prop->act_details[size_idx],
 		       sizeof(uint32_t));
 		val_size = tfp_be_to_cpu_32(val_size);
-		val_size = ULP_BYTE_2_BITS(val_size);
-		ulp_blob_push_encap(blob, val, val_size);
+		*val_len = ULP_BYTE_2_BITS(val_size);
 		break;
 	case BNXT_ULP_FIELD_SRC_GLB_RF:
-		if (!ulp_operand_read(fld_src_oper,
-				      (uint8_t *)&idx,
-				      sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed.\n", name);
+		if (!ulp_operand_read(field_opr,
+				      (uint8_t *)&idx, sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "Global regfile read failed\n");
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
-		if (ulp_mapper_glb_resource_read(parms->mapper_data, dir,
-						 idx, &regval, &shared)) {
-			BNXT_TF_DBG(ERR, "%s global regfile[%d] read failed.\n",
-				    name, idx);
+		if (ulp_mapper_glb_resource_read(parms->mapper_data,
+						 dir, idx, &lregval, &shared) ||
+		    sizeof(uint64_t) < bytelen) {
+			BNXT_TF_DBG(ERR, "Global regfile[%d] read failed %u\n",
+				    idx, bytelen);
 			return -EINVAL;
 		}
-		if (fld->field_opc == BNXT_ULP_FIELD_OPC_COND_OP) {
-			val = ulp_blob_push_64(blob, &regval, bitlen);
-			if (!val) {
-				BNXT_TF_DBG(ERR, "%s push to blob failed\n",
-					    name);
-				return -EINVAL;
-			}
-		} else {
-			if (ulp_mapper_field_process_inc_dec(fld, blob,
-							     &regval,
-							     const_val,
-							     bitlen,
-							     &update_flag)) {
-				BNXT_TF_DBG(ERR, "%s field cond opc failed\n",
-					    name);
-				return -EINVAL;
-			}
-			if (update_flag) {
-				BNXT_TF_DBG(ERR, "%s invalid field cond opc\n",
-					    name);
-				return -EINVAL;
-			}
-		}
+		m = parms->mapper_data;
+		buffer = (uint8_t *)&m->glb_res_tbl[dir][idx].resource_hndl;
+		*val = &buffer[sizeof(uint64_t) - bytelen];
+		*value = tfp_be_to_cpu_64(lregval);
 		break;
 	case BNXT_ULP_FIELD_SRC_HF:
-		if (!ulp_operand_read(fld_src_oper, (uint8_t *)&idx,
-				      sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed.\n", name);
+	case BNXT_ULP_FIELD_SRC_SUB_HF:
+		if (!ulp_operand_read(field_opr,
+				      (uint8_t *)&idx, sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "Header field read failed\n");
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
@@ -1300,69 +1077,67 @@ ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 			return -EINVAL;
 		}
 		if (is_key)
-			val = parms->hdr_field[bit].spec;
+			buffer = parms->hdr_field[bit].spec;
 		else
-			val = parms->hdr_field[bit].mask;
+			buffer = parms->hdr_field[bit].mask;
 
-		/*
-		 * Need to account for how much data was pushed to the header
-		 * field vs how much is to be inserted in the key/mask.
-		 */
 		field_size = parms->hdr_field[bit].size;
-		if (bitlen < ULP_BYTE_2_BITS(field_size)) {
-			field_size  = field_size - ((bitlen + 7) / 8);
-			val += field_size;
-		}
-
-		if (!ulp_blob_push(blob, val, bitlen)) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
+		if (bytelen > field_size) {
+			BNXT_TF_DBG(ERR, "Hdr field[%d] size small %u\n",
+				    bit, field_size);
 			return -EINVAL;
 		}
+		if (field_src == BNXT_ULP_FIELD_SRC_HF) {
+			*val = &buffer[field_size - bytelen];
+		} else {
+			/* get the offset next */
+			if (!ulp_operand_read(&field_opr[sizeof(uint16_t)],
+					      (uint8_t *)&offset,
+					      sizeof(uint16_t))) {
+				BNXT_TF_DBG(ERR, "Hdr fld size read failed\n");
+				return -EINVAL;
+			}
+			offset = tfp_be_to_cpu_16(offset);
+			offset = ULP_BITS_2_BYTE_NR(offset);
+			if ((offset + bytelen) > field_size) {
+				BNXT_TF_DBG(ERR, "Hdr field[%d] oob\n", bit);
+				return -EINVAL;
+			}
+			*val = &buffer[offset];
+		}
 		break;
 	case BNXT_ULP_FIELD_SRC_HDR_BIT:
-		if (!ulp_operand_read(fld_src_oper,
-				      (uint8_t *)&hdr_bit, sizeof(uint64_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
-			return -EINVAL;
-		}
-		hdr_bit = tfp_be_to_cpu_64(hdr_bit);
-		memset(tmpval, 0, sizeof(tmpval));
-		if (ULP_BITMAP_ISSET(parms->hdr_bitmap->bits, hdr_bit))
-			tmpval[0] = 1;
-		if (bitlen > ULP_BYTE_2_BITS(sizeof(tmpval))) {
-			BNXT_TF_DBG(ERR, "%s field size is incorrect\n", name);
+		if (!ulp_operand_read(field_opr,
+				      (uint8_t *)&lregval, sizeof(uint64_t))) {
+			BNXT_TF_DBG(ERR, "Header bit read failed\n");
 			return -EINVAL;
 		}
-		if (!ulp_blob_push(blob, tmpval, bitlen)) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
-			return -EINVAL;
+		lregval = tfp_be_to_cpu_64(lregval);
+		if (ULP_BITMAP_ISSET(parms->hdr_bitmap->bits, lregval)) {
+			*val = mapper_fld_one;
+			*value = 1;
+		} else {
+			*val = mapper_fld_zeros;
 		}
-		val = tmpval;
 		break;
 	case BNXT_ULP_FIELD_SRC_ACT_BIT:
-		if (!ulp_operand_read(fld_src_oper,
-				      (uint8_t *)&act_bit, sizeof(uint64_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
-			return -EINVAL;
-		}
-		act_bit = tfp_be_to_cpu_64(act_bit);
-		memset(tmpval, 0, sizeof(tmpval));
-		if (ULP_BITMAP_ISSET(parms->act_bitmap->bits, act_bit))
-			tmpval[0] = 1;
-		if (bitlen > ULP_BYTE_2_BITS(sizeof(tmpval))) {
-			BNXT_TF_DBG(ERR, "%s field size is incorrect\n", name);
+		if (!ulp_operand_read(field_opr,
+				      (uint8_t *)&lregval, sizeof(uint64_t))) {
+			BNXT_TF_DBG(ERR, "Action bit read failed\n");
 			return -EINVAL;
 		}
-		if (!ulp_blob_push(blob, tmpval, bitlen)) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
-			return -EINVAL;
+		lregval = tfp_be_to_cpu_64(lregval);
+		if (ULP_BITMAP_ISSET(parms->act_bitmap->bits, lregval)) {
+			*val = mapper_fld_one;
+			*value = 1;
+		} else {
+			*val = mapper_fld_zeros;
 		}
-		val = tmpval;
 		break;
 	case BNXT_ULP_FIELD_SRC_FIELD_BIT:
-		if (!ulp_operand_read(fld_src_oper, (uint8_t *)&idx,
-				      sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed.\n", name);
+		if (!ulp_operand_read(field_opr,
+				      (uint8_t *)&idx, sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "Field bit read failed\n");
 			return -EINVAL;
 		}
 		idx = tfp_be_to_cpu_16(idx);
@@ -1372,70 +1147,294 @@ ulp_mapper_field_process(struct bnxt_ulp_mapper_parms *parms,
 				    idx);
 			return -EINVAL;
 		}
-		memset(tmpval, 0, sizeof(tmpval));
-		if (ULP_INDEX_BITMAP_GET(parms->fld_bitmap->bits, bit))
-			tmpval[0] = 1;
-		if (bitlen > ULP_BYTE_2_BITS(sizeof(tmpval))) {
-			BNXT_TF_DBG(ERR, "%s field size is incorrect\n", name);
+		if (ULP_INDEX_BITMAP_GET(parms->fld_bitmap->bits, bit)) {
+			*val = mapper_fld_one;
+			*value = 1;
+		} else {
+			*val = mapper_fld_zeros;
+		}
+		break;
+	case BNXT_ULP_FIELD_SRC_PORT_TABLE:
+		/* The port id is present in the comp field list */
+		port_id = ULP_COMP_FLD_IDX_RD(parms,
+					      BNXT_ULP_CF_IDX_DEV_PORT_ID);
+		/* get the port table enum  */
+		if (!ulp_operand_read(field_opr,
+				      (uint8_t *)&idx, sizeof(uint16_t))) {
+			BNXT_TF_DBG(ERR, "Port table enum read failed\n");
 			return -EINVAL;
 		}
-		if (!ulp_blob_push(blob, tmpval, bitlen)) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
+		idx = tfp_be_to_cpu_16(idx);
+		if (ulp_mapper_field_port_db_process(parms, port_id, idx,
+						     val)) {
+			BNXT_TF_DBG(ERR, "field port table failed\n");
 			return -EINVAL;
 		}
-		val = tmpval;
-		break;
 	case BNXT_ULP_FIELD_SRC_SKIP:
 		/* do nothing */
 		break;
 	case BNXT_ULP_FIELD_SRC_REJECT:
 		return -EINVAL;
-	case BNXT_ULP_FIELD_SRC_SUB_HF:
-		if (!ulp_operand_read(fld_src_oper,
-				      (uint8_t *)&idx, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
+	default:
+		BNXT_TF_DBG(ERR, "invalid field opcode 0x%x\n", field_src);
+		return -EINVAL;
+	}
+	return 0;
+}
+
+static int32_t ulp_mapper_field_buffer_eval(uint8_t *buffer, uint32_t bitlen,
+					    uint64_t *output)
+{
+	uint16_t val_16;
+	uint32_t val_32;
+	uint64_t val_64;
+	uint32_t bytelen;
+
+	bytelen = ULP_BITS_2_BYTE(bitlen);
+	if (bytelen == sizeof(uint8_t)) {
+		*output = *((uint8_t *)buffer);
+	} else if (bytelen == sizeof(uint16_t)) {
+		val_16 = *((uint16_t *)buffer);
+		*output =  tfp_be_to_cpu_16(val_16);
+	} else if (bytelen == sizeof(uint32_t)) {
+		val_32 = *((uint32_t *)buffer);
+		*output =  tfp_be_to_cpu_32(val_32);
+	} else if (bytelen == sizeof(val_64)) {
+		val_64 = *((uint64_t *)buffer);
+		*output =  tfp_be_to_cpu_64(val_64);
+	} else {
+		*output = 0;
+		return -EINVAL;
+	}
+	return 0;
+}
+
+static int32_t ulp_mapper_field_blob_write(enum bnxt_ulp_field_src fld_src,
+					   struct ulp_blob *blob,
+					   uint8_t *val,
+					   uint32_t val_len,
+					   uint8_t **out_val)
+{
+	if (fld_src == BNXT_ULP_FIELD_SRC_ZERO) {
+		if (ulp_blob_pad_push(blob, val_len) < 0) {
+			BNXT_TF_DBG(ERR, "too large for blob\n");
 			return -EINVAL;
 		}
-		idx = tfp_be_to_cpu_16(idx);
-		/* get the index from the global field list */
-		if (ulp_mapper_glb_field_tbl_get(parms, idx, &bit)) {
-			BNXT_TF_DBG(ERR, "invalid ulp_glb_field_tbl idx %d\n",
-				    idx);
+	} else if (fld_src == BNXT_ULP_FIELD_SRC_ACT_PROP_SZ) {
+		if (ulp_blob_push_encap(blob, val, val_len) < 0) {
+			BNXT_TF_DBG(ERR, "encap blob push failed\n");
 			return -EINVAL;
 		}
-
-		/* get the offset next */
-		if (!ulp_operand_read(&fld_src_oper[sizeof(uint16_t)],
-				      (uint8_t *)&offset, sizeof(uint16_t))) {
-			BNXT_TF_DBG(ERR, "%s operand read failed\n", name);
+	} else {
+		if (!ulp_blob_push(blob, val, val_len)) {
+			BNXT_TF_DBG(ERR, "push of val1 failed\n");
 			return -EINVAL;
 		}
-		offset = tfp_be_to_cpu_16(offset);
-		if ((offset + bitlen) >
-		    ULP_BYTE_2_BITS(parms->hdr_field[bit].size) ||
-		    ULP_BITS_IS_BYTE_NOT_ALIGNED(offset)) {
-			BNXT_TF_DBG(ERR, "Hdr field[%s] oob\n", name);
-			return -EINVAL;
+	}
+	*out_val = val;
+	return 0;
+}
+
+static int32_t
+ulp_mapper_field_opc_process(struct bnxt_ulp_mapper_parms *parms,
+			     enum tf_dir dir,
+			     struct bnxt_ulp_mapper_field_info *fld,
+			     struct ulp_blob *blob,
+			     uint8_t is_key,
+			     const char *name)
+{
+	uint16_t write_idx = blob->write_idx;
+	uint8_t *val = NULL, *val1, *val2, *val3;
+	uint32_t val_len = 0, val1_len = 0, val2_len = 0, val3_len = 0;
+	uint8_t process_src1 = 0, process_src2 = 0, process_src3 = 0;
+	uint8_t eval_src1 = 0, eval_src2 = 0, eval_src3 = 0;
+	uint64_t val_int = 0, val1_int = 0, val2_int = 0, val3_int = 0;
+	uint64_t value1 = 0, value2 = 0, value3 = 0;
+	int32_t rc = 0;
+
+	/* prepare the field source and values */
+	switch (fld->field_opc) {
+	case BNXT_ULP_FIELD_OPC_SRC1:
+		process_src1 = 1;
+		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_THEN_SRC2_ELSE_SRC3:
+		process_src1 = 1;
+		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_OR_SRC2_OR_SRC3:
+	case BNXT_ULP_FIELD_OPC_SRC1_AND_SRC2_OR_SRC3:
+		process_src3 = 1;
+		eval_src3 = 1;
+		process_src1 = 1;
+		process_src2 = 1;
+		eval_src1 = 1;
+		eval_src2 = 1;
+		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_PLUS_SRC2:
+	case BNXT_ULP_FIELD_OPC_SRC1_MINUS_SRC2:
+	case BNXT_ULP_FIELD_OPC_SRC1_PLUS_SRC2_POST:
+	case BNXT_ULP_FIELD_OPC_SRC1_MINUS_SRC2_POST:
+	case BNXT_ULP_FIELD_OPC_SRC1_OR_SRC2:
+	case BNXT_ULP_FIELD_OPC_SRC1_AND_SRC2:
+		process_src1 = 1;
+		process_src2 = 1;
+		eval_src1 = 1;
+		eval_src2 = 1;
+		break;
+	default:
+		break;
+	}
+
+	/* process the src1 opcode  */
+	if (process_src1) {
+		if (ulp_mapper_field_src_process(parms, fld->field_src1,
+						 fld->field_opr1, dir, is_key,
+						 fld->field_bit_size, &val1,
+						 &val1_len, &value1)) {
+			BNXT_TF_DBG(ERR, "fld src1 process failed\n");
+			goto error;
+		}
+		if (eval_src1) {
+			if (ulp_mapper_field_buffer_eval(val1, val1_len,
+							 &val1_int)) {
+				BNXT_TF_DBG(ERR, "fld src1 eval failed\n");
+				goto error;
+			}
 		}
-		offset = ULP_BITS_2_BYTE_NR(offset);
+	}
 
-		/* write the value into blob */
-		if (is_key)
-			val = &parms->hdr_field[bit].spec[offset];
+	/* for "if then clause" set the correct process  */
+	if (fld->field_opc == BNXT_ULP_FIELD_OPC_SRC1_THEN_SRC2_ELSE_SRC3) {
+		if (value1)
+			process_src2 = 1;
 		else
-			val = &parms->hdr_field[bit].mask[offset];
+			process_src3 = 1;
+	}
 
-		if (!ulp_blob_push(blob, val, bitlen)) {
-			BNXT_TF_DBG(ERR, "%s push to blob failed\n", name);
-			return -EINVAL;
+	/* process src2 opcode */
+	if (process_src2) {
+		if (ulp_mapper_field_src_process(parms, fld->field_src2,
+						 fld->field_opr2, dir, is_key,
+						 fld->field_bit_size, &val2,
+						 &val2_len, &value2)) {
+			BNXT_TF_DBG(ERR, "fld src2 process failed\n");
+			goto error;
+		}
+		if (eval_src2) {
+			if (ulp_mapper_field_buffer_eval(val2, val2_len,
+							 &val2_int)) {
+				BNXT_TF_DBG(ERR, "fld src2 eval failed\n");
+				goto error;
+			}
+		}
+	}
+
+	/* process src3 opcode */
+	if (process_src3) {
+		if (ulp_mapper_field_src_process(parms, fld->field_src3,
+						 fld->field_opr3, dir, is_key,
+						 fld->field_bit_size, &val3,
+						 &val3_len, &value3)) {
+			BNXT_TF_DBG(ERR, "fld src3 process failed\n");
+			goto error;
+		}
+		if (eval_src3) {
+			if (ulp_mapper_field_buffer_eval(val3, val3_len,
+							 &val3_int)) {
+				BNXT_TF_DBG(ERR, "fld src3 eval failed\n");
+				goto error;
+			}
+		}
+	}
+
+	val_len = fld->field_bit_size;
+	/* process the field opcodes */
+	switch (fld->field_opc) {
+	case BNXT_ULP_FIELD_OPC_SRC1:
+		if (ulp_mapper_field_blob_write(fld->field_src1,
+						blob, val1, val1_len, &val))
+			goto error;
+		val_len = val1_len;
+		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_THEN_SRC2_ELSE_SRC3:
+		if (value1) {
+			if (ulp_mapper_field_blob_write(fld->field_src2, blob,
+							val2, val2_len, &val))
+				goto error;
+			val_len = val2_len;
+		} else {
+			if (ulp_mapper_field_blob_write(fld->field_src3, blob,
+							val3, val3_len, &val))
+				goto error;
+			val_len = val3_len;
 		}
 		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_PLUS_SRC2:
+	case BNXT_ULP_FIELD_OPC_SRC1_PLUS_SRC2_POST:
+		val_int = val1_int + val2_int;
+		val_int = tfp_cpu_to_be_64(val_int);
+		val = ulp_blob_push_64(blob, &val_int, fld->field_bit_size);
+		if (!val) {
+			BNXT_TF_DBG(ERR, "push to blob failed\n");
+			goto error;
+		}
+		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_MINUS_SRC2:
+	case BNXT_ULP_FIELD_OPC_SRC1_MINUS_SRC2_POST:
+		val_int = val1_int - val2_int;
+		val_int = tfp_cpu_to_be_64(val_int);
+		val = ulp_blob_push_64(blob, &val_int, fld->field_bit_size);
+		if (!val) {
+			BNXT_TF_DBG(ERR, "push to blob failed\n");
+			goto error;
+		}
+		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_OR_SRC2:
+		val_int = val1_int | val2_int;
+		val_int = tfp_cpu_to_be_64(val_int);
+		val = ulp_blob_push_64(blob, &val_int, fld->field_bit_size);
+		if (!val) {
+			BNXT_TF_DBG(ERR, "push to blob failed\n");
+			goto error;
+		}
+		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_OR_SRC2_OR_SRC3:
+		val_int = val1_int | val2_int | val3_int;
+		val_int = tfp_cpu_to_be_64(val_int);
+		val = ulp_blob_push_64(blob, &val_int, fld->field_bit_size);
+		if (!val) {
+			BNXT_TF_DBG(ERR, "push to blob failed\n");
+			goto error;
+		}
+		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_AND_SRC2:
+		val_int = val1_int & val2_int;
+		val_int = tfp_cpu_to_be_64(val_int);
+		val = ulp_blob_push_64(blob, &val_int, fld->field_bit_size);
+		if (!val) {
+			BNXT_TF_DBG(ERR, "push to blob failed\n");
+			goto error;
+		}
+		break;
+	case BNXT_ULP_FIELD_OPC_SRC1_AND_SRC2_OR_SRC3:
+		val_int = val1_int & (val2_int | val3_int);
+		val_int = tfp_cpu_to_be_64(val_int);
+		val = ulp_blob_push_64(blob, &val_int, fld->field_bit_size);
+		if (!val) {
+			BNXT_TF_DBG(ERR, "push to blob failed\n");
+			goto error;
+		}
+		break;
+	case BNXT_ULP_FIELD_OPC_SKIP:
+		break;
 	default:
-		BNXT_TF_DBG(ERR, "%s invalid field opcode 0x%x at %d\n",
-			    name, fld_src, write_idx);
-		return -EINVAL;
+		break;
 	}
-	return 0;
+
+	return rc;
+error:
+	BNXT_TF_DBG(ERR, "Error in %s:%s process %u:%u\n", name,
+		    fld->description, (val) ? write_idx : 0, val_len);
+	return -EINVAL;
 }
 
 /*
@@ -1474,8 +1473,8 @@ ulp_mapper_tbl_result_build(struct bnxt_ulp_mapper_parms *parms,
 			ulp_blob_encap_swap_idx_set(data);
 
 		/* Process the result fields */
-		rc = ulp_mapper_field_process(parms, tbl->direction,
-					      &dflds[i], data, 0, name);
+		rc = ulp_mapper_field_opc_process(parms, tbl->direction,
+						  &dflds[i], data, 0, name);
 		if (rc) {
 			BNXT_TF_DBG(ERR, "data field failed\n");
 			return rc;
@@ -1877,9 +1876,9 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	 */
 	for (i = 0; i < num_kflds; i++) {
 		/* Setup the key */
-		rc = ulp_mapper_field_process(parms, tbl->direction,
-					      &kflds[i].field_info_spec,
-					      key, 1, "TCAM Key");
+		rc = ulp_mapper_field_opc_process(parms, tbl->direction,
+						  &kflds[i].field_info_spec,
+						  key, 1, "TCAM Key");
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Key field set failed %s\n",
 				    kflds[i].field_info_spec.description);
@@ -1887,9 +1886,9 @@ ulp_mapper_tcam_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		}
 
 		/* Setup the mask */
-		rc = ulp_mapper_field_process(parms, tbl->direction,
-					      &kflds[i].field_info_mask,
-					      mask, 0, "TCAM Mask");
+		rc = ulp_mapper_field_opc_process(parms, tbl->direction,
+						  &kflds[i].field_info_mask,
+						  mask, 0, "TCAM Mask");
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Mask field set failed %s\n",
 				    kflds[i].field_info_mask.description);
@@ -2077,9 +2076,9 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	/* create the key */
 	for (i = 0; i < num_kflds; i++) {
 		/* Setup the key */
-		rc = ulp_mapper_field_process(parms, tbl->direction,
-					      &kflds[i].field_info_spec,
-					      &key, 1, "EM Key");
+		rc = ulp_mapper_field_opc_process(parms, tbl->direction,
+						  &kflds[i].field_info_spec,
+						  &key, 1, "EM Key");
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Key field set failed.\n");
 			return rc;
@@ -2645,9 +2644,9 @@ ulp_mapper_gen_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 	}
 	for (i = 0; i < num_kflds; i++) {
 		/* Setup the key */
-		rc = ulp_mapper_field_process(parms, tbl->direction,
-					      &kflds[i].field_info_spec,
-					      &key, 1, "Gen Tbl Key");
+		rc = ulp_mapper_field_opc_process(parms, tbl->direction,
+						  &kflds[i].field_info_spec,
+						  &key, 1, "Gen Tbl Key");
 		if (rc) {
 			BNXT_TF_DBG(ERR,
 				    "Failed to create key for Gen tbl rc=%d\n",
@@ -3159,6 +3158,9 @@ ulp_mapper_cc_upd_opr_compute(struct bnxt_ulp_mapper_parms *parms,
 		}
 		*result = tfp_be_to_cpu_64(regval);
 		break;
+	case BNXT_ULP_CC_UPD_SRC_CONST:
+		*result = cc_opr;
+		break;
 	default:
 		BNXT_TF_DBG(ERR, "invalid src code %u\n", cc_src);
 		return -EINVAL;
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +34 -37

122 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +321 -301

1,884 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_thor_act.c +0 -196

196 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_thor_class.c +520 -5489

6,009 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +614 -1120

1,734 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +2614 -3873

6,487 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +2 -3
index ee5fbdedaa..6d2b226026 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.c +3 -3
index 329799ea6a..1649e157f2 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.h +1 -1
index 5dd22cf8c3..209c8fa6a4 100644

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

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#115 lore raw

PATCH v2 50/58 net/bnxt: add support for application ID in ULP matcher

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

The application id in the ULP matcher makes the template matching restrict to only flows that are supported for that application.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |   11 +
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |   61 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |    3 +-
 drivers/net/bnxt/tf_ulp/ulp_matcher.c         |   28 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c |   87 +-
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   | 5690 +++++++++--------
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   21 +-
 .../net/bnxt/tf_ulp/ulp_template_db_field.h   | 1050 +--
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |   14 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |    3 +
 10 files changed, 3886 insertions(+), 3082 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +11 -0
index 63fb4b5973..42dc9bef71 100644
@@ -99,6 +99,7 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 	mapper_cparms->fld_bitmap = &params->fld_bitmap;
 	mapper_cparms->flow_pattern_id = params->flow_pattern_id;
 	mapper_cparms->act_pattern_id = params->act_pattern_id;
+	mapper_cparms->app_id = params->app_id;
 
 	/* update the signature fields into the computed field list */
 	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_HDR_SIG_ID,
@@ -140,6 +141,11 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev,
 	memset(&params, 0, sizeof(struct ulp_rte_parser_params));
 	params.ulp_ctx = ulp_ctx;
 
+	if (bnxt_ulp_cntxt_app_id_get(params.ulp_ctx, &params.app_id)) {
+		BNXT_TF_DBG(ERR, "failed to get the app id\n");
+		goto flow_error;
+	}
+
 	/* Set the flow attributes */
 	bnxt_ulp_set_dir_attributes(&params, attr);
 
@@ -258,6 +264,11 @@ bnxt_ulp_flow_validate(struct rte_eth_dev *dev,
 	memset(&params, 0, sizeof(struct ulp_rte_parser_params));
 	params.ulp_ctx = ulp_ctx;
 
+	if (bnxt_ulp_cntxt_app_id_get(params.ulp_ctx, &params.app_id)) {
+		BNXT_TF_DBG(ERR, "failed to get the app id\n");
+		goto parse_error;
+	}
+
 	/* Set the flow attributes */
 	bnxt_ulp_set_dir_attributes(&params, attr);
 
drivers/net/bnxt/tf_ulp/ulp_mapper.c +26 -35

121 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +2 -1
index 6e4d9e8522..edd5978ac6 100644
@@ -61,6 +61,7 @@ struct bnxt_ulp_mapper_parms {
 	uint64_t				shared_hndl;
 	uint32_t				flow_pattern_id;
 	uint32_t				act_pattern_id;
+	uint8_t					app_id;
 };
 
 struct bnxt_ulp_mapper_create_parms {
@@ -88,7 +89,7 @@ struct bnxt_ulp_mapper_create_parms {
 	/* support pattern based rejection */
 	uint32_t			flow_pattern_id;
 	uint32_t			act_pattern_id;
-
+	uint8_t				app_id;
 };
 
 /* Function to initialize any dynamic mapper data. */
drivers/net/bnxt/tf_ulp/ulp_matcher.c +24 -4
index 8040fb7515..67fa61fc7c 100644
@@ -23,13 +23,15 @@ ulp_matcher_class_hash_calculate(uint64_t hi_sig, uint64_t lo_sig)
 
 /* Utility function to calculate the action matcher hash */
 static uint32_t
-ulp_matcher_action_hash_calculate(uint64_t hi_sig)
+ulp_matcher_action_hash_calculate(uint64_t hi_sig, uint64_t app_id)
 {
 	uint64_t hash;
 
 	hi_sig |= ((hi_sig % BNXT_ULP_ACT_HID_HIGH_PRIME) <<
 		   BNXT_ULP_ACT_HID_SHFTL);
-	hash = hi_sig;
+	app_id |= ((app_id % BNXT_ULP_CLASS_HID_LOW_PRIME) <<
+		   (BNXT_ULP_CLASS_HID_SHFTL + 2));
+	hash = hi_sig ^ app_id;
 	hash = (hash >> BNXT_ULP_ACT_HID_SHFTR) & BNXT_ULP_ACT_HID_MASK;
 	return (uint32_t)hash;
 }
@@ -51,7 +53,8 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
 	vf_to_vf = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_VF_TO_VF);
 
 	/* calculate the hash of the given flow */
-	class_hid = ulp_matcher_class_hash_calculate(params->hdr_bitmap.bits,
+	class_hid = ulp_matcher_class_hash_calculate((params->hdr_bitmap.bits ^
+						     params->app_id),
 						     params->fld_s_bitmap.bits);
 
 	/* validate the calculate hash values */
@@ -70,6 +73,14 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
 		BNXT_TF_DBG(DEBUG, "Field signature does not match\n");
 		goto error;
 	}
+
+	/* Match the application id before proceeding */
+	if (params->app_id != class_match->app_sig) {
+		BNXT_TF_DBG(DEBUG, "Field to match the app id %u:%u\n",
+			    params->app_id, class_match->app_sig);
+		goto error;
+	}
+
 	if (vf_to_vf != class_match->act_vnic) {
 		BNXT_TF_DBG(DEBUG, "Vnic Match failed\n");
 		goto error;
@@ -101,7 +112,8 @@ ulp_matcher_action_match(struct ulp_rte_parser_params *params,
 	struct bnxt_ulp_act_match_info *act_match;
 
 	/* calculate the hash of the given flow action */
-	act_hid = ulp_matcher_action_hash_calculate(params->act_bitmap.bits);
+	act_hid = ulp_matcher_action_hash_calculate(params->act_bitmap.bits,
+						    params->app_id);
 
 	/* validate the calculate hash values */
 	if (act_hid >= BNXT_ULP_ACT_SIG_TBL_MAX_SZ)
@@ -115,6 +127,14 @@ ulp_matcher_action_match(struct ulp_rte_parser_params *params,
 		BNXT_TF_DBG(DEBUG, "Action Header does not match\n");
 		goto error;
 	}
+
+	/* Match the application id before proceeding */
+	if (params->app_id != act_match->app_sig) {
+		BNXT_TF_DBG(DEBUG, "Field to match the app id %u:%u\n",
+			    params->app_id, act_match->app_sig);
+		goto error;
+	}
+
 	*act_id = act_match->act_tid;
 	params->act_pattern_id = act_match->act_pattern_id;
 	BNXT_TF_DBG(DEBUG, "Found matching action template %u\n", *act_id);
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +86 -1

603 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +3188 -2502

2,169 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +14 -7
index bdb1a640af..4a2f7337be 100644

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

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

1,050 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +7 -7
index 67bb8b116b..f3146cc1a3 100644

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

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +3 -0
index 6d2b226026..cf6a27e771 100644

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

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#116 lore raw

PATCH v2 51/58 net/bnxt: process resource lists before session open

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Shared sessions require both named and unnamed resources to be requested during a tf_open_session. ULP uses named resources for global resources that are pre-allocated and remain through the life of the application. Unnamed resources are generally per flow resources and allocated on demand. The sum of both named and unnamed resources must be requested when initializing the session. The ulp_init now processes both lists prior to calling tf_open_session for both shared and regular sessions.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            | 177 ++++++++++++------
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       |   4 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  37 ++--
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   1 +
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |  36 ++++
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   6 +
 6 files changed, 183 insertions(+), 78 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +121 -56
index 632334674c..98b86f2c52 100644
@@ -77,6 +77,15 @@ bnxt_ulp_app_cap_list_get(uint32_t *num_entries)
 	return ulp_app_cap_info_list;
 }
 
+static struct bnxt_ulp_resource_resv_info *
+bnxt_ulp_app_resource_resv_list_get(uint32_t *num_entries)
+{
+	if (num_entries == NULL)
+		return NULL;
+	*num_entries = BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ;
+	return ulp_app_resource_resv_list;
+}
+
 struct bnxt_ulp_resource_resv_info *
 bnxt_ulp_resource_resv_list_get(uint32_t *num_entries)
 {
@@ -96,23 +105,18 @@ bnxt_ulp_app_glb_resource_info_list_get(uint32_t *num_entries)
 }
 
 static int32_t
-bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx,
-			  struct tf_session_resources *res)
+bnxt_ulp_named_resources_calc(struct bnxt_ulp_context *ulp_ctx,
+			      struct bnxt_ulp_glb_resource_info *info,
+			      uint32_t num,
+			      struct tf_session_resources *res)
 {
-	struct bnxt_ulp_resource_resv_info *info = NULL;
-	uint32_t dev_id, res_type, i, num;
+	uint32_t dev_id, res_type, i;
 	enum tf_dir dir;
 	uint8_t app_id;
 	int32_t rc = 0;
 
-	if (!ulp_ctx || !res) {
-		BNXT_TF_DBG(ERR, "Invalid arguments to get resources.\n");
-		return -EINVAL;
-	}
-
-	info = bnxt_ulp_resource_resv_list_get(&num);
-	if (!info) {
-		BNXT_TF_DBG(ERR, "Unable to get resource reservation list.\n");
+	if (ulp_ctx == NULL || info == NULL || res == NULL || num == 0) {
+		BNXT_TF_DBG(ERR, "Invalid parms to named resources calc.\n");
 		return -EINVAL;
 	}
 
@@ -124,31 +128,33 @@ bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx,
 
 	rc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id);
 	if (rc) {
-		BNXT_TF_DBG(ERR, "Unable to get the device id from ulp.\n");
+		BNXT_TF_DBG(ERR, "Unable to get the dev id from ulp.\n");
 		return -EINVAL;
 	}
 
 	for (i = 0; i < num; i++) {
-		if (app_id != info[i].app_id || dev_id != info[i].device_id)
+		if (dev_id != info[i].device_id || app_id != info[i].app_id)
 			continue;
 		dir = info[i].direction;
 		res_type = info[i].resource_type;
 
 		switch (info[i].resource_func) {
 		case BNXT_ULP_RESOURCE_FUNC_IDENTIFIER:
-			res->ident_cnt[dir].cnt[res_type] = info[i].count;
+			res->ident_cnt[dir].cnt[res_type]++;
 			break;
 		case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE:
-			res->tbl_cnt[dir].cnt[res_type] = info[i].count;
+			res->tbl_cnt[dir].cnt[res_type]++;
 			break;
 		case BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE:
-			res->tcam_cnt[dir].cnt[res_type] = info[i].count;
+			res->tcam_cnt[dir].cnt[res_type]++;
 			break;
 		case BNXT_ULP_RESOURCE_FUNC_EM_TABLE:
-			res->em_cnt[dir].cnt[res_type] = info[i].count;
+			res->em_cnt[dir].cnt[res_type]++;
 			break;
 		default:
-			break;
+			BNXT_TF_DBG(ERR, "Unknown resource func (0x%x)\n,",
+				    info[i].resource_func);
+			continue;
 		}
 	}
 
@@ -156,14 +162,20 @@ bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx,
 }
 
 static int32_t
-bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx,
-					 struct tf_session_resources *res)
+bnxt_ulp_unnamed_resources_calc(struct bnxt_ulp_context *ulp_ctx,
+				struct bnxt_ulp_resource_resv_info *info,
+				uint32_t num,
+				struct tf_session_resources *res)
 {
-	struct bnxt_ulp_glb_resource_info *info;
-	uint32_t dev_id, res_type, i, num;
+	uint32_t dev_id, res_type, i;
 	enum tf_dir dir;
 	uint8_t app_id;
-	int32_t rc;
+	int32_t rc = 0;
+
+	if (ulp_ctx == NULL || res == NULL || info == NULL || num == 0) {
+		BNXT_TF_DBG(ERR, "Invalid arguments to get resources.\n");
+		return -EINVAL;
+	}
 
 	rc = bnxt_ulp_cntxt_app_id_get(ulp_ctx, &app_id);
 	if (rc) {
@@ -173,48 +185,108 @@ bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx,
 
 	rc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id);
 	if (rc) {
-		BNXT_TF_DBG(ERR, "Unable to get device id from ulp.\n");
+		BNXT_TF_DBG(ERR, "Unable to get the dev id from ulp.\n");
 		return -EINVAL;
 	}
 
-	/* Make sure the resources are zero before accumulating. */
-	memset(res, 0, sizeof(struct tf_session_resources));
-
-	/* Get the list and tally the resources. */
-	info = bnxt_ulp_app_glb_resource_info_list_get(&num);
-	if (!info) {
-		BNXT_TF_DBG(ERR, "Unable to get app global resource list\n");
-		return -EINVAL;
-	}
 	for (i = 0; i < num; i++) {
-		if (dev_id != info[i].device_id || app_id != info[i].app_id)
+		if (app_id != info[i].app_id || dev_id != info[i].device_id)
 			continue;
 		dir = info[i].direction;
 		res_type = info[i].resource_type;
 
 		switch (info[i].resource_func) {
 		case BNXT_ULP_RESOURCE_FUNC_IDENTIFIER:
-			res->ident_cnt[dir].cnt[res_type]++;
+			res->ident_cnt[dir].cnt[res_type] = info[i].count;
 			break;
 		case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE:
-			res->tbl_cnt[dir].cnt[res_type]++;
+			res->tbl_cnt[dir].cnt[res_type] = info[i].count;
 			break;
 		case BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE:
-			res->tcam_cnt[dir].cnt[res_type]++;
+			res->tcam_cnt[dir].cnt[res_type] = info[i].count;
 			break;
 		case BNXT_ULP_RESOURCE_FUNC_EM_TABLE:
-			res->em_cnt[dir].cnt[res_type]++;
+			res->em_cnt[dir].cnt[res_type] = info[i].count;
 			break;
 		default:
-			BNXT_TF_DBG(ERR, "Unknown resource func (0x%x)\n,",
-				    info[i].resource_func);
-			continue;
+			break;
 		}
 	}
-
 	return 0;
 }
 
+static int32_t
+bnxt_ulp_tf_resources_get(struct bnxt_ulp_context *ulp_ctx,
+			  struct tf_session_resources *res)
+{
+	struct bnxt_ulp_resource_resv_info *unnamed = NULL;
+	uint32_t unum;
+	int32_t rc = 0;
+
+	if (ulp_ctx == NULL || res == NULL) {
+		BNXT_TF_DBG(ERR, "Invalid arguments to get resources.\n");
+		return -EINVAL;
+	}
+
+	unnamed = bnxt_ulp_resource_resv_list_get(&unum);
+	if (unnamed == NULL) {
+		BNXT_TF_DBG(ERR, "Unable to get resource resv list.\n");
+		return -EINVAL;
+	}
+
+	rc = bnxt_ulp_unnamed_resources_calc(ulp_ctx, unnamed, unum, res);
+	if (rc)
+		BNXT_TF_DBG(ERR, "Unable to calc resources for session.\n");
+
+	return rc;
+}
+
+static int32_t
+bnxt_ulp_tf_shared_session_resources_get(struct bnxt_ulp_context *ulp_ctx,
+					 struct tf_session_resources *res)
+{
+	struct bnxt_ulp_resource_resv_info *unnamed;
+	struct bnxt_ulp_glb_resource_info *named;
+	uint32_t unum, nnum;
+	int32_t rc;
+
+	if (ulp_ctx == NULL || res == NULL) {
+		BNXT_TF_DBG(ERR, "Invalid arguments to get resources.\n");
+		return -EINVAL;
+	}
+
+	/* Make sure the resources are zero before accumulating. */
+	memset(res, 0, sizeof(struct tf_session_resources));
+
+	/*
+	 * Shared resources are comprised of both named and unnamed resources.
+	 * First get the unnamed counts, and then add the named to the result.
+	 */
+	/* Get the baseline counts */
+	unnamed = bnxt_ulp_app_resource_resv_list_get(&unum);
+	if (unnamed == NULL) {
+		BNXT_TF_DBG(ERR, "Unable to get shared resource resv list.\n");
+		return -EINVAL;
+	}
+	rc = bnxt_ulp_unnamed_resources_calc(ulp_ctx, unnamed, unum, res);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Unable to calc resources for shared session.\n");
+		return -EINVAL;
+	}
+
+	/* Get the named list and add the totals */
+	named = bnxt_ulp_app_glb_resource_info_list_get(&nnum);
+	if (named == NULL) {
+		BNXT_TF_DBG(ERR, "Unable to get app global resource list\n");
+		return -EINVAL;
+	}
+	rc = bnxt_ulp_named_resources_calc(ulp_ctx, named, nnum, res);
+	if (rc)
+		BNXT_TF_DBG(ERR, "Unable to calc named resources\n");
+
+	return rc;
+}
+
 int32_t
 bnxt_ulp_cntxt_app_caps_init(struct bnxt_ulp_context *ulp_ctx,
 			     uint8_t app_id, uint32_t dev_id)
@@ -320,10 +392,8 @@ ulp_ctx_shared_session_open(struct bnxt *bp,
 	strncat(parms.ctrl_chan_name, "-tf_shared", copy_num_bytes);
 
 	rc = bnxt_ulp_tf_shared_session_resources_get(bp->ulp_ctx, resources);
-	if (rc) {
-		BNXT_TF_DBG(ERR, "Unable to get shared resource count.\n");
+	if (rc)
 		return rc;
-	}
 
 	rc = bnxt_ulp_cntxt_dev_id_get(bp->ulp_ctx, &ulp_dev_id);
 	if (rc) {
@@ -342,8 +412,7 @@ ulp_ctx_shared_session_open(struct bnxt *bp,
 		parms.device_type = TF_DEVICE_TYPE_THOR;
 		break;
 	default:
-		BNXT_TF_DBG(ERR, "Unable to determine device for "
-			    "opening session.\n");
+		BNXT_TF_DBG(ERR, "Unable to determine dev for opening session.\n");
 		return rc;
 	}
 
@@ -450,18 +519,14 @@ ulp_ctx_session_open(struct bnxt *bp,
 		params.device_type = TF_DEVICE_TYPE_THOR;
 		break;
 	default:
-		BNXT_TF_DBG(ERR, "Unable to determine device for "
-			    "opening session.\n");
+		BNXT_TF_DBG(ERR, "Unable to determine device for opening session.\n");
 		return rc;
 	}
 
 	resources = &params.resources;
 	rc = bnxt_ulp_tf_resources_get(bp->ulp_ctx, resources);
-	if (rc) {
-		BNXT_TF_DBG(ERR, "Unable to determine tf resources for "
-			    "session open.\n");
+	if (rc)
 		return rc;
-	}
 
 	params.bp = bp;
 	rc = tf_open_session(&bp->tfp, &params);
@@ -708,8 +773,8 @@ ulp_ctx_init(struct bnxt *bp,
 
 	rc = bnxt_ulp_cntxt_app_caps_init(bp->ulp_ctx, bp->app_id, devid);
 	if (rc) {
-		BNXT_TF_DBG(ERR, "Unable to set capabilities for "
-			    " app(%x)/dev(%x)\n", bp->app_id, devid);
+		BNXT_TF_DBG(ERR, "Unable to set caps for app(%x)/dev(%x)\n",
+			    bp->app_id, devid);
 		goto error_deinit;
 	}
 
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +2 -2
index b688288a62..483030edbf 100644
@@ -321,8 +321,8 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
 
 	ulp_ctx = bnxt_ulp_eth_dev_ptr2_cntxt_get(eth_dev);
 	if (!ulp_ctx) {
-		BNXT_TF_DBG(ERR, "ULP context is not initialized. "
-				 "Failed to create default flow.\n");
+		BNXT_TF_DBG(ERR,
+			    "ULP context is not initialized. Failed to create dflt flow.\n");
 		return -EINVAL;
 	}
 
drivers/net/bnxt/tf_ulp/ulp_mapper.c +17 -20
index 8fd8a329bf..b5cefbeb08 100644
@@ -2296,8 +2296,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 						 tbl->tbl_operand,
 						 &regval, &shared)) {
 			BNXT_TF_DBG(ERR,
-				    "Failed to get tbl idx from Global "
-				    "regfile[%d].\n",
+				    "Failed to get tbl idx from Glb RF[%d].\n",
 				    tbl->tbl_operand);
 			return -EINVAL;
 		}
@@ -2347,8 +2346,9 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 						   gparms.data_sz_in_bytes,
 						   data.byte_order);
 		if (rc) {
-			BNXT_TF_DBG(ERR, "Failed to read fields on tbl read "
-				    "rc=%d\n", rc);
+			BNXT_TF_DBG(ERR,
+				    "Failed to get flds on tbl read rc=%d\n",
+				    rc);
 			return rc;
 		}
 		return 0;
@@ -2433,8 +2433,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,
 		rc = tf_set_tbl_entry(tfp, &sparms);
 		if (rc) {
 			BNXT_TF_DBG(ERR,
-				    "Index table[%s][%s][%x] write failed "
-				    "rc=%d\n",
+				    "Index table[%s][%s][%x] write fail rc=%d\n",
 				    tf_tbl_type_2_str(sparms.type),
 				    tf_dir_2_str(sparms.dir),
 				    sparms.idx, rc);
@@ -2833,15 +2832,15 @@ ulp_mapper_glb_resource_info_init(struct bnxt_ulp_context *ulp_ctx,
 
 	rc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id);
 	if (rc) {
-		BNXT_TF_DBG(ERR, "Failed to get device id for "
-			    "global init (%d)\n", rc);
+		BNXT_TF_DBG(ERR, "Failed to get device id for glb init (%d)\n",
+			    rc);
 		return rc;
 	}
 
 	rc = bnxt_ulp_cntxt_app_id_get(ulp_ctx, &app_id);
 	if (rc) {
-		BNXT_TF_DBG(ERR, "Failed to get app id for "
-			    "global init (%d)\n", rc);
+		BNXT_TF_DBG(ERR, "Failed to get app id for glb init (%d)\n",
+			    rc);
 		return rc;
 	}
 
@@ -2916,15 +2915,15 @@ ulp_mapper_app_glb_resource_info_init(struct bnxt_ulp_context *ulp_ctx,
 
 	rc = bnxt_ulp_cntxt_app_id_get(ulp_ctx, &app_id);
 	if (rc) {
-		BNXT_TF_DBG(ERR, "Failed to get the app id in global init "
-			    "(%d).\n", rc);
+		BNXT_TF_DBG(ERR, "Failed to get the app id in glb init (%d).\n",
+			    rc);
 		return rc;
 	}
 
 	rc = bnxt_ulp_cntxt_dev_id_get(ulp_ctx, &dev_id);
 	if (rc) {
-		BNXT_TF_DBG(ERR, "Failed to get device id for app "
-			    "global init (%d)\n", rc);
+		BNXT_TF_DBG(ERR, "Failed to get dev id for app glb init (%d)\n",
+			    rc);
 		return rc;
 	}
 
@@ -3413,8 +3412,8 @@ ulp_mapper_tbls_process(struct bnxt_ulp_mapper_parms *parms, uint32_t tid)
 						      cond_tbls, num_cond_tbls,
 						      &cond_rc);
 		if (rc) {
-			BNXT_TF_DBG(ERR, "Failed to process cond opc list "
-				   "(%d)\n", rc);
+			BNXT_TF_DBG(ERR, "Failed to proc cond opc list (%d)\n",
+				    rc);
 			goto error;
 		}
 		/* Skip the table if False */
@@ -3812,8 +3811,7 @@ ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx)
 	if (bnxt_ulp_cntxt_shared_session_enabled(ulp_ctx)) {
 		rc = ulp_mapper_app_glb_resource_info_init(ulp_ctx, data);
 		if (rc) {
-			BNXT_TF_DBG(ERR, "Failed to initialize app "
-				    "global resources\n");
+			BNXT_TF_DBG(ERR, "Failed to init app glb resources\n");
 			goto error;
 		}
 	}
@@ -3840,8 +3838,7 @@ ulp_mapper_deinit(struct bnxt_ulp_context *ulp_ctx)
 
 	if (!ulp_ctx) {
 		BNXT_TF_DBG(ERR,
-			    "Failed to acquire ulp context, so data may "
-			    "not be released.\n");
+			    "Failed to acquire ulp context, so data may not be released.\n");
 		return;
 	}
 
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +1 -0
index 4a2f7337be..bc701aa8a5 100644
@@ -29,6 +29,7 @@
 #define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 33
 #define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 27
 #define BNXT_ULP_RESOURCE_RESV_LIST_MAX_SZ 219
+#define BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ 4
 #define BNXT_ULP_APP_CAP_TBL_MAX_SZ 6
 #define BNXT_ULP_COND_GOTO_REJECT 1023
 #define BNXT_ULP_COND_GOTO_RF 0x10000
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +36 -0
index f3146cc1a3..ffa42ffa8b 100644
@@ -270,6 +270,42 @@ struct bnxt_ulp_app_capabilities_info ulp_app_cap_info_list[] = {
 	}
 };
 
+/* List of unnamed app tf resources required to be reserved per app/device */
+struct bnxt_ulp_resource_resv_info ulp_app_resource_resv_list[] = {
+	{
+	.app_id                  = 1,
+	.device_id               = BNXT_ULP_DEVICE_ID_WH_PLUS,
+	.direction               = TF_DIR_RX,
+	.resource_func           = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
+	.resource_type           = TF_TCAM_TBL_TYPE_WC_TCAM,
+	.count                   = 256
+	},
+	{
+	.app_id                  = 1,
+	.device_id               = BNXT_ULP_DEVICE_ID_THOR,
+	.direction               = TF_DIR_RX,
+	.resource_func           = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
+	.resource_type           = TF_TCAM_TBL_TYPE_WC_TCAM,
+	.count                   = 256
+	},
+	{
+	.app_id                  = 2,
+	.device_id               = BNXT_ULP_DEVICE_ID_WH_PLUS,
+	.direction               = TF_DIR_RX,
+	.resource_func           = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
+	.resource_type           = TF_TCAM_TBL_TYPE_WC_TCAM,
+	.count                   = 256
+	},
+	{
+	.app_id                  = 2,
+	.device_id               = BNXT_ULP_DEVICE_ID_THOR,
+	.direction               = TF_DIR_RX,
+	.resource_func           = BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE,
+	.resource_type           = TF_TCAM_TBL_TYPE_WC_TCAM,
+	.count                   = 256
+	}
+};
+
 /* List of device specific parameters */
 struct bnxt_ulp_glb_resource_info ulp_app_glb_resource_tbl[]  = {
 	{
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +6 -0
index cf6a27e771..ed943a7c92 100644
@@ -391,6 +391,12 @@ extern struct bnxt_ulp_glb_resource_info ulp_app_glb_resource_tbl[];
  */
 extern struct bnxt_ulp_resource_resv_info ulp_resource_resv_list[];
 
+/*
+ * The ulp_app_resource_resv_list provides the list of tf resources required
+ * when calling tf_open.
+ */
+extern struct bnxt_ulp_resource_resv_info ulp_app_resource_resv_list[];
+
 /*
  * The_app_cap_info_list provides the list of ULP capabilities per app/device.
  */
Signature · 1 line
2.21.1 (Apple Git-122.3)
#117 lore raw

PATCH v2 52/58 net/bnxt: add templates for shared sessions

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

1. Add template support for shared sessions.
2. Store the shared session flag in flow data base.
3. Store WC TCAM region in the computational field.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |   10 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |    5 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |   11 +
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c          |    2 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |   19 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h         |   18 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |   57 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |    1 -
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   21 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |  444 ++--
 .../bnxt/tf_ulp/ulp_template_db_thor_class.c  |   68 +-
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c | 1100 +++++-----
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 1838 +++++++++--------
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |    3 +
 14 files changed, 1805 insertions(+), 1792 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +7 -3
index 98b86f2c52..0daa8e4c29 100644
@@ -671,7 +671,7 @@ ulp_eem_tbl_scope_deinit(struct bnxt *bp, struct bnxt_ulp_context *ulp_ctx)
 	if (!ulp_ctx || !ulp_ctx->cfg_data)
 		return -EINVAL;
 
-	tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);
+	tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx, BNXT_ULP_SHARED_SESSION_NO);
 	if (!tfp) {
 		BNXT_TF_DBG(ERR, "Failed to get the truflow pointer\n");
 		return -EINVAL;
@@ -1632,13 +1632,17 @@ bnxt_ulp_cntxt_tfp_set(struct bnxt_ulp_context *ulp, struct tf *tfp)
 
 /* Function to get the tfp session details from the ulp context. */
 struct tf *
-bnxt_ulp_cntxt_tfp_get(struct bnxt_ulp_context *ulp)
+bnxt_ulp_cntxt_tfp_get(struct bnxt_ulp_context *ulp,
+		       enum bnxt_ulp_shared_session shared)
 {
 	if (!ulp) {
 		BNXT_TF_DBG(ERR, "Invalid arguments\n");
 		return NULL;
 	}
-	return ulp->g_tfp;
+	if (shared)
+		return ulp->g_shared_tfp;
+	else
+		return ulp->g_tfp;
 }
 
 /*
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +4 -1
index 648fb2ab37..1ba67ed9f6 100644
@@ -31,11 +31,13 @@
 #define BNXT_ULP_VF_REP_ENABLED		0x1
 #define BNXT_ULP_SHARED_SESSION_ENABLED	0x2
 #define BNXT_ULP_APP_DEV_UNSUPPORTED	0x4
+#define BNXT_ULP_HIGH_AVAIL_ENABLED	0x8
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
 #define ULP_SHARED_SESSION_IS_ENABLED(flag) ((flag) &\
 					     BNXT_ULP_SHARED_SESSION_ENABLED)
 #define ULP_APP_DEV_UNSUPPORTED_ENABLED(flag)	((flag) &\
 						 BNXT_ULP_APP_DEV_UNSUPPORTED)
+#define ULP_HIGH_AVAIL_IS_ENABLED(flag)	((flag) & BNXT_ULP_HIGH_AVAIL_ENABLED)
 
 enum bnxt_ulp_flow_mem_type {
 	BNXT_ULP_FLOW_MEM_TYPE_INT = 0,
@@ -158,7 +160,8 @@ bnxt_ulp_cntxt_tfp_set(struct bnxt_ulp_context *ulp, struct tf *tfp);
 
 /* Function to get the tfp session details from ulp context. */
 struct tf *
-bnxt_ulp_cntxt_tfp_get(struct bnxt_ulp_context *ulp);
+bnxt_ulp_cntxt_tfp_get(struct bnxt_ulp_context *ulp,
+		       enum bnxt_ulp_shared_session shared);
 
 /* Get the device table entry based on the device id. */
 struct bnxt_ulp_device_params *
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +11 -0
index 42dc9bef71..9c27217573 100644
@@ -81,6 +81,8 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 			    struct ulp_rte_parser_params *params,
 			    enum bnxt_ulp_fdb_type flow_type)
 {
+	uint32_t ulp_flags = 0;
+
 	memset(mapper_cparms, 0, sizeof(*mapper_cparms));
 	mapper_cparms->flow_type = flow_type;
 	mapper_cparms->app_priority = params->priority;
@@ -106,6 +108,15 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 			    params->hdr_sig_id);
 	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_FLOW_SIG_ID,
 			    params->flow_sig_id);
+
+	/* update the WC Priority flag */
+	if (!bnxt_ulp_cntxt_ptr2_ulp_flags_get(params->ulp_ctx, &ulp_flags) &&
+	    ULP_HIGH_AVAIL_IS_ENABLED(ulp_flags)) {
+		/* TBD: read the state and Set the WC priority */
+		ULP_COMP_FLD_IDX_WR(params,
+				    BNXT_ULP_CF_IDX_WC_IS_HA_HIGH_REG, 1);
+	}
+
 }
 
 /* Function to create the rte flow. */
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +1 -1
index a25893c63c..7c83cb2054 100644
@@ -389,7 +389,7 @@ ulp_fc_mgr_alarm_cb(void *arg)
 		return;
 	}
 
-	tfp = bnxt_ulp_cntxt_tfp_get(ctxt);
+	tfp = bnxt_ulp_cntxt_tfp_get(ctxt, BNXT_ULP_SHARED_SESSION_NO);
 	if (!tfp) {
 		BNXT_TF_DBG(ERR, "Failed to get the truflow pointer\n");
 		return;
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +17 -2
index 8a6a925559..e7e8335dbe 100644
@@ -156,7 +156,7 @@ ulp_flow_db_res_params_to_info(struct ulp_fdb_resource_info *resource_info,
 		resource_info->resource_hndl = (uint32_t)params->resource_hndl;
 		resource_info->resource_type = params->resource_type;
 		resource_info->resource_sub_type = params->resource_sub_type;
-		resource_info->reserved = params->reserved;
+		resource_info->fdb_flags = params->fdb_flags;
 	} else {
 		resource_info->resource_em_handle = params->resource_hndl;
 	}
@@ -187,7 +187,7 @@ ulp_flow_db_res_info_to_params(struct ulp_fdb_resource_info *resource_info,
 		params->resource_hndl = resource_info->resource_hndl;
 		params->resource_type = resource_info->resource_type;
 		params->resource_sub_type = resource_info->resource_sub_type;
-		params->reserved = resource_info->reserved;
+		params->fdb_flags = resource_info->fdb_flags;
 	}
 }
 
@@ -1900,3 +1900,18 @@ ulp_flow_db_parent_flow_count_reset(struct bnxt_ulp_context *ulp_ctxt)
 		}
 	}
 }
+
+/*
+ * Set the shared bit for the flow db entry
+ *
+ * res [in] Ptr to fdb entry
+ * shared [in] shared flag
+ *
+ * returns none
+ */
+void ulp_flow_db_shared_session_set(struct ulp_flow_db_res_params *res,
+				    enum bnxt_ulp_shared_session shared)
+{
+	if (res && (shared & BNXT_ULP_SHARED_SESSION_YES))
+		res->fdb_flags |= ULP_FDB_FLAG_SHARED_SESSION;
+}
drivers/net/bnxt/tf_ulp/ulp_flow_db.h +16 -2
index 62c914833b..d84715e59c 100644
@@ -13,6 +13,9 @@
 #define BNXT_FLOW_DB_DEFAULT_NUM_FLOWS		512
 #define BNXT_FLOW_DB_DEFAULT_NUM_RESOURCES	8
 
+/* Defines for the fdb flag */
+#define ULP_FDB_FLAG_SHARED_SESSION	0x1
+
 /*
  * Structure for the flow database resource information
  * The below structure is based on the below paritions
@@ -30,7 +33,7 @@ struct ulp_fdb_resource_info {
 			uint8_t		resource_func_lower;
 			uint8_t		resource_type;
 			uint8_t		resource_sub_type;
-			uint8_t		reserved;
+			uint8_t		fdb_flags;
 			uint32_t	resource_hndl;
 		};
 	};
@@ -86,7 +89,7 @@ struct ulp_flow_db_res_params {
 	enum bnxt_ulp_resource_func	resource_func;
 	uint8_t				resource_type;
 	uint8_t				resource_sub_type;
-	uint8_t				reserved;
+	uint8_t				fdb_flags;
 	uint8_t				critical_resource;
 	uint64_t			resource_hndl;
 };
@@ -403,4 +406,15 @@ ulp_flow_db_parent_flow_count_get(struct bnxt_ulp_context *ulp_ctxt,
 void
 ulp_flow_db_parent_flow_count_reset(struct bnxt_ulp_context *ulp_ctxt);
 
+/*
+ * Set the shared bit for the flow db entry
+ *
+ * res [in] Ptr to fdb entry
+ * shared [in] shared flag
+ *
+ * returns none
+ */
+void ulp_flow_db_shared_session_set(struct ulp_flow_db_res_params *res,
+				    enum bnxt_ulp_shared_session shared);
+
 #endif /* _ULP_FLOW_DB_H_ */
drivers/net/bnxt/tf_ulp/ulp_mapper.c +41 -16

216 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +0 -1
index edd5978ac6..4c5dd4b836 100644
@@ -48,7 +48,6 @@ struct bnxt_ulp_mapper_parms {
 	struct ulp_rte_field_bitmap		*fld_bitmap;
 	uint32_t				*comp_fld;
 	struct ulp_regfile			*regfile;
-	struct tf				*tfp;
 	struct bnxt_ulp_context			*ulp_ctx;
 	uint32_t				fid;
 	enum bnxt_ulp_fdb_type			flow_type;
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +15 -6
index bc701aa8a5..8cbbe203a8 100644
@@ -3,7 +3,7 @@
  * All rights reserved.
  */
 
-/* date: Wed Mar 17 11:31:19 2021 */
+/* date: Sun Mar 21 13:04:51 2021 */
 
 #ifndef ULP_TEMPLATE_DB_H_
 #define ULP_TEMPLATE_DB_H_
@@ -26,10 +26,10 @@
 #define BNXT_ULP_ACT_HID_SHFTR 27
 #define BNXT_ULP_ACT_HID_SHFTL 26
 #define BNXT_ULP_ACT_HID_MASK 2047
-#define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 33
-#define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 27
-#define BNXT_ULP_RESOURCE_RESV_LIST_MAX_SZ 219
 #define BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ 4
+#define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 33
+#define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 26
+#define BNXT_ULP_RESOURCE_RESV_LIST_MAX_SZ 205
 #define BNXT_ULP_APP_CAP_TBL_MAX_SZ 6
 #define BNXT_ULP_COND_GOTO_REJECT 1023
 #define BNXT_ULP_COND_GOTO_RF 0x10000
@@ -218,7 +218,8 @@ enum bnxt_ulp_cf_idx {
 	BNXT_ULP_CF_IDX_HDR_SIG_ID = 59,
 	BNXT_ULP_CF_IDX_FLOW_SIG_ID = 60,
 	BNXT_ULP_CF_IDX_WC_MATCH = 61,
-	BNXT_ULP_CF_IDX_LAST = 62
+	BNXT_ULP_CF_IDX_WC_IS_HA_HIGH_REG = 62,
+	BNXT_ULP_CF_IDX_LAST = 63
 };
 
 enum bnxt_ulp_cond_list_opc {
@@ -468,6 +469,12 @@ enum bnxt_ulp_rf_idx {
 	BNXT_ULP_RF_IDX_LAST = 40
 };
 
+enum bnxt_ulp_shared_session {
+	BNXT_ULP_SHARED_SESSION_NO = 0,
+	BNXT_ULP_SHARED_SESSION_YES = 1,
+	BNXT_ULP_SHARED_SESSION_LAST = 2
+};
+
 enum bnxt_ulp_tcam_tbl_opc {
 	BNXT_ULP_TCAM_TBL_OPC_NOT_USED = 0,
 	BNXT_ULP_TCAM_TBL_OPC_ALLOC_WR_REGFILE = 1,
@@ -571,6 +578,7 @@ enum bnxt_ulp_act_prop_sz {
 	BNXT_ULP_ACT_PROP_SZ_ENCAP_TUN = 32,
 	BNXT_ULP_ACT_PROP_SZ_JUMP = 4,
 	BNXT_ULP_ACT_PROP_SZ_SHARED_HANDLE = 8,
+	BNXT_ULP_ACT_PROP_SZ_RSS = 64,
 	BNXT_ULP_ACT_PROP_SZ_LAST = 4
 };
 
@@ -617,7 +625,8 @@ enum bnxt_ulp_act_prop_idx {
 	BNXT_ULP_ACT_PROP_IDX_ENCAP_TUN = 225,
 	BNXT_ULP_ACT_PROP_IDX_JUMP = 257,
 	BNXT_ULP_ACT_PROP_IDX_SHARED_HANDLE = 261,
-	BNXT_ULP_ACT_PROP_IDX_LAST = 269
+	BNXT_ULP_ACT_PROP_IDX_RSS = 269,
+	BNXT_ULP_ACT_PROP_IDX_LAST = 333
 };
 
 enum ulp_wp_sym {
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +163 -281

1,281 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_thor_class.c +34 -34

188 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +550 -550

1,096 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +943 -895

1,838 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +3 -0
index ed943a7c92..904710c7f0 100644

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

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#118 lore raw

PATCH v2 53/58 net/bnxt: add HA support in ULP

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Add the ability for cooperative applications to share resources and use the high availability functionality in the HW.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c      |  59 +++
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h      |  10 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c |  15 +-
 drivers/net/bnxt/tf_ulp/meson.build     |   1 +
 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c    | 551 ++++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.h    |  67 +++
 drivers/net/bnxt/tf_ulp/ulp_mapper.c    |  52 ++-
 7 files changed, 745 insertions(+), 10 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.h
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +59 -0
index 0daa8e4c29..972bf8b992 100644
@@ -23,6 +23,7 @@
 #include "ulp_mapper.h"
 #include "ulp_port_db.h"
 #include "ulp_tun.h"
+#include "ulp_ha_mgr.h"
 
 /* Linked list of all TF sessions. */
 STAILQ_HEAD(, bnxt_ulp_session_state) bnxt_ulp_session_list =
@@ -315,6 +316,9 @@ bnxt_ulp_cntxt_app_caps_init(struct bnxt_ulp_context *ulp_ctx,
 		if (info[i].flags & BNXT_ULP_APP_CAP_SHARED_EN)
 			ulp_ctx->cfg_data->ulp_flags |=
 				BNXT_ULP_SHARED_SESSION_ENABLED;
+		if (info[i].flags & BNXT_ULP_APP_CAP_HOT_UPGRADE_EN)
+			ulp_ctx->cfg_data->ulp_flags |=
+				BNXT_ULP_HIGH_AVAIL_ENABLED;
 	}
 	if (!found) {
 		BNXT_TF_DBG(ERR, "APP ID %d, Device ID: 0x%x not supported.\n",
@@ -1137,9 +1141,18 @@ static void
 bnxt_ulp_deinit(struct bnxt *bp,
 		struct bnxt_ulp_session_state *session)
 {
+	bool ha_enabled;
+
 	if (!bp->ulp_ctx || !bp->ulp_ctx->cfg_data)
 		return;
 
+	ha_enabled = bnxt_ulp_cntxt_ha_enabled(bp->ulp_ctx);
+	if (ha_enabled && session->session_opened) {
+		int32_t rc = ulp_ha_mgr_close(bp->ulp_ctx);
+		if (rc)
+			BNXT_TF_DBG(ERR, "Failed to close HA (%d)\n", rc);
+	}
+
 	/* clean up default flows */
 	bnxt_ulp_destroy_df_rules(bp, true);
 
@@ -1179,6 +1192,9 @@ bnxt_ulp_deinit(struct bnxt *bp,
 	/* free the flow db lock */
 	pthread_mutex_destroy(&bp->ulp_ctx->cfg_data->flow_db_lock);
 
+	if (ha_enabled)
+		ulp_ha_mgr_deinit(bp->ulp_ctx);
+
 	/* Delete the ulp context and tf session and free the ulp context */
 	ulp_ctx_deinit(bp, session);
 	BNXT_TF_DBG(DEBUG, "ulp ctx has been deinitialized\n");
@@ -1275,6 +1291,19 @@ bnxt_ulp_init(struct bnxt *bp,
 		BNXT_TF_DBG(ERR, "Failed to set tx global configuration\n");
 		goto jump_to_error;
 	}
+
+	if (bnxt_ulp_cntxt_ha_enabled(bp->ulp_ctx)) {
+		rc = ulp_ha_mgr_init(bp->ulp_ctx);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Failed to initialize HA %d\n", rc);
+			goto jump_to_error;
+		}
+		rc = ulp_ha_mgr_open(bp->ulp_ctx);
+		if (rc) {
+			BNXT_TF_DBG(ERR, "Failed to Process HA Open %d\n", rc);
+			goto jump_to_error;
+		}
+	}
 	BNXT_TF_DBG(DEBUG, "ulp ctx has been initialized\n");
 	return rc;
 
@@ -1828,3 +1857,33 @@ bnxt_ulp_cntxt_release_fdb_lock(struct bnxt_ulp_context	*ulp_ctx)
 
 	pthread_mutex_unlock(&ulp_ctx->cfg_data->flow_db_lock);
 }
+
+/* Function to set the ha info into the context */
+int32_t
+bnxt_ulp_cntxt_ptr2_ha_info_set(struct bnxt_ulp_context *ulp_ctx,
+				struct bnxt_ulp_ha_mgr_info *ulp_ha_info)
+{
+	if (ulp_ctx == NULL || ulp_ctx->cfg_data == NULL) {
+		BNXT_TF_DBG(ERR, "Invalid ulp context data\n");
+		return -EINVAL;
+	}
+	ulp_ctx->cfg_data->ha_info = ulp_ha_info;
+	return 0;
+}
+
+/* Function to retrieve the ha info from the context. */
+struct bnxt_ulp_ha_mgr_info *
+bnxt_ulp_cntxt_ptr2_ha_info_get(struct bnxt_ulp_context *ulp_ctx)
+{
+	if (ulp_ctx == NULL || ulp_ctx->cfg_data == NULL)
+		return NULL;
+	return ulp_ctx->cfg_data->ha_info;
+}
+
+bool
+bnxt_ulp_cntxt_ha_enabled(struct bnxt_ulp_context *ulp_ctx)
+{
+	if (ulp_ctx == NULL || ulp_ctx->cfg_data == NULL)
+		return false;
+	return !!ULP_HIGH_AVAIL_IS_ENABLED(ulp_ctx->cfg_data->ulp_flags);
+}
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +10 -0
index 1ba67ed9f6..b1f090a5cb 100644
@@ -67,6 +67,7 @@ struct bnxt_ulp_data {
 	void				*mapper_data;
 	struct bnxt_ulp_port_db		*port_db;
 	struct bnxt_ulp_fc_info		*fc_info;
+	struct bnxt_ulp_ha_mgr_info	*ha_info;
 	uint32_t			ulp_flags;
 	struct bnxt_ulp_df_rule_info	df_rule_info[RTE_MAX_ETHPORTS];
 	struct bnxt_ulp_vfr_rule_info	vfr_rule_info[RTE_MAX_ETHPORTS];
@@ -275,4 +276,13 @@ bnxt_ulp_cntxt_app_caps_init(struct bnxt_ulp_context *ulp_ctx,
 struct bnxt_ulp_resource_resv_info *
 bnxt_ulp_resource_resv_list_get(uint32_t *num_entries);
 
+int32_t
+bnxt_ulp_cntxt_ptr2_ha_info_set(struct bnxt_ulp_context *ulp_ctx,
+				struct bnxt_ulp_ha_mgr_info *ulp_ha_info);
+
+struct bnxt_ulp_ha_mgr_info *
+bnxt_ulp_cntxt_ptr2_ha_info_get(struct bnxt_ulp_context *ulp_ctx);
+
+bool
+bnxt_ulp_cntxt_ha_enabled(struct bnxt_ulp_context *ulp_ctx);
 #endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +11 -4
index 9c27217573..96e6a76270 100644
@@ -11,6 +11,7 @@
 #include "ulp_mapper.h"
 #include "ulp_fc_mgr.h"
 #include "ulp_port_db.h"
+#include "ulp_ha_mgr.h"
 #include <rte_malloc.h>
 
 static int32_t
@@ -112,11 +113,17 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 	/* update the WC Priority flag */
 	if (!bnxt_ulp_cntxt_ptr2_ulp_flags_get(params->ulp_ctx, &ulp_flags) &&
 	    ULP_HIGH_AVAIL_IS_ENABLED(ulp_flags)) {
-		/* TBD: read the state and Set the WC priority */
-		ULP_COMP_FLD_IDX_WR(params,
-				    BNXT_ULP_CF_IDX_WC_IS_HA_HIGH_REG, 1);
+		enum ulp_ha_mgr_region region = ULP_HA_REGION_LOW;
+		int32_t rc;
+
+		rc = ulp_ha_mgr_region_get(params->ulp_ctx, &region);
+		if (rc)
+			BNXT_TF_DBG(ERR, "Unable to get WC region\n");
+		if (region == ULP_HA_REGION_HI)
+			ULP_COMP_FLD_IDX_WR(params,
+					    BNXT_ULP_CF_IDX_WC_IS_HA_HIGH_REG,
+					    1);
 	}
-
 }
 
 /* Function to create the rte flow. */
drivers/net/bnxt/tf_ulp/meson.build +1 -0
index 1bb93d4938..40479c5936 100644
@@ -24,6 +24,7 @@ sources += files(
         'ulp_tun.c',
         'ulp_gen_tbl.c',
 	'ulp_gen_hash.c',
+	'ulp_ha_mgr.c',
 	'ulp_rte_handler_tbl.c',
         'ulp_template_db_wh_plus_act.c',
         'ulp_template_db_wh_plus_class.c',
drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c new file +551 -0

551 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_ha_mgr.h new file +67 -0

67 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.c +46 -6

110 lines not on this page · raw message

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

PATCH v2 54/58 net/bnxt: add ICMPv6 parser to ULP

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

This patch adds support for parsing rte_flow items for ICMPv6 flows.

---
 drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c |  4 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      | 48 +++++++++++++++++++
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |  5 ++
 3 files changed, 55 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_rte_handler_tbl.c +2 -2
index 7bd499faa6..35e9858727 100644
@@ -346,8 +346,8 @@ struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {
 	.proto_hdr_func          = NULL
 	},
 	[RTE_FLOW_ITEM_TYPE_ICMP6] = {
-	.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
-	.proto_hdr_func          = NULL
+	.hdr_type                = BNXT_ULP_HDR_TYPE_SUPPORTED,
+	.proto_hdr_func          = ulp_rte_icmp6_hdr_handler
 	},
 	[RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS] = {
 	.hdr_type                = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +48 -0

54 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +5 -0
index 66abe8e656..bbba10108c 100644
@@ -147,6 +147,11 @@ int32_t
 ulp_rte_icmp_hdr_handler(const struct rte_flow_item *item,
 			 struct ulp_rte_parser_params *params);
 
+/* Function to handle the parsing of RTE Flow item ICMP6 Header. */
+int32_t
+ulp_rte_icmp6_hdr_handler(const struct rte_flow_item *item,
+			  struct ulp_rte_parser_params *params);
+
 /* Function to handle the parsing of RTE Flow item void Header. */
 int32_t
 ulp_rte_void_hdr_handler(const struct rte_flow_item *item,
Signature · 1 line
2.21.1 (Apple Git-122.3)
#120 lore raw

PATCH v2 55/58 net/bnxt: add context list for timers

In reply to Ajit Khaparde

From: Kishore Padmanabha <[email protected]>

Add context in ULP for timers.
The alarm callback needs to have a valid context pointer when it is invoked. The context could become invalid if the port goes down and the callback is invoked before it is cancelled.

---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c   | 95 ++++++++++++++++++++++++++++
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h   | 12 ++++
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c | 30 ++++++---
 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c | 37 +++++------
 4 files changed, 144 insertions(+), 30 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +95 -0
index 972bf8b992..5f1540027c 100644
@@ -8,6 +8,7 @@
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
 #include <rte_tailq.h>
+#include <rte_spinlock.h>
 
 #include "bnxt.h"
 #include "bnxt_ulp.h"
@@ -32,6 +33,17 @@ STAILQ_HEAD(, bnxt_ulp_session_state) bnxt_ulp_session_list =
 /* Mutex to synchronize bnxt_ulp_session_list operations. */
 static pthread_mutex_t bnxt_ulp_global_mutex = PTHREAD_MUTEX_INITIALIZER;
 
+/* Spin lock to protect context global list */
+rte_spinlock_t bnxt_ulp_ctxt_lock;
+TAILQ_HEAD(cntx_list_entry_list, ulp_context_list_entry);
+static struct cntx_list_entry_list ulp_cntx_list =
+	TAILQ_HEAD_INITIALIZER(ulp_cntx_list);
+
+/* Static function declarations */
+static int32_t bnxt_ulp_cntxt_list_init(void);
+static int32_t bnxt_ulp_cntxt_list_add(struct bnxt_ulp_context *ulp_ctx);
+static void bnxt_ulp_cntxt_list_del(struct bnxt_ulp_context *ulp_ctx);
+
 /*
  * Allow the deletion of context only for the bnxt device that
  * created the session.
@@ -743,6 +755,16 @@ ulp_ctx_init(struct bnxt *bp,
 	int32_t			rc = 0;
 	enum bnxt_ulp_device_id devid;
 
+	/* Initialize the context entries list */
+	bnxt_ulp_cntxt_list_init();
+
+	/* Add the context to the context entries list */
+	rc = bnxt_ulp_cntxt_list_add(bp->ulp_ctx);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to add the context list entry\n");
+		return -ENOMEM;
+	}
+
 	/* Allocate memory to hold ulp context data. */
 	ulp_data = rte_zmalloc("bnxt_ulp_data",
 			       sizeof(struct bnxt_ulp_data), 0);
@@ -878,6 +900,13 @@ ulp_ctx_attach(struct bnxt *bp,
 	/* update the session details in bnxt tfp */
 	bp->tfp.session = session->g_tfp->session;
 
+	/* Add the context to the context entries list */
+	rc = bnxt_ulp_cntxt_list_add(bp->ulp_ctx);
+	if (rc) {
+		BNXT_TF_DBG(ERR, "Failed to add the context list entry\n");
+		return -EINVAL;
+	}
+
 	/*
 	 * The supported flag will be set during the init. Use it now to
 	 * know if we should go through the attach.
@@ -1448,6 +1477,9 @@ bnxt_ulp_port_deinit(struct bnxt *bp)
 	BNXT_TF_DBG(DEBUG, "BNXT Port:%d ULP port deinit\n",
 		    bp->eth_dev->data->port_id);
 
+	/* Free the ulp context in the context entry list */
+	bnxt_ulp_cntxt_list_del(bp->ulp_ctx);
+
 	/* Get the session details  */
 	pci_dev = RTE_DEV_TO_PCI(bp->eth_dev->device);
 	pci_addr = &pci_dev->addr;
@@ -1887,3 +1919,66 @@ bnxt_ulp_cntxt_ha_enabled(struct bnxt_ulp_context *ulp_ctx)
 		return false;
 	return !!ULP_HIGH_AVAIL_IS_ENABLED(ulp_ctx->cfg_data->ulp_flags);
 }
+
+static int32_t
+bnxt_ulp_cntxt_list_init(void)
+{
+	/* Create the cntxt spin lock */
+	rte_spinlock_init(&bnxt_ulp_ctxt_lock);
+
+	return 0;
+}
+
+static int32_t
+bnxt_ulp_cntxt_list_add(struct bnxt_ulp_context *ulp_ctx)
+{
+	struct ulp_context_list_entry	*entry;
+
+	entry = rte_zmalloc(NULL, sizeof(struct ulp_context_list_entry), 0);
+	if (entry == NULL) {
+		BNXT_TF_DBG(ERR, "unable to allocate memory\n");
+		return -ENOMEM;
+	}
+
+	rte_spinlock_lock(&bnxt_ulp_ctxt_lock);
+	entry->ulp_ctx = ulp_ctx;
+	TAILQ_INSERT_TAIL(&ulp_cntx_list, entry, next);
+	rte_spinlock_unlock(&bnxt_ulp_ctxt_lock);
+	return 0;
+}
+
+static void
+bnxt_ulp_cntxt_list_del(struct bnxt_ulp_context *ulp_ctx)
+{
+	struct ulp_context_list_entry	*entry, *temp;
+
+	rte_spinlock_lock(&bnxt_ulp_ctxt_lock);
+	TAILQ_FOREACH_SAFE(entry, &ulp_cntx_list, next, temp) {
+		if (entry->ulp_ctx == ulp_ctx) {
+			TAILQ_REMOVE(&ulp_cntx_list, entry, next);
+			rte_free(entry);
+			break;
+		}
+	}
+	rte_spinlock_unlock(&bnxt_ulp_ctxt_lock);
+}
+
+struct bnxt_ulp_context *
+bnxt_ulp_cntxt_entry_acquire(void)
+{
+	struct ulp_context_list_entry	*entry;
+
+	/* take a lock and get the first ulp context available */
+	if (rte_spinlock_trylock(&bnxt_ulp_ctxt_lock)) {
+		TAILQ_FOREACH(entry, &ulp_cntx_list, next)
+			if (entry->ulp_ctx)
+				return entry->ulp_ctx;
+	}
+	return NULL;
+}
+
+void
+bnxt_ulp_cntxt_entry_release(void)
+{
+	rte_spinlock_unlock(&bnxt_ulp_ctxt_lock);
+}
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +12 -0
index b1f090a5cb..ea38dc0d9f 100644
@@ -112,6 +112,11 @@ struct ulp_tlv_param {
 	uint8_t value[16];
 };
 
+struct ulp_context_list_entry {
+	TAILQ_ENTRY(ulp_context_list_entry)	next;
+	struct bnxt_ulp_context			*ulp_ctx;
+};
+
 /*
  * Allow the deletion of context only for the bnxt device that
  * created the session
@@ -285,4 +290,11 @@ bnxt_ulp_cntxt_ptr2_ha_info_get(struct bnxt_ulp_context *ulp_ctx);
 
 bool
 bnxt_ulp_cntxt_ha_enabled(struct bnxt_ulp_context *ulp_ctx);
+
+struct bnxt_ulp_context *
+bnxt_ulp_cntxt_entry_acquire(void);
+
+void
+bnxt_ulp_cntxt_entry_release(void);
+
 #endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +22 -8
index 7c83cb2054..9a77132385 100644
@@ -197,8 +197,7 @@ ulp_fc_mgr_thread_start(struct bnxt_ulp_context *ctxt)
 
 	if (ulp_fc_info && !(ulp_fc_info->flags & ULP_FLAG_FC_THREAD)) {
 		rte_eal_alarm_set(US_PER_S * ULP_FC_TIMER,
-				  ulp_fc_mgr_alarm_cb,
-				  (void *)ctxt);
+				  ulp_fc_mgr_alarm_cb, NULL);
 		ulp_fc_info->flags |= ULP_FLAG_FC_THREAD;
 	}
 
@@ -220,7 +219,7 @@ void ulp_fc_mgr_thread_cancel(struct bnxt_ulp_context *ctxt)
 		return;
 
 	ulp_fc_info->flags &= ~ULP_FLAG_FC_THREAD;
-	rte_eal_alarm_cancel(ulp_fc_mgr_alarm_cb, (void *)ctxt);
+	rte_eal_alarm_cancel(ulp_fc_mgr_alarm_cb, NULL);
 }
 
 /*
@@ -363,35 +362,48 @@ static int ulp_get_single_flow_stat(struct bnxt_ulp_context *ctxt,
  */
 
 void
-ulp_fc_mgr_alarm_cb(void *arg)
+ulp_fc_mgr_alarm_cb(void *arg __rte_unused)
 {
 	int rc = 0;
 	unsigned int j;
 	enum tf_dir i;
-	struct bnxt_ulp_context *ctxt = arg;
+	struct bnxt_ulp_context *ctxt;
 	struct bnxt_ulp_fc_info *ulp_fc_info;
 	struct bnxt_ulp_device_params *dparms;
 	struct tf *tfp;
 	uint32_t dev_id, hw_cntr_id = 0, num_entries = 0;
 
+	ctxt = bnxt_ulp_cntxt_entry_acquire();
+	if (ctxt == NULL) {
+		BNXT_TF_DBG(INFO, "could not get the ulp context lock\n");
+		rte_eal_alarm_set(US_PER_S * ULP_FC_TIMER,
+				  ulp_fc_mgr_alarm_cb, NULL);
+		return;
+	}
+
 	ulp_fc_info = bnxt_ulp_cntxt_ptr2_fc_info_get(ctxt);
-	if (!ulp_fc_info)
+	if (!ulp_fc_info) {
+		bnxt_ulp_cntxt_entry_release();
 		return;
+	}
 
 	if (bnxt_ulp_cntxt_dev_id_get(ctxt, &dev_id)) {
 		BNXT_TF_DBG(DEBUG, "Failed to get device id\n");
+		bnxt_ulp_cntxt_entry_release();
 		return;
 	}
 
 	dparms = bnxt_ulp_device_params_get(dev_id);
 	if (!dparms) {
 		BNXT_TF_DBG(DEBUG, "Failed to device parms\n");
+		bnxt_ulp_cntxt_entry_release();
 		return;
 	}
 
 	tfp = bnxt_ulp_cntxt_tfp_get(ctxt, BNXT_ULP_SHARED_SESSION_NO);
 	if (!tfp) {
 		BNXT_TF_DBG(ERR, "Failed to get the truflow pointer\n");
+		bnxt_ulp_cntxt_entry_release();
 		return;
 	}
 
@@ -405,6 +417,7 @@ ulp_fc_mgr_alarm_cb(void *arg)
 	if (!ulp_fc_info->num_entries) {
 		pthread_mutex_unlock(&ulp_fc_info->fc_lock);
 		ulp_fc_mgr_thread_cancel(ctxt);
+		bnxt_ulp_cntxt_entry_release();
 		return;
 	}
 	/*
@@ -443,12 +456,13 @@ ulp_fc_mgr_alarm_cb(void *arg)
 
 	if (rc) {
 		ulp_fc_mgr_thread_cancel(ctxt);
+		bnxt_ulp_cntxt_entry_release();
 		return;
 	}
 out:
+	bnxt_ulp_cntxt_entry_release();
 	rte_eal_alarm_set(US_PER_S * ULP_FC_TIMER,
-			  ulp_fc_mgr_alarm_cb,
-			  (void *)ctxt);
+			  ulp_fc_mgr_alarm_cb, NULL);
 }
 
 /*
drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c +15 -22
index dc71054f46..1cfe5cd0a7 100644
@@ -26,7 +26,7 @@
 #define ULP_HA_IF_TBL_IDX 10
 
 static void ulp_ha_mgr_timer_cancel(struct bnxt_ulp_context *ulp_ctx);
-static int32_t ulp_ha_mgr_timer_start(struct bnxt_ulp_context *ulp_ctx);
+static int32_t ulp_ha_mgr_timer_start(void);
 static void ulp_ha_mgr_timer_cb(void *arg);
 static int32_t ulp_ha_mgr_app_type_set(struct bnxt_ulp_context *ulp_ctx,
 				enum ulp_ha_mgr_app_type app_type);
@@ -126,7 +126,7 @@ ulp_ha_mgr_app_type_set(struct bnxt_ulp_context *ulp_ctx,
  * - Release the flow db lock for flows to continue
  */
 static void
-ulp_ha_mgr_timer_cb(void *arg)
+ulp_ha_mgr_timer_cb(void *arg __rte_unused)
 {
 	struct tf_move_tcam_shared_entries_parms mparms = { 0 };
 	struct bnxt_ulp_context *ulp_ctx;
@@ -134,7 +134,13 @@ ulp_ha_mgr_timer_cb(void *arg)
 	struct tf *tfp;
 	int32_t rc;
 
-	ulp_ctx = (struct bnxt_ulp_context *)arg;
+	ulp_ctx = bnxt_ulp_cntxt_entry_acquire();
+	if (ulp_ctx == NULL) {
+		BNXT_TF_DBG(INFO, "could not get the ulp context lock\n");
+		ulp_ha_mgr_timer_start();
+		return;
+	}
+
 	rc = ulp_ha_mgr_state_get(ulp_ctx, &curr_state);
 	if (rc) {
 		/*
@@ -180,31 +186,18 @@ ulp_ha_mgr_timer_cb(void *arg)
 	BNXT_TF_DBG(INFO, "On HA CB: SEC[SEC_TIMER_COPY] => PRIM[PRIM_RUN]\n");
 unlock:
 	bnxt_ulp_cntxt_release_fdb_lock(ulp_ctx);
+	bnxt_ulp_cntxt_entry_release();
 	return;
 cb_restart:
-	ulp_ha_mgr_timer_start(ulp_ctx);
+	bnxt_ulp_cntxt_entry_release();
+	ulp_ha_mgr_timer_start();
 }
 
 static int32_t
-ulp_ha_mgr_timer_start(struct bnxt_ulp_context *ulp_ctx)
+ulp_ha_mgr_timer_start(void)
 {
-	struct bnxt_ulp_ha_mgr_info *ha_info;
-
-	if (ulp_ctx == NULL) {
-		BNXT_TF_DBG(ERR, "Invalid parmsi for ha timer start.\n");
-		return -EINVAL;
-	}
-
-	ha_info = bnxt_ulp_cntxt_ptr2_ha_info_get(ulp_ctx);
-
-	if (ha_info == NULL) {
-		BNXT_TF_DBG(ERR, "Unable to get HA Info in timer start.\n");
-		return -EINVAL;
-	}
-	ha_info->flags |= ULP_HA_TIMER_THREAD;
 	rte_eal_alarm_set(US_PER_S * ULP_HA_TIMER_SEC,
-			  ulp_ha_mgr_timer_cb,
-			  (void *)ulp_ctx);
+			  ulp_ha_mgr_timer_cb, NULL);
 	return 0;
 }
 
@@ -374,7 +367,7 @@ ulp_ha_mgr_open(struct bnxt_ulp_context *ulp_ctx)
 		 * Clear the high region so the secondary can begin overriding
 		 * the current entries.
 		 */
-		rc = ulp_ha_mgr_timer_start(ulp_ctx);
+		rc = ulp_ha_mgr_timer_start();
 		if (rc) {
 			BNXT_TF_DBG(ERR, "Unable to start timer on HA Open.\n");
 			return -EINVAL;
Signature · 1 line
2.21.1 (Apple Git-122.3)
#121 lore raw

PATCH v2 56/58 net/bnxt: cleanup ULP parser and mapper

In reply to Ajit Khaparde

From: Shahaji Bhosle <[email protected]>

1. Disable accum_stats for Thor
2. Delete the generic port table for default flow
3. The packet mask to calculate the number of packets must be 28 bits.
4. Increase the WC TCAM entries to 512 per application and add 2 shared L2 context TCAM entries to match identifiers for flow scaling
5. Ignore multiple critical resources in ULP flow database
6. Renamed conditional code update to function opcode.
7. Updated TRUFLOW debug logs to support the above changes.
8. As part of the HA cleanup, the shared session name now allows the user to designate that the session uses the wc_tcam regions within the shared session.
9. The CFA action pointer does not exist if there is no support for VF representor, so no need to display the message for use case where there is no support for VF representors.
10. Cleanup flow counter software accumulation.
11. When an application exits ungracefully, the HA code now clears the appropriate shared WC region and sets the HA state.
12. Removal of unnecessary INFO message. The message is an indicator that the ports are being removed from DPDK, but all cleanup has not completed. Once the cleanup is completed, the timer will be stopped.

---
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa.h        |     4 +-
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_defs.h   |     6 +-
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p4.c     |     2 +-
 drivers/net/bnxt/tf_core/bitalloc.h           |     2 +-
 drivers/net/bnxt/tf_core/cfa_resource_types.h |     2 +-
 drivers/net/bnxt/tf_core/dpool.h              |     8 +-
 drivers/net/bnxt/tf_core/tf_core.h            |     8 +-
 drivers/net/bnxt/tf_core/tf_em.h              |     2 +-
 drivers/net/bnxt/tf_core/tf_session.h         |     2 +-
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c     |     2 +-
 drivers/net/bnxt/tf_core/tfp.h                |     6 +-
 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c    |   378 +
 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.h    |    29 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |   102 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |     4 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |     1 +
 drivers/net/bnxt/tf_ulp/meson.build           |     1 +
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       |     3 +-
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c          |   103 +-
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h          |     1 +
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |    14 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h         |     2 +-
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c         |    14 +-
 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c          |   197 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |   153 +-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |     6 +-
 drivers/net/bnxt/tf_ulp/ulp_port_db.c         |    43 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |    38 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |     2 +-
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |    92 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c |   158 +-
 .../bnxt/tf_ulp/ulp_template_db_thor_act.c    |   185 +-
 .../bnxt/tf_ulp/ulp_template_db_thor_class.c  | 29120 +++++++++++++++-
 .../tf_ulp/ulp_template_db_wh_plus_class.c    |    76 +-
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |    18 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.c           |     8 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.h           |     4 +-
 37 files changed, 29997 insertions(+), 799 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c
 create mode 100644 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.h
drivers/net/bnxt/hcapi/cfa/hcapi_cfa.h +2 -2
index c67aa29ad0..2f23c4a7fc 100644
@@ -44,7 +44,7 @@ struct hcapi_cfa_devinfo {
 /** CFA device specific function hooks structure
  *
  * The following device hooks can be defined; unless noted otherwise, they are
- * optional and can be filled with a null pointer. The pupose of these hooks
+ * optional and can be filled with a null pointer. The purpose of these hooks
  * to support CFA device operations for different device variants.
  */
 struct hcapi_cfa_devops {
@@ -93,7 +93,7 @@ struct hcapi_cfa_devops {
 	 *   is stored.  It holds the bucket index and the data pointer of
 	 *   a dynamic bucket that is chained to static bucket
 	 *   When using the HWOP GET, this is a pointer to the key location
-	 *   which should be retreved.
+	 *   which should be retrieved.
 	 *
 	 *   (valid for SR2 only).
 	 * @return
drivers/net/bnxt/hcapi/cfa/hcapi_cfa_defs.h +3 -3
index 581dc6bc64..16a31598d6 100644
@@ -231,7 +231,7 @@ struct hcapi_cfa_key_tbl {
 	uint32_t size;
 	/** [in] number of key buckets, applicable for newer chips */
 	uint32_t num_buckets;
-	/** [in] For EEM, this is KEY1 base mem pointer. Fo off-chip EM,
+	/** [in] For EEM, this is KEY1 base mem pointer. For off-chip EM,
 	 *  this is the key record memory base pointer within the key table,
 	 *  applicable for newer chip
 	 */
@@ -273,8 +273,8 @@ struct hcapi_cfa_key_data {
 	uint8_t tbl_scope;
 	/** [in] the fid owner of the key */
 	uint64_t metadata;
-	/** [in] stored with the bucket which can be used to by
-	 *       the caller to retreved later via the GET HW OP.
+	/** [in] stored with the bucket which can be used by
+	 *       the caller to retrieve later via the GET HW OP.
 	 */
 };
 
drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p4.c +1 -1
index 813b33943c..0dca099bdb 100644
@@ -227,7 +227,7 @@ static int hcapi_cfa_p4_key_hw_op_del(struct hcapi_cfa_hwop *op,
 	return rc;
 }
 
-/** Apporiximation of hcapi_cfa_key_hw_op()
+/** Approximation of hcapi_cfa_key_hw_op()
  *
  *
  */
drivers/net/bnxt/tf_core/bitalloc.h +1 -1
index e3b389e68d..db8a09abdd 100644
@@ -60,7 +60,7 @@ struct bitalloc {
 #define BA_NO_ENTRY_FOUND   -1
 
 /**
- * Initializates the bitallocator
+ * Initializes the bitallocator
  *
  * Returns 0 on success, -1 on failure.  Size is arbitrary up to
  * BITALLOC_MAX_SIZE
drivers/net/bnxt/tf_core/cfa_resource_types.h +1 -1
index b63b87bcf3..0d7df2920b 100644
@@ -57,7 +57,7 @@
 #define CFA_RESOURCE_TYPE_P59_RANGE_PROF         0x15UL
 /* Range */
 #define CFA_RESOURCE_TYPE_P59_RANGE              0x16UL
-/* Link Aggrigation */
+/* Link Aggregation */
 #define CFA_RESOURCE_TYPE_P59_LAG                0x17UL
 /* VEB TCAM */
 #define CFA_RESOURCE_TYPE_P59_VEB_TCAM           0x18UL
drivers/net/bnxt/tf_core/dpool.h +4 -4
index 8b0a4182dc..fb79c7be4b 100644
@@ -98,7 +98,7 @@ struct dpool_adj_list_entry {
  *
  * A list of references to entries in the dpool entry array that
  * have free entries to the left and right. Since we pack to the
- * left entries will always have a non zero left cout.
+ * left entries will always have a non zero left out.
  *
  * Used only during the defrag operation.
  */
@@ -281,17 +281,17 @@ void dpool_dump(struct dpool *dpool);
 /**
  * dpool_defrag
  *
- * De-fragment the dpool array and apply the specified defrag stratagy.
+ * De-fragment the dpool array and apply the specified defrag strategy.
  *
  * [in] dpool
  *      The dpool
  *
  * [in] entry_size
- *      If using the DP_DEFRAG_TO_FIT stratagy defrag will stop when there's
+ *      If using the DP_DEFRAG_TO_FIT strategy defrag will stop when there's
  *      at least entry_size space available.
  *
  * [i] defrag
- *     Defrag stratagy:
+ *     Defrag strategy:
  *
  *     DP_DEFRAG_ALL    (0x1) - Defrag until there is nothing left
  *                              to defrag.
drivers/net/bnxt/tf_core/tf_core.h +4 -4
index be5725a66a..84b234f0e3 100644
@@ -396,7 +396,7 @@ enum tf_search_status {
 enum tf_em_tbl_type {
 	/** The number of internal EM records for the session */
 	TF_EM_TBL_TYPE_EM_RECORD,
-	/** The number of table scopes reequested */
+	/** The number of table scopes requested */
 	TF_EM_TBL_TYPE_TBL_SCOPE,
 	TF_EM_TBL_TYPE_MAX
 };
@@ -415,7 +415,7 @@ enum tf_em_tbl_type {
  */
 struct tf_session_info {
 	/**
-	 * TrueFlow Version. Used to control the structure layout when
+	 * TruFlow Version. Used to control the structure layout when
 	 * sharing sessions. No guarantee that a secondary process
 	 * would come from the same version of an executable.
 	 * TruFlow initializes this variable on tf_open_session().
@@ -520,7 +520,7 @@ struct tf_identifier_resources {
 struct tf_tbl_resources {
 	/**
 	 * Array of TF Table types where each entry is expected to be
-	 * set to the requeste resource number of that specific
+	 * set to the requested resource number of that specific
 	 * type. The index used is tf_tbl_type.
 	 */
 	uint16_t cnt[TF_TBL_TYPE_MAX];
@@ -1677,7 +1677,7 @@ struct tf_search_tbl_entry_parms {
  *
  * Implementation:
  *
- * A hash is performed on the result data and mappe3d to a shadow copy entry
+ * A hash is performed on the result data and mapped to a shadow copy entry
  * where the result is populated.  If the result matches the entry, hit is set,
  * ref_cnt is incremented (if alloc), and the search status indicates what
  * action the caller can take regarding setting the entry.
drivers/net/bnxt/tf_core/tf_em.h +1 -1
index 9d168c3c7f..568071ad8c 100644
@@ -95,7 +95,7 @@
  *  |   Index      |E |
  *  +--------------+--+
  *
- * E = Entry (bucket inndex)
+ * E = Entry (bucket index)
  */
 #define TF_EM_INTERNAL_INDEX_SHIFT 2
 #define TF_EM_INTERNAL_INDEX_MASK 0xFFFC
drivers/net/bnxt/tf_core/tf_session.h +1 -1
index c2875f9fa1..d68421cd13 100644
@@ -59,7 +59,7 @@
  * tf_session_info.
  */
 struct tf_session {
-	/** TrueFlow Version. Used to control the structure layout
+	/** TruFlow Version. Used to control the structure layout
 	 * when sharing sessions. No guarantee that a secondary
 	 * process would come from the same version of an executable.
 	 */
drivers/net/bnxt/tf_core/tf_shadow_tcam.c +1 -1
index 523261f189..5fcd1f9107 100644
@@ -25,7 +25,7 @@
  *   - the result table is stored separately since it only needs to be accessed
  *   when the key matches.
  *   - the result has a back pointer to the hash table via the hb handle.  The
- *   hb handle is a 32 bit represention of the hash with a valid bit, bucket
+ *   hb handle is a 32 bit representation of the hash with a valid bit, bucket
  *   element index, and the hash index.  It is necessary to store the hb handle
  *   with the result since subsequent removes only provide the tcam index.
  *
drivers/net/bnxt/tf_core/tfp.h +3 -3
index 58f34bbcab..dd0a347058 100644
@@ -38,7 +38,7 @@ struct tfp_spinlock_parms {
 /**
  * @file
  *
- * TrueFlow Portability API Header File
+ * TruFlow Portability API Header File
  */
 
 /**
@@ -119,8 +119,8 @@ struct tfp_calloc_parms {
  */
 
 /**
- * Provides communication capability from the TrueFlow API layer to
- * the TrueFlow firmware. The portability layer internally provides
+ * Provides communication capability from the TruFlow API layer to
+ * the TruFlow firmware. The portability layer internally provides
  * the transport to the firmware.
  *
  * [in] session, pointer to session handle
drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c new file +378 -0

378 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.h new file +29 -0
new file mode 100644
index 0000000000..229e21814b
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2021-2021 Broadcom
+ * All rights reserved.
+ */
+
+#ifndef _BNXT_TF_PMD_ABSTRACT_H_
+#define _BNXT_TF_PMD_ABSTRACT_H_
+
+#include "bnxt_tf_common.h"
+#include "ulp_mapper.h"
+
+int32_t bnxt_rss_config_action_apply(struct bnxt_ulp_mapper_parms *parms);
+int32_t bnxt_pmd_get_parent_mac_addr(struct bnxt_ulp_mapper_parms *parms,
+				     uint8_t *mac);
+void bnxt_pmd_get_iface_mac(uint16_t port, enum bnxt_ulp_intf_type type,
+			    uint8_t *mac, uint8_t *parent_mac);
+uint16_t bnxt_pmd_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
+uint16_t bnxt_pmd_get_parent_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
+struct bnxt *bnxt_pmd_get_bp(uint16_t port);
+uint16_t bnxt_pmd_get_svif(uint16_t port_id, bool func_svif,
+			   enum bnxt_ulp_intf_type type);
+uint16_t bnxt_pmd_get_fw_func_id(uint16_t port, enum bnxt_ulp_intf_type type);
+uint16_t bnxt_pmd_get_parif(uint16_t port, enum bnxt_ulp_intf_type type);
+uint16_t bnxt_pmd_get_phy_port_id(uint16_t port);
+uint16_t bnxt_pmd_get_vport(uint16_t port);
+enum bnxt_ulp_intf_type bnxt_pmd_get_interface_type(uint16_t port);
+int32_t bnxt_pmd_set_unicast_rxmask(struct rte_eth_dev *eth_dev);
+
+#endif /* _BNXT_TF_PMD_ABSTRACT_H_ */
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +81 -21

213 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/bnxt_ulp.h +4 -0
index ea38dc0d9f..082ca501b6 100644
@@ -32,6 +32,7 @@
 #define BNXT_ULP_SHARED_SESSION_ENABLED	0x2
 #define BNXT_ULP_APP_DEV_UNSUPPORTED	0x4
 #define BNXT_ULP_HIGH_AVAIL_ENABLED	0x8
+#define BNXT_ULP_APP_UNICAST_ONLY	0x10
 #define ULP_VF_REP_IS_ENABLED(flag)	((flag) & BNXT_ULP_VF_REP_ENABLED)
 #define ULP_SHARED_SESSION_IS_ENABLED(flag) ((flag) &\
 					     BNXT_ULP_SHARED_SESSION_ENABLED)
@@ -77,6 +78,7 @@ struct bnxt_ulp_data {
 	struct bnxt_tun_cache_entry	tun_tbl[BNXT_ULP_MAX_TUN_CACHE_ENTRIES];
 	bool				accum_stats;
 	uint8_t				app_id;
+	uint8_t				num_shared_clients;
 };
 
 struct bnxt_ulp_context {
@@ -297,4 +299,6 @@ bnxt_ulp_cntxt_entry_acquire(void);
 void
 bnxt_ulp_cntxt_entry_release(void);
 
+uint8_t
+bnxt_ulp_cntxt_num_shared_clients_get(struct bnxt_ulp_context *ulp_ctx);
 #endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +1 -0
index 96e6a76270..19e9dba356 100644
@@ -103,6 +103,7 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
 	mapper_cparms->flow_pattern_id = params->flow_pattern_id;
 	mapper_cparms->act_pattern_id = params->act_pattern_id;
 	mapper_cparms->app_id = params->app_id;
+	mapper_cparms->port_id = params->port_id;
 
 	/* update the signature fields into the computed field list */
 	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_HDR_SIG_ID,
drivers/net/bnxt/tf_ulp/meson.build +1 -0
index 40479c5936..456d8ca7b6 100644
@@ -22,6 +22,7 @@ sources += files(
         'ulp_def_rules.c',
         'ulp_fc_mgr.c',
         'ulp_tun.c',
+	'bnxt_tf_pmd_shim.c',
         'ulp_gen_tbl.c',
 	'ulp_gen_hash.c',
 	'ulp_ha_mgr.c',
drivers/net/bnxt/tf_ulp/ulp_def_rules.c +2 -1
index 483030edbf..d8336d164e 100644
@@ -299,7 +299,7 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
 			uint32_t *flow_id)
 {
 	struct ulp_rte_hdr_field	hdr_field[BNXT_ULP_PROTO_HDR_MAX];
-	uint32_t			comp_fld[BNXT_ULP_CF_IDX_LAST];
+	uint64_t			comp_fld[BNXT_ULP_CF_IDX_LAST];
 	struct bnxt_ulp_mapper_create_parms mapper_params = { 0 };
 	struct ulp_rte_act_prop		act_prop;
 	struct ulp_rte_act_bitmap	act = { 0 };
@@ -318,6 +318,7 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
 	mapper_params.comp_fld = comp_fld;
 	mapper_params.class_tid = ulp_class_tid;
 	mapper_params.flow_type = BNXT_ULP_FDB_TYPE_DEFAULT;
+	mapper_params.port_id = eth_dev->data->port_id;
 
 	ulp_ctx = bnxt_ulp_eth_dev_ptr2_cntxt_get(eth_dev);
 	if (!ulp_ctx) {
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +93 -10

152 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h +1 -0
index 04cb86bea2..448d05c118 100644
@@ -48,6 +48,7 @@ struct bnxt_ulp_fc_info {
 	uint32_t		flags;
 	uint32_t		num_entries;
 	pthread_mutex_t		fc_lock;
+	uint32_t		num_counters;
 };
 
 int32_t
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +10 -4
index e7e8335dbe..ab6013f0e3 100644
@@ -116,7 +116,7 @@ ulp_flow_db_resource_func_get(struct ulp_fdb_resource_info *res_info)
 
 	func = (((res_info->nxt_resource_idx & ULP_FLOW_DB_RES_FUNC_MASK) >>
 		 ULP_FLOW_DB_RES_FUNC_BITS) << ULP_FLOW_DB_RES_FUNC_UPPER);
-	/* The reource func is split into upper and lower */
+	/* The resource func is split into upper and lower */
 	if (func & ULP_FLOW_DB_RES_FUNC_NEED_LOWER)
 		return (func | res_info->resource_func_lower);
 	return func;
@@ -712,6 +712,12 @@ ulp_flow_db_resource_add(struct bnxt_ulp_context *ulp_ctxt,
 	}
 	fid_resource = &flow_tbl->flow_resources[fid];
 
+	if (params->critical_resource && fid_resource->resource_em_handle) {
+		BNXT_TF_DBG(DEBUG, "Ignore multiple critical resources\n");
+		/* Ignore the multiple critical resources */
+		params->critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO;
+	}
+
 	if (!params->critical_resource) {
 		/* Not the critical_resource so allocate a resource */
 		idx = flow_tbl->flow_tbl_stack[flow_tbl->tail_index];
@@ -735,7 +741,7 @@ ulp_flow_db_resource_add(struct bnxt_ulp_context *ulp_ctxt,
 	if (params->resource_type == TF_TBL_TYPE_ACT_STATS_64 &&
 	    params->resource_sub_type ==
 	    BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT &&
-	    ulp_fc_info) {
+	    ulp_fc_info && ulp_fc_info->num_counters) {
 		/* Store the first HW counter ID for this table */
 		if (!ulp_fc_mgr_start_idx_isset(ulp_ctxt, params->direction))
 			ulp_fc_mgr_start_idx_set(ulp_ctxt, params->direction,
@@ -760,7 +766,7 @@ ulp_flow_db_resource_add(struct bnxt_ulp_context *ulp_ctxt,
  * flow_type [in] Specify it is regular or default flow
  * fid [in] The index to the flow entry
  * params [in/out] The contents to be copied into params.
- * Onlythe critical_resource needs to be set by the caller.
+ * Only the critical_resource needs to be set by the caller.
  *
  * Returns 0 on success and negative on failure.
  */
@@ -1287,7 +1293,7 @@ ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,
 					     BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,
 					     sub_typ, &params);
 	if (rc) {
-		BNXT_TF_DBG(ERR, "CFA Action ptr not found for flow id %u\n",
+		BNXT_TF_DBG(INFO, "CFA Action ptr not found for flow id %u\n",
 			    flow_id);
 		return -ENOENT;
 	}
drivers/net/bnxt/tf_ulp/ulp_flow_db.h +1 -1
index d84715e59c..67afca8872 100644
@@ -18,7 +18,7 @@
 
 /*
  * Structure for the flow database resource information
- * The below structure is based on the below paritions
+ * The below structure is based on the below partitions
  * nxt_resource_idx = dir[31],resource_func_upper[30:28],nxt_resource_idx[27:0]
  * If resource_func is EM_TBL then use resource_em_handle.
  * Else the other part of the union is used and
drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c +9 -5
index 5c94e2f5d0..3c1af0b007 100644
@@ -346,11 +346,15 @@ ulp_mapper_gen_tbl_res_free(struct bnxt_ulp_context *ulp_ctx,
 		return -EINVAL;
 	}
 	fid = tfp_be_to_cpu_32(fid);
-
-	/* Destroy the flow associated with the shared flow id */
-	if (ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_RID,
-				    fid))
-		BNXT_TF_DBG(ERR, "Error in deleting shared flow id %x\n", fid);
+	/* no need to del if fid is 0 since there is no associated resource */
+	if (fid) {
+		/* Destroy the flow associated with the shared flow id */
+		if (ulp_mapper_flow_destroy(ulp_ctx, BNXT_ULP_FDB_TYPE_RID,
+					    fid))
+			BNXT_TF_DBG(ERR,
+				    "Error in deleting shared flow id %x\n",
+				    fid);
+	}
 
 	/* Delete the entry from the hash table */
 	if (gen_tbl_list->hash_tbl)
drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c +145 -52

301 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.c +94 -59

257 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_mapper.h +4 -2
index 4c5dd4b836..004e89ac2b 100644
@@ -46,7 +46,7 @@ struct bnxt_ulp_mapper_parms {
 	struct ulp_rte_hdr_bitmap		*hdr_bitmap;
 	struct ulp_rte_hdr_field		*hdr_field;
 	struct ulp_rte_field_bitmap		*fld_bitmap;
-	uint32_t				*comp_fld;
+	uint64_t				*comp_fld;
 	struct ulp_regfile			*regfile;
 	struct bnxt_ulp_context			*ulp_ctx;
 	uint32_t				fid;
@@ -61,13 +61,14 @@ struct bnxt_ulp_mapper_parms {
 	uint32_t				flow_pattern_id;
 	uint32_t				act_pattern_id;
 	uint8_t					app_id;
+	uint16_t				port_id;
 };
 
 struct bnxt_ulp_mapper_create_parms {
 	uint32_t			app_priority;
 	struct ulp_rte_hdr_bitmap	*hdr_bitmap;
 	struct ulp_rte_hdr_field	*hdr_field;
-	uint32_t			*comp_fld;
+	uint64_t			*comp_fld;
 	struct ulp_rte_act_bitmap	*act;
 	struct ulp_rte_act_prop		*act_prop;
 	struct ulp_rte_field_bitmap	*fld_bitmap;
@@ -89,6 +90,7 @@ struct bnxt_ulp_mapper_create_parms {
 	uint32_t			flow_pattern_id;
 	uint32_t			act_pattern_id;
 	uint8_t				app_id;
+	uint16_t			port_id;
 };
 
 /* Function to initialize any dynamic mapper data. */
drivers/net/bnxt/tf_ulp/ulp_port_db.c +22 -21

85 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +28 -10
index b8e69ffd1e..5fd52b8f36 100644
@@ -201,8 +201,7 @@ bnxt_ulp_comp_fld_intf_update(struct ulp_rte_parser_params *params)
 	dir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);
 
 	/* read the port id details */
-	port_id = ULP_COMP_FLD_IDX_RD(params,
-				      BNXT_ULP_CF_IDX_INCOMING_IF);
+	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)) {
@@ -856,7 +855,7 @@ ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,
 			       BNXT_ULP_HDR_BIT_II_VLAN);
 		inner_flag = 1;
 	} else {
-		BNXT_TF_DBG(ERR, "Error Parsing:Vlan hdr found withtout eth\n");
+		BNXT_TF_DBG(ERR, "Error Parsing:Vlan hdr found without eth\n");
 		return BNXT_TF_RC_ERROR;
 	}
 	/* Update the field protocol hdr bitmap */
@@ -1691,15 +1690,34 @@ int32_t
 ulp_rte_rss_act_handler(const struct rte_flow_action *action_item,
 			struct ulp_rte_parser_params *param)
 {
-	const struct rte_flow_action_rss *rss = action_item->conf;
+	const struct rte_flow_action_rss *rss;
+	struct ulp_rte_act_prop *ap = &param->act_prop;
 
-	if (rss) {
-		/* Update the hdr_bitmap with vxlan */
-		ULP_BITMAP_SET(param->act_bitmap.bits, BNXT_ULP_ACT_BIT_RSS);
-		return BNXT_TF_RC_SUCCESS;
+	if (action_item == NULL || action_item->conf == NULL) {
+		BNXT_TF_DBG(ERR, "Parse Err: invalid rss configuration\n");
+		return BNXT_TF_RC_ERROR;
 	}
-	BNXT_TF_DBG(ERR, "Parse Error: RSS arg is invalid\n");
-	return BNXT_TF_RC_ERROR;
+
+	rss = action_item->conf;
+	/* Copy the rss into the specific action properties */
+	memcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_RSS_TYPES], &rss->types,
+	       BNXT_ULP_ACT_PROP_SZ_RSS_TYPES);
+	memcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_RSS_LEVEL], &rss->level,
+	       BNXT_ULP_ACT_PROP_SZ_RSS_LEVEL);
+	memcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_RSS_KEY_LEN],
+	       &rss->key_len, BNXT_ULP_ACT_PROP_SZ_RSS_KEY_LEN);
+
+	if (rss->key_len > BNXT_ULP_ACT_PROP_SZ_RSS_KEY) {
+		BNXT_TF_DBG(ERR, "Parse Err: RSS key too big\n");
+		return BNXT_TF_RC_ERROR;
+	}
+	memcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_RSS_KEY], rss->key,
+	       rss->key_len);
+
+	/* set the RSS action header bit */
+	ULP_BITMAP_SET(param->act_bitmap.bits, BNXT_ULP_ACT_BIT_RSS);
+
+	return BNXT_TF_RC_SUCCESS;
 }
 
 /* Function to handle the parsing of RTE Flow action vxlan_encap Header. */
drivers/net/bnxt/tf_ulp/ulp_rte_parser.h +1 -1
index bbba10108c..4431f1bbd0 100644
@@ -24,7 +24,7 @@
 #define BNXT_ULP_ENCAP_IPV6_DO			2
 #define BNXT_ULP_ENCAP_IPV6_SIZE		24
 #define BNXT_ULP_ENCAP_UDP_SIZE			4
-#define BNXT_ULP_INVALID_SVIF_VAL		-1U
+#define BNXT_ULP_INVALID_SVIF_VAL		-1UL
 
 #define	BNXT_ULP_GET_IPV6_VER(vtcf)		\
 			(((vtcf) & BNXT_ULP_PARSER_IPV6_VER_MASK) >> 28)
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +53 -39

152 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +131 -27

348 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_thor_act.c +176 -9

204 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_thor_class.c +28658 -462

497 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +38 -38

76 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_struct.h +9 -9
index 904710c7f0..0cbac66237 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.c +4 -4
index 1649e157f2..bafb539c8d 100644

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

drivers/net/bnxt/tf_ulp/ulp_utils.h +2 -2
index 209c8fa6a4..e1b0e773f3 100644

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

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#122 lore raw

PATCH v2 57/58 net/bnxt: reorganize ULP template directory structure

In reply to Ajit Khaparde

From: Venkat Duvvuru <[email protected]>

Reorganize ULP template directory structure and add meson.build file to the respective directories.

---
 .../bnxt/tf_ulp/generic_templates/meson.build |   13 +
 .../ulp_template_db_act.c                     |    0
 .../ulp_template_db_class.c                   |    0
 .../ulp_template_db_enum.h                    |    0
 .../ulp_template_db_field.h                   |    0
 .../ulp_template_db_tbl.c                     |    0
 .../ulp_template_db_tbl.h                     |    0
 .../ulp_template_db_thor_act.c                |    0
 .../ulp_template_db_thor_class.c              |    0
 .../ulp_template_db_wh_plus_act.c             |    0
 .../ulp_template_db_wh_plus_class.c           |    0
 drivers/net/bnxt/tf_ulp/meson.build           |   11 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db.c     | 4622 -----------------
 drivers/net/bnxt/tf_ulp/ulp_template_db.h     |  614 ---
 .../net/bnxt/tf_ulp/ulp_template_field_db.h   |  224 -
 15 files changed, 16 insertions(+), 5468 deletions(-)
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/meson.build
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_act.c (100%)
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_class.c (100%)
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_enum.h (100%)
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_field.h (100%)
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_tbl.c (100%)
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_tbl.h (100%)
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_thor_act.c (100%)
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_thor_class.c (100%)
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_wh_plus_act.c (100%)
 rename drivers/net/bnxt/tf_ulp/{ => generic_templates}/ulp_template_db_wh_plus_class.c (100%)
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db.c
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db.h
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_field_db.h
drivers/net/bnxt/tf_ulp/generic_templates/meson.build new file +13 -0
new file mode 100644
index 0000000000..e80dc3fb3f
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Intel Corporation
+# Copyright(c) 2020 Broadcom
+
+includes += include_directories('.')
+sources += files(
+	'ulp_template_db_class.c',
+	'ulp_template_db_act.c',
+	'ulp_template_db_tbl.c',
+	'ulp_template_db_wh_plus_act.c',
+	'ulp_template_db_wh_plus_class.c',
+	'ulp_template_db_thor_act.c',
+	'ulp_template_db_thor_class.c')
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_act.c renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_act.c
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_act.c
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_class.c renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_class.c
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_class.c
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_enum.h renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_enum.h
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_field.h renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_field.h +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_field.h
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_field.h
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.h renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.h
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_thor_act.c renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_thor_act.c +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_thor_act.c
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_thor_act.c
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_thor_class.c renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_thor_class.c +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_thor_class.c
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_thor_class.c
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_wh_plus_act.c renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_wh_plus_act.c
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_wh_plus_class.c renamed from drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c +0 -0
similarity index 100%
rename from drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c
rename to drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_wh_plus_class.c
drivers/net/bnxt/tf_ulp/meson.build +3 -8
index 456d8ca7b6..25de7f3f3f 100644
@@ -10,9 +10,6 @@ sources += files(
         'bnxt_ulp.c',
         'ulp_mark_mgr.c',
         'ulp_flow_db.c',
-        'ulp_template_db_tbl.c',
-        'ulp_template_db_class.c',
-        'ulp_template_db_act.c',
         'ulp_utils.c',
         'ulp_mapper.c',
         'ulp_matcher.c',
@@ -26,8 +23,6 @@ sources += files(
         'ulp_gen_tbl.c',
 	'ulp_gen_hash.c',
 	'ulp_ha_mgr.c',
-	'ulp_rte_handler_tbl.c',
-        'ulp_template_db_wh_plus_act.c',
-        'ulp_template_db_wh_plus_class.c',
-	'ulp_template_db_thor_act.c',
-	'ulp_template_db_thor_class.c')
+	'ulp_rte_handler_tbl.c')
+
+subdir('generic_templates')
drivers/net/bnxt/tf_ulp/ulp_template_db.c deleted +0 -4622

2,967 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_db.h deleted +0 -614

614 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/ulp_template_field_db.h deleted +0 -224

224 lines not on this page · raw message

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#123 lore raw

PATCH v2 58/58 net/bnxt: add Thor template support

In reply to Ajit Khaparde

From: Mike Baucom <[email protected]>

Template adds non-VF representor based support.
Item matches supported:
- DMAC, SIP, DIP, Proto, Sport, Dport
- SIP, DIP, Proto, Sport, Dport
Actions supported:
- count, drop

---
 .../generic_templates/ulp_template_db_enum.h  |    71 +-
 .../generic_templates/ulp_template_db_tbl.c   |   278 +-
 .../ulp_template_db_thor_act.c                |    48 +-
 .../ulp_template_db_thor_class.c              | 31252 ++--------------
 .../ulp_template_db_wh_plus_act.c             |   156 +-
 .../ulp_template_db_wh_plus_class.c           |   458 +-
 6 files changed, 4697 insertions(+), 27566 deletions(-)
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_enum.h +40 -31
index a38fddafdb..b6db49cc5d 100644
@@ -3,7 +3,7 @@
  * All rights reserved.
  */
 
-/* date: Wed Apr 14 09:56:27 2021 */
+/* date: Thu May 13 18:15:56 2021 */
 
 #ifndef ULP_TEMPLATE_DB_H_
 #define ULP_TEMPLATE_DB_H_
@@ -26,10 +26,10 @@
 #define BNXT_ULP_ACT_HID_SHFTR 27
 #define BNXT_ULP_ACT_HID_SHFTL 26
 #define BNXT_ULP_ACT_HID_MASK 2047
-#define BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ 4
-#define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 33
-#define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 38
-#define BNXT_ULP_RESOURCE_RESV_LIST_MAX_SZ 205
+#define BNXT_ULP_APP_RESOURCE_RESV_LIST_MAX_SZ 8
+#define BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ 43
+#define BNXT_ULP_APP_GLB_RESOURCE_TBL_MAX_SZ 50
+#define BNXT_ULP_RESOURCE_RESV_LIST_MAX_SZ 204
 #define BNXT_ULP_APP_CAP_TBL_MAX_SZ 6
 #define BNXT_ULP_COND_GOTO_REJECT 1023
 #define BNXT_ULP_COND_GOTO_RF 0x10000
@@ -44,11 +44,11 @@
 #define ULP_WH_PLUS_CLASS_RESULT_FIELD_LIST_SIZE 546
 #define ULP_WH_PLUS_CLASS_COND_LIST_SIZE 43
 #define ULP_THOR_CLASS_TMPL_LIST_SIZE 5
-#define ULP_THOR_CLASS_TBL_LIST_SIZE 13
-#define ULP_THOR_CLASS_KEY_INFO_LIST_SIZE 0
-#define ULP_THOR_CLASS_IDENT_LIST_SIZE 0
-#define ULP_THOR_CLASS_RESULT_FIELD_LIST_SIZE 102
-#define ULP_THOR_CLASS_COND_LIST_SIZE 1
+#define ULP_THOR_CLASS_TBL_LIST_SIZE 33
+#define ULP_THOR_CLASS_KEY_INFO_LIST_SIZE 242
+#define ULP_THOR_CLASS_IDENT_LIST_SIZE 8
+#define ULP_THOR_CLASS_RESULT_FIELD_LIST_SIZE 259
+#define ULP_THOR_CLASS_COND_LIST_SIZE 13
 #define ULP_WH_PLUS_ACT_TMPL_LIST_SIZE 7
 #define ULP_WH_PLUS_ACT_TBL_LIST_SIZE 35
 #define ULP_WH_PLUS_ACT_KEY_INFO_LIST_SIZE 2
@@ -56,11 +56,11 @@
 #define ULP_WH_PLUS_ACT_RESULT_FIELD_LIST_SIZE 512
 #define ULP_WH_PLUS_ACT_COND_LIST_SIZE 39
 #define ULP_THOR_ACT_TMPL_LIST_SIZE 7
-#define ULP_THOR_ACT_TBL_LIST_SIZE 0
+#define ULP_THOR_ACT_TBL_LIST_SIZE 2
 #define ULP_THOR_ACT_KEY_INFO_LIST_SIZE 0
 #define ULP_THOR_ACT_IDENT_LIST_SIZE 0
-#define ULP_THOR_ACT_RESULT_FIELD_LIST_SIZE 0
-#define ULP_THOR_ACT_COND_LIST_SIZE 0
+#define ULP_THOR_ACT_RESULT_FIELD_LIST_SIZE 18
+#define ULP_THOR_ACT_COND_LIST_SIZE 5
 
 enum bnxt_ulp_act_bit {
 	BNXT_ULP_ACT_BIT_MARK                = 0x0000000000000001,
@@ -199,7 +199,8 @@ enum bnxt_ulp_cf_idx {
 	BNXT_ULP_CF_IDX_FLOW_SIG_ID = 60,
 	BNXT_ULP_CF_IDX_WC_MATCH = 61,
 	BNXT_ULP_CF_IDX_WC_IS_HA_HIGH_REG = 62,
-	BNXT_ULP_CF_IDX_LAST = 63
+	BNXT_ULP_CF_IDX_F1_DMAC = 63,
+	BNXT_ULP_CF_IDX_LAST = 64
 };
 
 enum bnxt_ulp_cond_list_opc {
@@ -345,23 +346,31 @@ enum bnxt_ulp_glb_rf_idx {
 	BNXT_ULP_GLB_RF_IDX_L2_PROF_FUNC_ID = 3,
 	BNXT_ULP_GLB_RF_IDX_VXLAN_PROF_FUNC_ID = 4,
 	BNXT_ULP_GLB_RF_IDX_ENCAP_MAC_PTR = 5,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_PROF_FUNC_ID_0 = 6,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_PROF_FUNC_ID_1 = 7,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_PROF_FUNC_ID_2 = 8,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_L2_CNTXT_ID_0 = 9,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_L2_CNTXT_ID_1 = 10,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_EM_PROFILE_ID_0 = 11,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_EM_PROFILE_ID_1 = 12,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_PROFILE_ID_0 = 13,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_PROFILE_ID_1 = 14,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_PROFILE_ID_2 = 15,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_EM_KEY_ID_0 = 16,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_EM_KEY_ID_1 = 17,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_KEY_ID_0 = 18,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_KEY_ID_1 = 19,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_AREC_PTR_0 = 20,
-	BNXT_ULP_GLB_RF_IDX_APP_GLB_AREC_PTR_1 = 21,
-	BNXT_ULP_GLB_RF_IDX_LAST = 22
+	BNXT_ULP_GLB_RF_IDX_GLB_WC_PROFILE_ID_0 = 6,
+	BNXT_ULP_GLB_RF_IDX_GLB_WC_PROFILE_ID_1 = 7,
+	BNXT_ULP_GLB_RF_IDX_GLB_EM_PROFILE_ID_0 = 8,
+	BNXT_ULP_GLB_RF_IDX_GLB_EM_PROFILE_ID_1 = 9,
+	BNXT_ULP_GLB_RF_IDX_GLB_WC_KEY_ID_0 = 10,
+	BNXT_ULP_GLB_RF_IDX_GLB_WC_KEY_ID_1 = 11,
+	BNXT_ULP_GLB_RF_IDX_GLB_EM_KEY_ID_0 = 12,
+	BNXT_ULP_GLB_RF_IDX_GLB_EM_KEY_ID_1 = 13,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_PROF_FUNC_ID_0 = 14,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_PROF_FUNC_ID_1 = 15,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_PROF_FUNC_ID_2 = 16,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_L2_CNTXT_ID_0 = 17,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_L2_CNTXT_ID_1 = 18,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_EM_PROFILE_ID_0 = 19,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_EM_PROFILE_ID_1 = 20,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_PROFILE_ID_0 = 21,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_PROFILE_ID_1 = 22,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_PROFILE_ID_2 = 23,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_EM_KEY_ID_0 = 24,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_EM_KEY_ID_1 = 25,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_KEY_ID_0 = 26,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_WC_KEY_ID_1 = 27,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_AREC_PTR_0 = 28,
+	BNXT_ULP_GLB_RF_IDX_APP_GLB_AREC_PTR_1 = 29,
+	BNXT_ULP_GLB_RF_IDX_LAST = 30
 };
 
 enum bnxt_ulp_hdr_type {
drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c +242 -36

509 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_thor_act.c +37 -11

112 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_thor_class.c +4087 -27165

2,270 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_wh_plus_act.c +78 -78

156 lines not on this page · raw message

drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_wh_plus_class.c +213 -245

458 lines not on this page · raw message

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

Signature · 1 line
2.21.1 (Apple Git-122.3)

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

#124 lore raw
In reply to Ajit Khaparde
Quoted 11 lines · Ajit Khaparde

This patchset adds flow table management support for Thor network adapter and introduces enhancements to the existing flow table management functionality.

v1->v2:
- Rebased against latest dpdk-next-net-brcm for-next-net branch.
- Fixed typo errors in some of the patches
- Address some issues encountered while applying patches
- Changed log levels for some log messages to debug
- Cleaned up some unused code

Patchset applied to the for-next-net branch of dpdk-next-net-brcm. Thanks

Quoted 262 lines

Farah Smith (11):
net/bnxt: add base TRUFLOW support for Thor net/bnxt: update TRUFLOW resources net/bnxt: add action SRAM translation net/bnxt: add 64B SRAM record management with RM net/bnxt: modify TRUFLOW HWRM messages net/bnxt: shared TCAM region support net/bnxt: cleanup logs in session handling paths net/bnxt: add WC TCAM management support net/bnxt: add API to get shared table increments net/bnxt: cleanup WC TCAM shared pool net/bnxt: add API to clear TCAM regions

Jay Ding (9):
net/bnxt: check resource reservation in TRUFLOW net/bnxt: support L2 Context TCAM ops net/bnxt: add Thor WC TCAM support net/bnxt: change RM database type net/bnxt: add shared session support net/bnxt: update shared session functionality net/bnxt: modify resource reservation strategy net/bnxt: refactor host session failure cleanup net/bnxt: add support for WC TCAM shared session

Jeffrey Huang (1):
net/bnxt: add CFA folder to HCAPI directory

Kishore Padmanabha (23):
net/bnxt: add support for generic table processing net/bnxt: add support for mapper flow database opcodes net/bnxt: modify TCAM opcode processing net/bnxt: modify table processing
net/bnxt: add ULP priority opcode processing net/bnxt: add support to identify duplicate flows net/bnxt: add conditional goto processing net/bnxt: set shared handle for generic table net/bnxt: modify ULP template
net/bnxt: add conditional opcode and L4 port fields net/bnxt: refactor TRUFLOW processing net/bnxt: add partial header field processing net/bnxt: add support for wild card pattern match net/bnxt: enable extended exact match support net/bnxt: refactor ULP mapper
net/bnxt: add support for generic hash table net/bnxt: add support for Thor platform net/bnxt: refactor flow parser in ULP net/bnxt: add field opcodes in ULP
net/bnxt: add support for application ID in ULP matcher net/bnxt: add templates for shared sessions net/bnxt: add ICMPv6 parser to ULP
net/bnxt: add context list for timers

Mike Baucom (5):
net/bnxt: add conditional processing of templates net/bnxt: add shared session support to ULP net/bnxt: process resource lists before session open net/bnxt: add HA support in ULP
net/bnxt: add Thor template support

Peter Spreadborough (4):
net/bnxt: add mailbox selection via dev op
net/bnxt: add support for EM with FKB
net/bnxt: add hashing changes for Thor
net/bnxt: add dpool allocator for EM allocation

Shahaji Bhosle (1):
net/bnxt: cleanup ULP parser and mapper

Venkat Duvvuru (4):
net/bnxt: check FW capability to support TRUFLOW net/bnxt: modify VXLAN decap for multichannel mode net/bnxt: add support for GRE flows net/bnxt: reorganize ULP template directory structure

 doc/guides/nics/bnxt.rst                      |     3 +-
 drivers/net/bnxt/bnxt.h                       |    19 +-
 drivers/net/bnxt/bnxt_ethdev.c                |   162 +-
 drivers/net/bnxt/bnxt_hwrm.c                  |     7 +-
 drivers/net/bnxt/bnxt_util.h                  |     3 +
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa.h        |   126 +
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_common.c |    83 +
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_defs.h   |   381 +
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p4.c     |   289 +
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p4.h     |   185 +
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p58.c    |   120 +
 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p58.h    |   142 +
 drivers/net/bnxt/hcapi/cfa/meson.build        |    12 +
 drivers/net/bnxt/hcapi/cfa_p40_hw.h           |   781 -
 drivers/net/bnxt/hcapi/cfa_p40_tbl.h          |   303 -
 drivers/net/bnxt/hcapi/hcapi_cfa.h            |   295 -
 drivers/net/bnxt/hcapi/hcapi_cfa_defs.h       |   672 -
 drivers/net/bnxt/hcapi/hcapi_cfa_p4.c         |   399 -
 drivers/net/bnxt/hcapi/hcapi_cfa_p4.h         |   467 -
 drivers/net/bnxt/hsi_struct_def_dpdk.h        |   250 +-
 drivers/net/bnxt/meson.build                  |    65 +-
 drivers/net/bnxt/tf_core/bitalloc.c           |    10 +-
 drivers/net/bnxt/tf_core/bitalloc.h           |     5 +-
 drivers/net/bnxt/tf_core/cfa_resource_types.h |     3 +-
 drivers/net/bnxt/tf_core/dpool.c              |   374 +
 drivers/net/bnxt/tf_core/dpool.h              |   309 +
 drivers/net/bnxt/tf_core/hwrm_tf.h            |   195 -
 drivers/net/bnxt/tf_core/lookup3.h            |     2 +-
 drivers/net/bnxt/tf_core/meson.build          |    36 +
 drivers/net/bnxt/tf_core/tf_core.c            |   326 +-
 drivers/net/bnxt/tf_core/tf_core.h            |   563 +-
 drivers/net/bnxt/tf_core/tf_device.c          |   530 +-
 drivers/net/bnxt/tf_core/tf_device.h          |   276 +-
 drivers/net/bnxt/tf_core/tf_device_p4.c       |   161 +-
 drivers/net/bnxt/tf_core/tf_device_p4.h       |   203 +-
 drivers/net/bnxt/tf_core/tf_device_p45.h      |   105 -
 drivers/net/bnxt/tf_core/tf_device_p58.c      |   372 +
 drivers/net/bnxt/tf_core/tf_device_p58.h      |   212 +
 drivers/net/bnxt/tf_core/tf_em.h              |    99 +-
 drivers/net/bnxt/tf_core/tf_em_common.c       |   332 +-
 drivers/net/bnxt/tf_core/tf_em_common.h       |    68 +-
 .../net/bnxt/tf_core/tf_em_hash_internal.c    |   215 +
 drivers/net/bnxt/tf_core/tf_em_host.c         |   115 +-
 drivers/net/bnxt/tf_core/tf_em_internal.c     |   376 +-
 drivers/net/bnxt/tf_core/tf_ext_flow_handle.h |    15 +-
 drivers/net/bnxt/tf_core/tf_identifier.c      |   174 +-
 drivers/net/bnxt/tf_core/tf_identifier.h      |    26 +
 drivers/net/bnxt/tf_core/tf_if_tbl.c          |    20 +-
 drivers/net/bnxt/tf_core/tf_msg.c             |  1219 +-
 drivers/net/bnxt/tf_core/tf_msg.h             |   217 +-
 drivers/net/bnxt/tf_core/tf_msg_common.h      |     3 -
 drivers/net/bnxt/tf_core/tf_rm.c              |   834 +-
 drivers/net/bnxt/tf_core/tf_rm.h              |   143 +-
 drivers/net/bnxt/tf_core/tf_session.c         |   261 +-
 drivers/net/bnxt/tf_core/tf_session.h         |   206 +-
 drivers/net/bnxt/tf_core/tf_shadow_tbl.c      |   785 -
 drivers/net/bnxt/tf_core/tf_shadow_tbl.h      |   256 -
 drivers/net/bnxt/tf_core/tf_shadow_tcam.c     |     6 +-
 drivers/net/bnxt/tf_core/tf_tbl.c             |   656 +-
 drivers/net/bnxt/tf_core/tf_tbl.h             |    57 +-
 drivers/net/bnxt/tf_core/tf_tcam.c            |   435 +-
 drivers/net/bnxt/tf_core/tf_tcam.h            |    30 +
 drivers/net/bnxt/tf_core/tf_tcam_shared.c     |  1283 +
 drivers/net/bnxt/tf_core/tf_tcam_shared.h     |   183 +
 drivers/net/bnxt/tf_core/tf_util.c            |    62 +-
 drivers/net/bnxt/tf_core/tf_util.h            |    31 +-
 drivers/net/bnxt/tf_core/tfp.c                |    44 +-
 drivers/net/bnxt/tf_core/tfp.h                |    61 +-
 drivers/net/bnxt/tf_ulp/bnxt_tf_common.h      |     2 -
 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c    |   378 +
 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.h    |    29 +
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |   943 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |    85 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c       |    74 +-
 .../bnxt/tf_ulp/generic_templates/meson.build |    13 +
 .../generic_templates/ulp_template_db_act.c   |  1017 +
 .../generic_templates/ulp_template_db_class.c | 13188 ++++++++++
 .../generic_templates/ulp_template_db_enum.h  |  1883 ++
 .../generic_templates/ulp_template_db_field.h |   686 +
 .../generic_templates/ulp_template_db_tbl.c   |  3335 +++
 .../generic_templates/ulp_template_db_tbl.h   |   112 +
 .../ulp_template_db_thor_act.c                |   225 +
 .../ulp_template_db_thor_class.c              |  6107 +++++
 .../ulp_template_db_wh_plus_act.c             |  4974 ++++
 .../ulp_template_db_wh_plus_class.c           | 14270 +++++++++++
 drivers/net/bnxt/tf_ulp/meson.build           |    28 +
 drivers/net/bnxt/tf_ulp/ulp_def_rules.c       |    91 +-
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c          |   171 +-
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h          |     1 +
 drivers/net/bnxt/tf_ulp/ulp_flow_db.c         |   129 +-
 drivers/net/bnxt/tf_ulp/ulp_flow_db.h         |    20 +-
 drivers/net/bnxt/tf_ulp/ulp_gen_hash.c        |   369 +
 drivers/net/bnxt/tf_ulp/ulp_gen_hash.h        |   166 +
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c         |   417 +
 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h         |   171 +
 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c          |   637 +
 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.h          |    67 +
 drivers/net/bnxt/tf_ulp/ulp_mapper.c          |  3572 ++-
 drivers/net/bnxt/tf_ulp/ulp_mapper.h          |    59 +-
 drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c        |    10 +-
 drivers/net/bnxt/tf_ulp/ulp_matcher.c         |    36 +-
 drivers/net/bnxt/tf_ulp/ulp_port_db.c         |   140 +-
 drivers/net/bnxt/tf_ulp/ulp_port_db.h         |    42 +
 ...emplate_db_tbl.c => ulp_rte_handler_tbl.c} |   269 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c      |  1207 +-
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.h      |    36 +-
 drivers/net/bnxt/tf_ulp/ulp_template_db.c     |  4622 ----
 drivers/net/bnxt/tf_ulp/ulp_template_db.h     |   614 -
 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c |   815 -
 .../net/bnxt/tf_ulp/ulp_template_db_class.c   |  3985 ---
 .../net/bnxt/tf_ulp/ulp_template_db_enum.h    |   973 -
 .../net/bnxt/tf_ulp/ulp_template_db_field.h   |  1191 -
 .../tf_ulp/ulp_template_db_stingray_act.c     |  3305 ---
 .../tf_ulp/ulp_template_db_stingray_class.c   | 20566 ----------------
 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h |    48 -
 .../bnxt/tf_ulp/ulp_template_db_wh_plus_act.c |  3304 ---
 .../tf_ulp/ulp_template_db_wh_plus_class.c    | 20566 ----------------
 .../net/bnxt/tf_ulp/ulp_template_field_db.h   |   224 -
 drivers/net/bnxt/tf_ulp/ulp_template_struct.h |   192 +-
 drivers/net/bnxt/tf_ulp/ulp_tun.c             |   192 +-
 drivers/net/bnxt/tf_ulp/ulp_tun.h             |    33 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.c           |   339 +-
 drivers/net/bnxt/tf_ulp/ulp_utils.h           |   153 +-
 123 files changed, 63931 insertions(+), 68808 deletions(-)
 create mode 100644 drivers/net/bnxt/hcapi/cfa/hcapi_cfa.h
 create mode 100644 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_common.c
 create mode 100644 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_defs.h
 create mode 100644 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p4.c
 create mode 100644 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p4.h
 create mode 100644 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p58.c
 create mode 100644 drivers/net/bnxt/hcapi/cfa/hcapi_cfa_p58.h
 create mode 100644 drivers/net/bnxt/hcapi/cfa/meson.build
 delete mode 100644 drivers/net/bnxt/hcapi/cfa_p40_hw.h
 delete mode 100644 drivers/net/bnxt/hcapi/cfa_p40_tbl.h
 delete mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa.h
 delete mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_defs.h
 delete mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_p4.c
 delete mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_p4.h
 create mode 100644 drivers/net/bnxt/tf_core/dpool.c
 create mode 100644 drivers/net/bnxt/tf_core/dpool.h
 delete mode 100644 drivers/net/bnxt/tf_core/hwrm_tf.h
 create mode 100644 drivers/net/bnxt/tf_core/meson.build
 delete mode 100644 drivers/net/bnxt/tf_core/tf_device_p45.h
 create mode 100644 drivers/net/bnxt/tf_core/tf_device_p58.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_device_p58.h
 create mode 100644 drivers/net/bnxt/tf_core/tf_em_hash_internal.c
 delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tbl.c
 delete mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tbl.h
 create mode 100644 drivers/net/bnxt/tf_core/tf_tcam_shared.c
 create mode 100644 drivers/net/bnxt/tf_core/tf_tcam_shared.h
 create mode 100644 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c
 create mode 100644 drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.h
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/meson.build
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_act.c
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_class.c
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_enum.h
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_field.h
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.c
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_tbl.h
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_thor_act.c
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_thor_class.c
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_wh_plus_act.c
 create mode 100644 drivers/net/bnxt/tf_ulp/generic_templates/ulp_template_db_wh_plus_class.c
 create mode 100644 drivers/net/bnxt/tf_ulp/meson.build
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_gen_hash.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_gen_hash.h
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_gen_tbl.h
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c
 create mode 100644 drivers/net/bnxt/tf_ulp/ulp_ha_mgr.h
 rename drivers/net/bnxt/tf_ulp/{ulp_template_db_tbl.c => ulp_rte_handler_tbl.c} (60%)
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db.c
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db.h
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_act.c
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_class.c
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_field.h
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_act.c
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_stingray_class.c
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.h
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_act.c
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_db_wh_plus_class.c
 delete mode 100644 drivers/net/bnxt/tf_ulp/ulp_template_field_db.h

--
2.21.1 (Apple Git-122.3)

#125 lore raw

15/06/2021 21:33, Ajit Khaparde:

Quoted 14 lines
Quoted 11 lines · Ajit Khaparde

This patchset adds flow table management support for Thor network adapter and introduces enhancements to the existing flow table management functionality.

v1->v2:
- Rebased against latest dpdk-next-net-brcm for-next-net branch.
- Fixed typo errors in some of the patches
- Address some issues encountered while applying patches
- Changed log levels for some log messages to debug
- Cleaned up some unused code

Quoted 2 lines

Patchset applied to the for-next-net branch of dpdk-next-net-brcm. Thanks

These 3 tools are returning errors:

devtools/check-meson.py
devtools/check-spdx-tag.sh
devtools/check-doc-vs-code.sh

1/ The meson files have a new indent policy.
2/ The SPDX tag is missing in some hcapi_cfa files.
3/ devtools/parse-flow-support.sh must be updated with new bnxt path

Please fix in dpdk-next-net-brcm.

#126 lore raw
Quoted 24 lines · Thomas Monjalon

15/06/2021 21:33, Ajit Khaparde:

Quoted 14 lines
Quoted 11 lines · Ajit Khaparde

This patchset adds flow table management support for Thor network adapter and introduces enhancements to the existing flow table management functionality.

v1->v2:
- Rebased against latest dpdk-next-net-brcm for-next-net branch.
- Fixed typo errors in some of the patches
- Address some issues encountered while applying patches
- Changed log levels for some log messages to debug
- Cleaned up some unused code

Quoted 2 lines

Patchset applied to the for-next-net branch of dpdk-next-net-brcm. Thanks

These 3 tools are returning errors:

devtools/check-meson.py
devtools/check-spdx-tag.sh
devtools/check-doc-vs-code.sh

Quoted 6 lines

1/ The meson files have a new indent policy.
2/ The SPDX tag is missing in some hcapi_cfa files.
3/ devtools/parse-flow-support.sh must be updated with new bnxt path

Please fix in dpdk-next-net-brcm.

Done and changes pushed to the for-next-net branch of dpdk-next-net-brcm.

Thanks
-Ajit

#127 lore raw

08/07/2021 05:57, Ajit Khaparde:

Quoted 25 lines · Thomas Monjalon
Quoted 24 lines

15/06/2021 21:33, Ajit Khaparde:

Quoted 14 lines
Quoted 11 lines · Ajit Khaparde

This patchset adds flow table management support for Thor network adapter and introduces enhancements to the existing flow table management functionality.

v1->v2:
- Rebased against latest dpdk-next-net-brcm for-next-net branch.
- Fixed typo errors in some of the patches
- Address some issues encountered while applying patches
- Changed log levels for some log messages to debug
- Cleaned up some unused code

Quoted 2 lines

Patchset applied to the for-next-net branch of dpdk-next-net-brcm. Thanks

These 3 tools are returning errors:

devtools/check-meson.py
devtools/check-spdx-tag.sh
devtools/check-doc-vs-code.sh

Quoted 7 lines
Quoted 6 lines

1/ The meson files have a new indent policy.
2/ The SPDX tag is missing in some hcapi_cfa files.
3/ devtools/parse-flow-support.sh must be updated with new bnxt path

Please fix in dpdk-next-net-brcm.

Done and changes pushed to the for-next-net branch of dpdk-next-net-brcm.

There is still an issue with the third tool mentionned above:

devtools/check-doc-vs-code.sh
rte_flow doc out of sync for bnxt
item any
item gre
item icmp
item icmp6
action dec_ttl
action jump
action of_pop_vlan
action of_push_vlan
action of_set_vlan_pcp
action of_set_vlan_vid
action sample
action set_ipv4_dst
action set_ipv4_src
action set_tp_dst
action set_tp_src

The file doc/guides/nics/features/bnxt.ini must be updated in each patch adding a new support of an item or an action.

I fixed all by making sure the below command passing:
git rebase -i --exec devtools/check-doc-vs-code.sh origin/main

#128 lore raw
Quoted 56 lines · Thomas Monjalon

08/07/2021 05:57, Ajit Khaparde:

Quoted 1 line

On Wed, Jul 7, 2021 at 1:43 AM Thomas Monjalon <[email protected]>

Quoted 24 lines · wrote:
Quoted 24 lines

15/06/2021 21:33, Ajit Khaparde:

Quoted 14 lines
Quoted 11 lines · Ajit Khaparde

This patchset adds flow table management support for Thor network adapter and introduces enhancements to the existing flow table management functionality.

v1->v2:
- Rebased against latest dpdk-next-net-brcm for-next-net branch.
- Fixed typo errors in some of the patches
- Address some issues encountered while applying patches
- Changed log levels for some log messages to debug
- Cleaned up some unused code

Quoted 2 lines

Patchset applied to the for-next-net branch of dpdk-next-net-brcm. Thanks

These 3 tools are returning errors:

devtools/check-meson.py
devtools/check-spdx-tag.sh
devtools/check-doc-vs-code.sh

Quoted 7 lines
Quoted 6 lines

1/ The meson files have a new indent policy.
2/ The SPDX tag is missing in some hcapi_cfa files.
3/ devtools/parse-flow-support.sh must be updated with new bnxt path

Please fix in dpdk-next-net-brcm.

Done and changes pushed to the for-next-net branch of

dpdk-next-net-brcm.

There is still an issue with the third tool mentionned above:

devtools/check-doc-vs-code.sh
rte_flow doc out of sync for bnxt
item any
item gre
item icmp
item icmp6
action dec_ttl
action jump
action of_pop_vlan
action of_push_vlan
action of_set_vlan_pcp
action of_set_vlan_vid
action sample
action set_ipv4_dst
action set_ipv4_src
action set_tp_dst
action set_tp_src

Quoted 6 lines

The file doc/guides/nics/features/bnxt.ini must be updated in each patch adding a new support of an item or an action.

I fixed all by making sure the below command passing:
git rebase -i --exec devtools/check-doc-vs-code.sh origin/main

Thanks. Let me know if you want me to fix anything else for the merge.