src/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
int32_t
ulp_rte_of_push_vlan_act_handler(const struct rte_flow_action *action_item,
				 struct ulp_rte_parser_params *params)
{
	const struct rte_flow_action_of_push_vlan *push_vlan;
	uint16_t ethertype;
	struct ulp_rte_act_prop *act = &params->act_prop;

	push_vlan = action_item->conf;
	if (push_vlan) {
		ethertype = push_vlan->ethertype;
		if (tfp_cpu_to_be_16(ethertype) != RTE_ETHER_TYPE_VLAN) {
			BNXT_TF_DBG(ERR,
				    "Parse Err: Ethertype not supported\n");
			return BNXT_TF_RC_PARSE_ERR;
		}
		memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_PUSH_VLAN],
		       &ethertype, BNXT_ULP_ACT_PROP_SZ_PUSH_VLAN);
		/* Update the hdr_bitmap with push vlan */
		ULP_BITMAP_SET(params->act_bitmap.bits,
			       BNXT_ULP_ACTION_BIT_PUSH_VLAN);
		return BNXT_TF_RC_SUCCESS;
	}
	BNXT_TF_DBG(ERR, "Parse Error: Push vlan arg is invalid\n");
	return BNXT_TF_RC_ERROR;
}
/* Function to handle the parsing of RTE Flow action push vlan. */
Function to handle the parsing of RTE Flow action push vlan.
Function to handle the parsing of RTE Flow action push vlan .
int32_t
ulp_rte_of_push_vlan_act_handler(const struct rte_flow_action *action_item,
				 struct ulp_rte_parser_params *params)
{
	const struct rte_flow_action_of_push_vlan *push_vlan;
	uint16_t ethertype;
	struct ulp_rte_act_prop *act = &params->act_prop;
	push_vlan = action_item->conf;
	if (push_vlan) {
		ethertype = push_vlan->ethertype;
		if (tfp_cpu_to_be_16(ethertype) != RTE_ETHER_TYPE_VLAN) {
			BNXT_TF_DBG(ERR,
				    "Parse Err: Ethertype not supported\n");
			return BNXT_TF_RC_PARSE_ERR;
		}
		memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_PUSH_VLAN],
		       &ethertype, BNXT_ULP_ACT_PROP_SZ_PUSH_VLAN);
		ULP_BITMAP_SET(params->act_bitmap.bits,
			       BNXT_ULP_ACTION_BIT_PUSH_VLAN);
		return BNXT_TF_RC_SUCCESS;
	}
	BNXT_TF_DBG(ERR, "Parse Error: Push vlan arg is invalid\n");
	return BNXT_TF_RC_ERROR;
}
int32_t ulp_rte_of_push_vlan_act_handler ( const struct rte_flow_action * action_item , struct ulp_rte_parser_params * params ) { const struct rte_flow_action_of_push_vlan * push_vlan ; uint16_t ethertype ; struct ulp_rte_act_prop * act = & params -> act_prop ; push_vlan = action_item -> conf ; if ( push_vlan ) { ethertype = push_vlan -> ethertype ; if ( tfp_cpu_to_be_16 ( ethertype ) != RTE_ETHER_TYPE_VLAN ) { BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_PARSE_ERR ; } memcpy ( & act -> act_details [ BNXT_ULP_ACT_PROP_IDX_PUSH_VLAN ] , & ethertype , BNXT_ULP_ACT_PROP_SZ_PUSH_VLAN ) ; ULP_BITMAP_SET ( params -> act_bitmap . bits , BNXT_ULP_ACTION_BIT_PUSH_VLAN ) ; return BNXT_TF_RC_SUCCESS ; } BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_ERROR ; }
Function to handle the parsing of RTE Flow action push vlan.
Function to handle the parsing of RTE Flow action push vlan .
/* Update the hdr_bitmap with push vlan */