src/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
int32_t
ulp_rte_port_id_act_handler(const struct rte_flow_action *act_item,
			    struct ulp_rte_parser_params *param)
{
	const struct rte_flow_action_port_id *port_id = act_item->conf;
	uint32_t ifindex;
	enum bnxt_ulp_intf_type intf_type;

	if (!port_id) {
		BNXT_TF_DBG(ERR,
			    "ParseErr: Invalid Argument\n");
		return BNXT_TF_RC_PARSE_ERR;
	}
	if (port_id->original) {
		BNXT_TF_DBG(ERR,
			    "ParseErr:Portid Original not supported\n");
		return BNXT_TF_RC_PARSE_ERR;
	}

	/* Get the port db ifindex */
	if (ulp_port_db_dev_port_to_ulp_index(param->ulp_ctx, port_id->id,
					      &ifindex)) {
		BNXT_TF_DBG(ERR, "Invalid port id\n");
		return BNXT_TF_RC_ERROR;
	}

	/* Get the intf type */
	intf_type = ulp_port_db_port_type_get(param->ulp_ctx, ifindex);
	if (!intf_type) {
		BNXT_TF_DBG(ERR, "Invalid port type\n");
		return BNXT_TF_RC_ERROR;
	}

	/* Set the action port */
	ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_ACT_PORT_TYPE, intf_type);
	return ulp_rte_parser_act_port_set(param, ifindex);
}
/* Function to handle the parsing of RTE Flow action port_id. */
Function to handle the parsing of RTE Flow action port_id.
Function to handle the parsing of RTE Flow action port_id .
int32_t
ulp_rte_port_id_act_handler(const struct rte_flow_action *act_item,
			    struct ulp_rte_parser_params *param)
{
	const struct rte_flow_action_port_id *port_id = act_item->conf;
	uint32_t ifindex;
	enum bnxt_ulp_intf_type intf_type;
	if (!port_id) {
		BNXT_TF_DBG(ERR,
			    "ParseErr: Invalid Argument\n");
		return BNXT_TF_RC_PARSE_ERR;
	}
	if (port_id->original) {
		BNXT_TF_DBG(ERR,
			    "ParseErr:Portid Original not supported\n");
		return BNXT_TF_RC_PARSE_ERR;
	}
	if (ulp_port_db_dev_port_to_ulp_index(param->ulp_ctx, port_id->id,
					      &ifindex)) {
		BNXT_TF_DBG(ERR, "Invalid port id\n");
		return BNXT_TF_RC_ERROR;
	}
	intf_type = ulp_port_db_port_type_get(param->ulp_ctx, ifindex);
	if (!intf_type) {
		BNXT_TF_DBG(ERR, "Invalid port type\n");
		return BNXT_TF_RC_ERROR;
	}
	ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_ACT_PORT_TYPE, intf_type);
	return ulp_rte_parser_act_port_set(param, ifindex);
}
int32_t ulp_rte_port_id_act_handler ( const struct rte_flow_action * act_item , struct ulp_rte_parser_params * param ) { const struct rte_flow_action_port_id * port_id = act_item -> conf ; uint32_t ifindex ; enum bnxt_ulp_intf_type intf_type ; if ( ! port_id ) { BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_PARSE_ERR ; } if ( port_id -> original ) { BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_PARSE_ERR ; } if ( ulp_port_db_dev_port_to_ulp_index ( param -> ulp_ctx , port_id -> id , & ifindex ) ) { BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_ERROR ; } intf_type = ulp_port_db_port_type_get ( param -> ulp_ctx , ifindex ) ; if ( ! intf_type ) { BNXT_TF_DBG ( ERR , " \n " ) ; return BNXT_TF_RC_ERROR ; } ULP_COMP_FLD_IDX_WR ( param , BNXT_ULP_CF_IDX_ACT_PORT_TYPE , intf_type ) ; return ulp_rte_parser_act_port_set ( param , ifindex ) ; }
Function to handle the parsing of RTE Flow action port_id.
Function to handle the parsing of RTE Flow action port_id .
/* Get the port db ifindex */ /* Get the intf type */ /* Set the action port */