src/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
int32_t
ulp_rte_vf_act_handler(const struct rte_flow_action *action_item,
		       struct ulp_rte_parser_params *params)
{
	const struct rte_flow_action_vf *vf_action;
	uint32_t ifindex;
	enum bnxt_ulp_intf_type intf_type;

	vf_action = action_item->conf;
	if (!vf_action) {
		BNXT_TF_DBG(ERR, "ParseErr: Invalid Argument\n");
		return BNXT_TF_RC_PARSE_ERR;
	}

	if (vf_action->original) {
		BNXT_TF_DBG(ERR, "ParseErr:VF Original not supported\n");
		return BNXT_TF_RC_PARSE_ERR;
	}

	/* Check the port is VF port */
	if (ulp_port_db_dev_func_id_to_ulp_index(params->ulp_ctx, vf_action->id,
						 &ifindex)) {
		BNXT_TF_DBG(ERR, "VF is not valid interface\n");
		return BNXT_TF_RC_ERROR;
	}
	intf_type = ulp_port_db_port_type_get(params->ulp_ctx, ifindex);
	if (intf_type != BNXT_ULP_INTF_TYPE_VF &&
	    intf_type != BNXT_ULP_INTF_TYPE_TRUSTED_VF) {
		BNXT_TF_DBG(ERR, "Port is not a VF port\n");
		return BNXT_TF_RC_ERROR;
	}

	/* Update the action properties */
	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_PORT_TYPE, intf_type);
	return ulp_rte_parser_act_port_set(params, ifindex);
}
/* Function to handle the parsing of RTE Flow action VF. */
Function to handle the parsing of RTE Flow action VF.
Function to handle the parsing of RTE Flow action VF .
int32_t
ulp_rte_vf_act_handler(const struct rte_flow_action *action_item,
		       struct ulp_rte_parser_params *params)
{
	const struct rte_flow_action_vf *vf_action;
	uint32_t ifindex;
	enum bnxt_ulp_intf_type intf_type;
	vf_action = action_item->conf;
	if (!vf_action) {
		BNXT_TF_DBG(ERR, "ParseErr: Invalid Argument\n");
		return BNXT_TF_RC_PARSE_ERR;
	}
	if (vf_action->original) {
		BNXT_TF_DBG(ERR, "ParseErr:VF Original not supported\n");
		return BNXT_TF_RC_PARSE_ERR;
	}
	if (ulp_port_db_dev_func_id_to_ulp_index(params->ulp_ctx, vf_action->id,
						 &ifindex)) {
		BNXT_TF_DBG(ERR, "VF is not valid interface\n");
		return BNXT_TF_RC_ERROR;
	}
	intf_type = ulp_port_db_port_type_get(params->ulp_ctx, ifindex);
	if (intf_type != BNXT_ULP_INTF_TYPE_VF &&
	    intf_type != BNXT_ULP_INTF_TYPE_TRUSTED_VF) {
		BNXT_TF_DBG(ERR, "Port is not a VF port\n");
		return BNXT_TF_RC_ERROR;
	}
	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_PORT_TYPE, intf_type);
	return ulp_rte_parser_act_port_set(params, ifindex);
}
int32_t ulp_rte_vf_act_handler ( const struct rte_flow_action * action_item , struct ulp_rte_parser_params * params ) { const struct rte_flow_action_vf * vf_action ; uint32_t ifindex ; enum bnxt_ulp_intf_type intf_type ; vf_action = action_item -> conf ; if ( ! vf_action ) { BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_PARSE_ERR ; } if ( vf_action -> original ) { BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_PARSE_ERR ; } if ( ulp_port_db_dev_func_id_to_ulp_index ( params -> ulp_ctx , vf_action -> id , & ifindex ) ) { BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_ERROR ; } intf_type = ulp_port_db_port_type_get ( params -> ulp_ctx , ifindex ) ; if ( intf_type != BNXT_ULP_INTF_TYPE_VF && intf_type != BNXT_ULP_INTF_TYPE_TRUSTED_VF ) { BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_ERROR ; } ULP_COMP_FLD_IDX_WR ( params , BNXT_ULP_CF_IDX_ACT_PORT_TYPE , intf_type ) ; return ulp_rte_parser_act_port_set ( params , ifindex ) ; }
Function to handle the parsing of RTE Flow action VF.
Function to handle the parsing of RTE Flow action VF .
/* Check the port is VF port */ /* Update the action properties */