return rc;
}
+/*
+ * Function to process the conditional opcode of the mapper table.
+ * returns 1 to skip the table.
+ * return 0 to continue processing the table.
+ */
+static int32_t
+ulp_mapper_tbl_cond_opcode_process(struct bnxt_ulp_mapper_parms *parms,
+ struct bnxt_ulp_mapper_tbl_info *tbl)
+{
+ int32_t rc = 1;
+
+ switch (tbl->cond_opcode) {
+ case BNXT_ULP_COND_OPCODE_NOP:
+ rc = 0;
+ break;
+ case BNXT_ULP_COND_OPCODE_COMP_FIELD:
+ if (tbl->cond_operand < BNXT_ULP_CF_IDX_LAST &&
+ ULP_COMP_FLD_IDX_RD(parms, tbl->cond_operand))
+ rc = 0;
+ break;
+ case BNXT_ULP_COND_OPCODE_ACTION_BIT:
+ if (ULP_BITMAP_ISSET(parms->act_bitmap->bits,
+ tbl->cond_operand))
+ rc = 0;
+ break;
+ case BNXT_ULP_COND_OPCODE_HDR_BIT:
+ if (ULP_BITMAP_ISSET(parms->hdr_bitmap->bits,
+ tbl->cond_operand))
+ rc = 0;
+ break;
+ default:
+ BNXT_TF_DBG(ERR,
+ "Invalid arg in mapper tbl for cond opcode\n");
+ break;
+ }
+ return rc;
+}
+
/*
* Function to process the action template. Iterate through the list
* action info templates and process it.
for (i = 0; i < parms->num_atbls; i++) {
tbl = &parms->atbls[i];
+ if (ulp_mapper_tbl_cond_opcode_process(parms, tbl))
+ continue;
+
switch (tbl->resource_func) {
case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE:
rc = ulp_mapper_index_tbl_process(parms, tbl, false);
for (i = 0; i < parms->num_ctbls; i++) {
struct bnxt_ulp_mapper_tbl_info *tbl = &parms->ctbls[i];
+ if (ulp_mapper_tbl_cond_opcode_process(parms, tbl))
+ continue;
+
switch (tbl->resource_func) {
case BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE:
rc = ulp_mapper_tcam_tbl_process(parms, tbl);
memset(&parms, 0, sizeof(parms));
parms.act_prop = cparms->act_prop;
parms.act_bitmap = cparms->act;
+ parms.hdr_bitmap = cparms->hdr_bitmap;
parms.regfile = ®file;
parms.hdr_field = cparms->hdr_field;
parms.comp_fld = cparms->comp_fld;
memcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_L3_TYPE],
&ip_type, sizeof(uint32_t));
+ /* update the computed field to notify it is ipv4 header */
+ ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_ENCAP_IPV4_FLAG,
+ 1);
+
if (!ulp_rte_item_skip_void(&item, 1))
return BNXT_TF_RC_ERROR;
} else if (item->type == RTE_FLOW_ITEM_TYPE_IPV6) {
memcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_L3_TYPE],
&ip_type, sizeof(uint32_t));
+ /* update the computed field to notify it is ipv6 header */
+ ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_ENCAP_IPV6_FLAG,
+ 1);
+
if (!ulp_rte_item_skip_void(&item, 1))
return BNXT_TF_RC_ERROR;
} else {
BNXT_ULP_CF_IDX_PHY_PORT_SPIF = 26,
BNXT_ULP_CF_IDX_PHY_PORT_PARIF = 27,
BNXT_ULP_CF_IDX_PHY_PORT_VPORT = 28,
- BNXT_ULP_CF_IDX_LAST = 29
+ BNXT_ULP_CF_IDX_ACT_ENCAP_IPV4_FLAG = 29,
+ BNXT_ULP_CF_IDX_ACT_ENCAP_IPV6_FLAG = 30,
+ BNXT_ULP_CF_IDX_LAST = 31
+};
+
+enum bnxt_ulp_cond_opcode {
+ BNXT_ULP_COND_OPCODE_NOP = 0,
+ BNXT_ULP_COND_OPCODE_COMP_FIELD = 1,
+ BNXT_ULP_COND_OPCODE_ACTION_BIT = 2,
+ BNXT_ULP_COND_OPCODE_HDR_BIT = 3,
+ BNXT_ULP_COND_OPCODE_LAST = 4
};
enum bnxt_ulp_critical_resource {