src/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
static int32_t
ulp_rte_parser_act_port_set(struct ulp_rte_parser_params *param,
			    uint32_t ifindex)
{
	enum bnxt_ulp_direction_type dir;
	uint16_t pid_s;
	uint32_t pid;
	struct ulp_rte_act_prop *act = &param->act_prop;
	enum bnxt_ulp_intf_type port_type;
	uint32_t vnic_type;

	/* Get the direction */
	dir = ULP_COMP_FLD_IDX_RD(param, BNXT_ULP_CF_IDX_DIRECTION);
	if (dir == BNXT_ULP_DIR_EGRESS) {
		/* For egress direction, fill vport */
		if (ulp_port_db_vport_get(param->ulp_ctx, ifindex, &pid_s))
			return BNXT_TF_RC_ERROR;

		pid = pid_s;
		pid = rte_cpu_to_be_32(pid);
		memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_VPORT],
		       &pid, BNXT_ULP_ACT_PROP_SZ_VPORT);
	} else {
		/* For ingress direction, fill vnic */
		port_type = ULP_COMP_FLD_IDX_RD(param,
						BNXT_ULP_CF_IDX_ACT_PORT_TYPE);
		if (port_type == BNXT_ULP_INTF_TYPE_VF_REP)
			vnic_type = BNXT_ULP_VF_FUNC_VNIC;
		else
			vnic_type = BNXT_ULP_DRV_FUNC_VNIC;

		if (ulp_port_db_default_vnic_get(param->ulp_ctx, ifindex,
						 vnic_type, &pid_s))
			return BNXT_TF_RC_ERROR;

		pid = pid_s;
		pid = rte_cpu_to_be_32(pid);
		memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_VNIC],
		       &pid, BNXT_ULP_ACT_PROP_SZ_VNIC);
	}

	/* Update the action port set bit */
	ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_ACT_PORT_IS_SET, 1);
	return BNXT_TF_RC_SUCCESS;
}
/* Function to handle the parsing of action ports. */
Function to handle the parsing of action ports.
Function to handle the parsing of action ports .
static int32_t
ulp_rte_parser_act_port_set(struct ulp_rte_parser_params *param,
			    uint32_t ifindex)
{
	enum bnxt_ulp_direction_type dir;
	uint16_t pid_s;
	uint32_t pid;
	struct ulp_rte_act_prop *act = &param->act_prop;
	enum bnxt_ulp_intf_type port_type;
	uint32_t vnic_type;
	dir = ULP_COMP_FLD_IDX_RD(param, BNXT_ULP_CF_IDX_DIRECTION);
	if (dir == BNXT_ULP_DIR_EGRESS) {
		if (ulp_port_db_vport_get(param->ulp_ctx, ifindex, &pid_s))
			return BNXT_TF_RC_ERROR;
		pid = pid_s;
		pid = rte_cpu_to_be_32(pid);
		memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_VPORT],
		       &pid, BNXT_ULP_ACT_PROP_SZ_VPORT);
	} else {
		port_type = ULP_COMP_FLD_IDX_RD(param,
						BNXT_ULP_CF_IDX_ACT_PORT_TYPE);
		if (port_type == BNXT_ULP_INTF_TYPE_VF_REP)
			vnic_type = BNXT_ULP_VF_FUNC_VNIC;
		else
			vnic_type = BNXT_ULP_DRV_FUNC_VNIC;
		if (ulp_port_db_default_vnic_get(param->ulp_ctx, ifindex,
						 vnic_type, &pid_s))
			return BNXT_TF_RC_ERROR;
		pid = pid_s;
		pid = rte_cpu_to_be_32(pid);
		memcpy(&act->act_details[BNXT_ULP_ACT_PROP_IDX_VNIC],
		       &pid, BNXT_ULP_ACT_PROP_SZ_VNIC);
	}
	ULP_COMP_FLD_IDX_WR(param, BNXT_ULP_CF_IDX_ACT_PORT_IS_SET, 1);
	return BNXT_TF_RC_SUCCESS;
}
static int32_t ulp_rte_parser_act_port_set ( struct ulp_rte_parser_params * param , uint32_t ifindex ) { enum bnxt_ulp_direction_type dir ; uint16_t pid_s ; uint32_t pid ; struct ulp_rte_act_prop * act = & param -> act_prop ; enum bnxt_ulp_intf_type port_type ; uint32_t vnic_type ; dir = ULP_COMP_FLD_IDX_RD ( param , BNXT_ULP_CF_IDX_DIRECTION ) ; if ( dir == BNXT_ULP_DIR_EGRESS ) { if ( ulp_port_db_vport_get ( param -> ulp_ctx , ifindex , & pid_s ) ) return BNXT_TF_RC_ERROR ; pid = pid_s ; pid = rte_cpu_to_be_32 ( pid ) ; memcpy ( & act -> act_details [ BNXT_ULP_ACT_PROP_IDX_VPORT ] , & pid , BNXT_ULP_ACT_PROP_SZ_VPORT ) ; } else { port_type = ULP_COMP_FLD_IDX_RD ( param , BNXT_ULP_CF_IDX_ACT_PORT_TYPE ) ; if ( port_type == BNXT_ULP_INTF_TYPE_VF_REP ) vnic_type = BNXT_ULP_VF_FUNC_VNIC ; else vnic_type = BNXT_ULP_DRV_FUNC_VNIC ; if ( ulp_port_db_default_vnic_get ( param -> ulp_ctx , ifindex , vnic_type , & pid_s ) ) return BNXT_TF_RC_ERROR ; pid = pid_s ; pid = rte_cpu_to_be_32 ( pid ) ; memcpy ( & act -> act_details [ BNXT_ULP_ACT_PROP_IDX_VNIC ] , & pid , BNXT_ULP_ACT_PROP_SZ_VNIC ) ; } ULP_COMP_FLD_IDX_WR ( param , BNXT_ULP_CF_IDX_ACT_PORT_IS_SET , 1 ) ; return BNXT_TF_RC_SUCCESS ; }
Function to handle the parsing of action ports.
Function to handle the parsing of action ports .
/* Get the direction */ /* For egress direction, fill vport */ /* For ingress direction, fill vnic */ /* Update the action port set bit */