net/bnxt: support negative conditional opcodes
Added support for negative conditional opcodes in the mapper processing. Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com> Reviewed-by: Mike Baucom <michael.baucom@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
parent
22edb82ac7
commit
333fd64404
@ -2006,21 +2006,36 @@ ulp_mapper_tbl_cond_opcode_process(struct bnxt_ulp_mapper_parms *parms,
|
||||
case BNXT_ULP_COND_OPCODE_NOP:
|
||||
rc = 0;
|
||||
break;
|
||||
case BNXT_ULP_COND_OPCODE_COMP_FIELD:
|
||||
case BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET:
|
||||
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:
|
||||
case BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET:
|
||||
if (ULP_BITMAP_ISSET(parms->act_bitmap->bits,
|
||||
tbl->cond_operand))
|
||||
rc = 0;
|
||||
break;
|
||||
case BNXT_ULP_COND_OPCODE_HDR_BIT:
|
||||
case BNXT_ULP_COND_OPCODE_HDR_BIT_IS_SET:
|
||||
if (ULP_BITMAP_ISSET(parms->hdr_bitmap->bits,
|
||||
tbl->cond_operand))
|
||||
rc = 0;
|
||||
break;
|
||||
case BNXT_ULP_COND_OPCODE_COMP_FIELD_NOT_SET:
|
||||
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_NOT_SET:
|
||||
if (!ULP_BITMAP_ISSET(parms->act_bitmap->bits,
|
||||
tbl->cond_operand))
|
||||
rc = 0;
|
||||
break;
|
||||
case BNXT_ULP_COND_OPCODE_HDR_BIT_NOT_SET:
|
||||
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");
|
||||
|
@ -284,7 +284,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
|
||||
.resource_type = TF_TBL_TYPE_ACT_STATS_64,
|
||||
.resource_sub_type =
|
||||
BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT,
|
||||
.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT,
|
||||
.cond_opcode = BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET,
|
||||
.cond_operand = BNXT_ULP_ACTION_BIT_COUNT,
|
||||
.direction = TF_DIR_RX,
|
||||
.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
|
||||
@ -331,7 +331,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
|
||||
.resource_type = TF_TBL_TYPE_ACT_SP_SMAC_IPV4,
|
||||
.resource_sub_type =
|
||||
BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
|
||||
.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD,
|
||||
.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET,
|
||||
.cond_operand = BNXT_ULP_CF_IDX_ACT_ENCAP_IPV4_FLAG,
|
||||
.direction = TF_DIR_TX,
|
||||
.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
|
||||
@ -348,7 +348,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = {
|
||||
.resource_type = TF_TBL_TYPE_ACT_SP_SMAC_IPV4,
|
||||
.resource_sub_type =
|
||||
BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_NORMAL,
|
||||
.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD,
|
||||
.cond_opcode = BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET,
|
||||
.cond_operand = BNXT_ULP_CF_IDX_ACT_ENCAP_IPV6_FLAG,
|
||||
.direction = TF_DIR_TX,
|
||||
.srch_b4_alloc = BNXT_ULP_SEARCH_BEFORE_ALLOC_NO,
|
||||
|
@ -127,10 +127,13 @@ enum bnxt_ulp_cf_idx {
|
||||
|
||||
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
|
||||
BNXT_ULP_COND_OPCODE_COMP_FIELD_IS_SET = 1,
|
||||
BNXT_ULP_COND_OPCODE_ACTION_BIT_IS_SET = 2,
|
||||
BNXT_ULP_COND_OPCODE_HDR_BIT_IS_SET = 3,
|
||||
BNXT_ULP_COND_OPCODE_COMP_FIELD_NOT_SET = 4,
|
||||
BNXT_ULP_COND_OPCODE_ACTION_BIT_NOT_SET = 5,
|
||||
BNXT_ULP_COND_OPCODE_HDR_BIT_NOT_SET = 6,
|
||||
BNXT_ULP_COND_OPCODE_LAST = 7
|
||||
};
|
||||
|
||||
enum bnxt_ulp_critical_resource {
|
||||
|
Loading…
Reference in New Issue
Block a user