if (rc)
return rc;
- if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
+ if (parif_type == BNXT_ULP_PHY_PORT_PARIF)
idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF;
- /* Parif needs to be reset to a free partition */
- parif += BNXT_ULP_FREE_PARIF_BASE;
- } else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) {
+ else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF)
idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF;
- /* Parif needs to be reset to a free partition */
- parif += BNXT_ULP_FREE_PARIF_BASE;
- } else {
+ else
idx = BNXT_ULP_CF_IDX_VF_FUNC_PARIF;
- }
ULP_COMP_FLD_IDX_WR(mapper_params, idx, parif);
return -EINVAL;
}
break;
+ case BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF:
+ if (!ulp_operand_read(fld->result_operand,
+ (uint8_t *)&idx,
+ sizeof(uint16_t))) {
+ BNXT_TF_DBG(ERR, "%s key operand read failed.\n", name);
+ return -EINVAL;
+ }
+ idx = tfp_be_to_cpu_16(idx);
+ if (idx >= BNXT_ULP_CF_IDX_LAST) {
+ BNXT_TF_DBG(ERR, "%s invalid index %u\n", name, idx);
+ return -EINVAL;
+ }
+ /* check if the computed field is set */
+ if (ULP_COMP_FLD_IDX_RD(parms, idx))
+ val = fld->result_operand_true;
+ else
+ val = fld->result_operand_false;
+
+ /* read the appropriate computed field */
+ if (!ulp_operand_read(val, (uint8_t *)&idx, sizeof(uint16_t))) {
+ BNXT_TF_DBG(ERR, "%s val operand read failed\n", name);
+ return -EINVAL;
+ }
+ idx = tfp_be_to_cpu_16(idx);
+ if (idx >= BNXT_ULP_CF_IDX_LAST) {
+ BNXT_TF_DBG(ERR, "%s invalid index %u\n", name, idx);
+ return -EINVAL;
+ }
+ val = ulp_blob_push_32(blob, &parms->comp_fld[idx],
+ fld->field_bit_size);
+ if (!val) {
+ BNXT_TF_DBG(ERR, "%s push to key blob failed\n", name);
+ return -EINVAL;
+ }
+ break;
default:
BNXT_TF_DBG(ERR, "invalid result mapper opcode 0x%x\n",
fld->result_opcode);
phy_port_id = port_db->ulp_func_id_tbl[func_id].phy_port_id;
*parif = port_db->phy_port_list[phy_port_id].port_parif;
}
+ /* Parif needs to be reset to a free partition */
+ *parif += BNXT_ULP_FREE_PARIF_BASE;
return 0;
}
{
uint32_t ifindex;
uint16_t port_id, parif;
+ uint32_t mtype;
enum bnxt_ulp_direction_type dir;
/* get the direction details */
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);
+ if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx,
+ port_id,
+ &ifindex)) {
+ BNXT_TF_DBG(ERR, "ParseErr:Portid is not valid\n");
+ return;
+ }
+
if (dir == BNXT_ULP_DIR_INGRESS) {
- /* read the port id details */
- port_id = ULP_COMP_FLD_IDX_RD(params,
- BNXT_ULP_CF_IDX_INCOMING_IF);
- if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx,
- port_id,
- &ifindex)) {
- BNXT_TF_DBG(ERR, "ParseErr:Portid is not valid\n");
- return;
- }
/* Set port PARIF */
if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
BNXT_ULP_PHY_PORT_PARIF, &parif)) {
BNXT_TF_DBG(ERR, "ParseErr:ifindex is not valid\n");
return;
}
- /* Parif needs to be reset to a free partition */
- parif += BNXT_ULP_FREE_PARIF_BASE;
ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_PHY_PORT_PARIF,
parif);
+ } else {
+ /* Get the match port type */
+ mtype = ULP_COMP_FLD_IDX_RD(params,
+ BNXT_ULP_CF_IDX_MATCH_PORT_TYPE);
+ if (mtype == BNXT_ULP_INTF_TYPE_VF_REP) {
+ ULP_COMP_FLD_IDX_WR(params,
+ BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP,
+ 1);
+ /* Set VF func PARIF */
+ if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
+ BNXT_ULP_VF_FUNC_PARIF,
+ &parif)) {
+ BNXT_TF_DBG(ERR,
+ "ParseErr:ifindex is not valid\n");
+ return;
+ }
+ ULP_COMP_FLD_IDX_WR(params,
+ BNXT_ULP_CF_IDX_VF_FUNC_PARIF,
+ parif);
+ } else {
+ /* Set DRV func PARIF */
+ if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
+ BNXT_ULP_DRV_FUNC_PARIF,
+ &parif)) {
+ BNXT_TF_DBG(ERR,
+ "ParseErr:ifindex is not valid\n");
+ return;
+ }
+ ULP_COMP_FLD_IDX_WR(params,
+ BNXT_ULP_CF_IDX_DRV_FUNC_PARIF,
+ parif);
+ }
}
}
},
{
.field_bit_size = 4,
- .result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+ .result_opcode = BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_CONST_ELSE_CONST,
.result_operand = {
- BNXT_ULP_SYM_DECAP_FUNC_THRU_TUN,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+ ((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 56) & 0xff,
+ ((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 48) & 0xff,
+ ((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 40) & 0xff,
+ ((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 32) & 0xff,
+ ((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 24) & 0xff,
+ ((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 16) & 0xff,
+ ((uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP >> 8) & 0xff,
+ (uint64_t)BNXT_ULP_ACTION_BIT_VXLAN_DECAP & 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ .result_operand_true = {0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
},
{
.field_bit_size = 12,
},
{
.field_bit_size = 2,
- .mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
+ .mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+ .mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
.spec_operand = {0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
},
{
.field_bit_size = 2,
- .mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_ZERO,
+ .mask_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+ .mask_operand = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
.spec_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
.spec_operand = {0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
},
{
.field_bit_size = 4,
- .result_opcode = BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT,
+ .result_opcode = BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF,
.result_operand = {
- BNXT_ULP_SYM_VF_FUNC_PARIF,
+ (BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP >> 8) & 0xff,
+ BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP & 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ .result_operand_true = {
+ (BNXT_ULP_CF_IDX_VF_FUNC_PARIF >> 8) & 0xff,
+ BNXT_ULP_CF_IDX_VF_FUNC_PARIF & 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ .result_operand_false = {
+ (BNXT_ULP_CF_IDX_DRV_FUNC_PARIF >> 8) & 0xff,
+ BNXT_ULP_CF_IDX_DRV_FUNC_PARIF & 0xff,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
},
{
.field_bit_size = 8,
BNXT_ULP_CF_IDX_ACT_PORT_IS_SET = 35,
BNXT_ULP_CF_IDX_ACT_PORT_TYPE = 36,
BNXT_ULP_CF_IDX_MATCH_PORT_TYPE = 37,
- BNXT_ULP_CF_IDX_VF_TO_VF = 38,
- BNXT_ULP_CF_IDX_L3_HDR_CNT = 39,
- BNXT_ULP_CF_IDX_L4_HDR_CNT = 40,
- BNXT_ULP_CF_IDX_VFR_MODE = 41,
- BNXT_ULP_CF_IDX_LAST = 42
+ BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP = 38,
+ BNXT_ULP_CF_IDX_VF_TO_VF = 39,
+ BNXT_ULP_CF_IDX_L3_HDR_CNT = 40,
+ BNXT_ULP_CF_IDX_L4_HDR_CNT = 41,
+ BNXT_ULP_CF_IDX_VFR_MODE = 42,
+ BNXT_ULP_CF_IDX_LAST = 43
};
enum bnxt_ulp_cond_opcode {
BNXT_ULP_MAPPER_OPC_SET_TO_ENCAP_ACT_PROP_SZ = 8,
BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_ACT_PROP_ELSE_CONST = 9,
BNXT_ULP_MAPPER_OPC_IF_ACT_BIT_THEN_CONST_ELSE_CONST = 10,
- BNXT_ULP_MAPPER_OPC_LAST = 11
+ BNXT_ULP_MAPPER_OPC_IF_COMP_FIELD_THEN_CF_ELSE_CF = 11,
+ BNXT_ULP_MAPPER_OPC_LAST = 12
};
enum bnxt_ulp_mark_db_opcode {