net/bnxt: support decrement TTL action

Added support for decrement TTL action.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
Kishore Padmanabha 2020-07-15 19:20:38 +05:30 committed by Ferruh Yigit
parent c8636edd15
commit 6af7e459ba
3 changed files with 37 additions and 2 deletions

View File

@ -189,6 +189,26 @@ bnxt_ulp_rte_parser_post_process(struct ulp_rte_parser_params *params)
match_port_type == BNXT_ULP_INTF_TYPE_VF_REP)
ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_VF_TO_VF, 1);
/* Update the decrement ttl computational fields */
if (ULP_BITMAP_ISSET(params->act_bitmap.bits,
BNXT_ULP_ACTION_BIT_DEC_TTL)) {
/*
* Check that vxlan proto is included and vxlan decap
* action is not set then decrement tunnel ttl.
* Similarly add GRE and NVGRE in future.
*/
if ((ULP_BITMAP_ISSET(params->hdr_bitmap.bits,
BNXT_ULP_HDR_BIT_T_VXLAN) &&
!ULP_BITMAP_ISSET(params->act_bitmap.bits,
BNXT_ULP_ACTION_BIT_VXLAN_DECAP))) {
ULP_COMP_FLD_IDX_WR(params,
BNXT_ULP_CF_IDX_ACT_T_DEC_TTL, 1);
} else {
ULP_COMP_FLD_IDX_WR(params,
BNXT_ULP_CF_IDX_ACT_DEC_TTL, 1);
}
}
/* TBD: Handle the flow rejection scenarios */
return 0;
}
@ -1814,3 +1834,13 @@ ulp_rte_set_tp_dst_act_handler(const struct rte_flow_action *action_item,
BNXT_TF_DBG(ERR, "Parse Error: set tp src arg is invalid\n");
return BNXT_TF_RC_ERROR;
}
/* Function to handle the parsing of RTE Flow action dec ttl.*/
int32_t
ulp_rte_dec_ttl_act_handler(const struct rte_flow_action *act __rte_unused,
struct ulp_rte_parser_params *params)
{
/* Update the act_bitmap with dec ttl */
ULP_BITMAP_SET(params->act_bitmap.bits, BNXT_ULP_ACTION_BIT_DEC_TTL);
return BNXT_TF_RC_SUCCESS;
}

View File

@ -216,4 +216,9 @@ int32_t
ulp_rte_set_tp_dst_act_handler(const struct rte_flow_action *action_item,
struct ulp_rte_parser_params *params);
/* Function to handle the parsing of RTE Flow action dec ttl.*/
int32_t
ulp_rte_dec_ttl_act_handler(const struct rte_flow_action *action_item,
struct ulp_rte_parser_params *params);
#endif /* _ULP_RTE_PARSER_H_ */

View File

@ -259,8 +259,8 @@ struct bnxt_ulp_rte_act_info ulp_act_info[] = {
.proto_act_func = NULL
},
[RTE_FLOW_ACTION_TYPE_DEC_TTL] = {
.act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
.proto_act_func = NULL
.act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
.proto_act_func = ulp_rte_dec_ttl_act_handler
},
[RTE_FLOW_ACTION_TYPE_SET_TTL] = {
.act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,