From: Kishore Padmanabha Date: Mon, 6 Jul 2020 08:24:45 +0000 (+0530) Subject: net/bnxt: support negative conditional opcodes X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=333fd644048d1587262fc9c8f1bf555dda581eb7;p=dpdk.git net/bnxt: support negative conditional opcodes Added support for negative conditional opcodes in the mapper processing. Signed-off-by: Kishore Padmanabha Signed-off-by: Somnath Kotur Signed-off-by: Venkat Duvvuru Reviewed-by: Mike Baucom Reviewed-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index df3dea81f3..c96381bd1e 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -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"); diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_act.c b/drivers/net/bnxt/tf_ulp/ulp_template_db_act.c index 3d65073993..c587ff5c88 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_act.c @@ -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, diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h index e13d20b4bb..6d6a734e79 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h @@ -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 {