From: Kishore Padmanabha Date: Mon, 6 Jul 2020 08:24:47 +0000 (+0530) Subject: net/bnxt: support index opcode constant X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e2b58f373db58b171be4d4bc52eaaea379b29289;p=dpdk.git net/bnxt: support index opcode constant Add support for index opcode constant so that parif configuration could be constant value. 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_def_rules.c b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c index 46b558f310..b01ad0b68c 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_def_rules.c +++ b/drivers/net/bnxt/tf_ulp/ulp_def_rules.c @@ -12,6 +12,8 @@ #include "ulp_flow_db.h" #include "ulp_mapper.h" +#define BNXT_ULP_FREE_PARIF_BASE 11 + struct bnxt_ulp_def_param_handler { int32_t (*vfr_func)(struct bnxt_ulp_context *ulp_ctx, struct ulp_tlv_param *param, @@ -81,12 +83,15 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx, 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; - 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; - else + /* Parif needs to be reset to a free partition */ + parif += BNXT_ULP_FREE_PARIF_BASE; + } else { idx = BNXT_ULP_CF_IDX_VF_FUNC_PARIF; + } ULP_COMP_FLD_IDX_WR(mapper_params, idx, parif); diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index c96381bd1e..733766ce1e 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -1922,11 +1922,14 @@ ulp_mapper_if_tbl_process(struct bnxt_ulp_mapper_parms *parms, } /* Get the index details from computed field */ - if (tbl->index_opcode != BNXT_ULP_INDEX_OPCODE_COMP_FIELD) { + if (tbl->index_opcode == BNXT_ULP_INDEX_OPCODE_COMP_FIELD) { + idx = ULP_COMP_FLD_IDX_RD(parms, tbl->index_operand); + } else if (tbl->index_opcode == BNXT_ULP_INDEX_OPCODE_CONSTANT) { + idx = tbl->index_operand; + } else { BNXT_TF_DBG(ERR, "Invalid tbl index opcode\n"); return -EINVAL; } - idx = ULP_COMP_FLD_IDX_RD(parms, tbl->index_operand); /* Perform the tf table set by filling the set params */ iftbl_params.dir = tbl->direction; 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 6d6a734e79..892d8eaee3 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h @@ -188,7 +188,8 @@ enum bnxt_ulp_index_opcode { BNXT_ULP_INDEX_OPCODE_ALLOCATE = 1, BNXT_ULP_INDEX_OPCODE_GLOBAL = 2, BNXT_ULP_INDEX_OPCODE_COMP_FIELD = 3, - BNXT_ULP_INDEX_OPCODE_LAST = 4 + BNXT_ULP_INDEX_OPCODE_CONSTANT = 4, + BNXT_ULP_INDEX_OPCODE_LAST = 5 }; enum bnxt_ulp_mapper_opc { @@ -511,6 +512,7 @@ enum bnxt_ulp_sym { BNXT_ULP_SYM_IP_PROTO_IP_IN_IP = 4, BNXT_ULP_SYM_IP_PROTO_TCP = 6, BNXT_ULP_SYM_IP_PROTO_UDP = 17, + BNXT_ULP_SYM_VF_FUNC_PARIF = 15, BNXT_ULP_SYM_NO = 0, BNXT_ULP_SYM_YES = 1 };