src/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
static void
bnxt_ulp_comp_fld_intf_update(struct ulp_rte_parser_params *params)
{
	uint32_t ifindex;
	uint16_t port_id, parif;
	uint32_t mtype;
	enum bnxt_ulp_direction_type dir;

	/* get the direction details */
	dir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);

	/* read the port id details */
	port_id = ULP_COMP_FLD_IDX_RD(params,
				      BNXT_ULP_CF_IDX_INCOMING_IF);
	if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx,
					      port_id,
					      &ifindex)) {
		BNXT_TF_DBG(ERR, "ParseErr:Portid is not valid\n");
		return;
	}

	if (dir == BNXT_ULP_DIR_INGRESS) {
		/* Set port PARIF */
		if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
					  BNXT_ULP_PHY_PORT_PARIF, &parif)) {
			BNXT_TF_DBG(ERR, "ParseErr:ifindex is not valid\n");
			return;
		}
		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_PHY_PORT_PARIF,
				    parif);
	} else {
		/* Get the match port type */
		mtype = ULP_COMP_FLD_IDX_RD(params,
					    BNXT_ULP_CF_IDX_MATCH_PORT_TYPE);
		if (mtype == BNXT_ULP_INTF_TYPE_VF_REP) {
			ULP_COMP_FLD_IDX_WR(params,
					    BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP,
					    1);
			/* Set VF func PARIF */
			if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
						  BNXT_ULP_VF_FUNC_PARIF,
						  &parif)) {
				BNXT_TF_DBG(ERR,
					    "ParseErr:ifindex is not valid\n");
				return;
			}
			ULP_COMP_FLD_IDX_WR(params,
					    BNXT_ULP_CF_IDX_VF_FUNC_PARIF,
					    parif);

			/* populate the loopback parif */
			ULP_COMP_FLD_IDX_WR(params,
					    BNXT_ULP_CF_IDX_LOOPBACK_PARIF,
					    BNXT_ULP_SYM_VF_FUNC_PARIF);

		} else {
			/* Set DRV func PARIF */
			if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
						  BNXT_ULP_DRV_FUNC_PARIF,
						  &parif)) {
				BNXT_TF_DBG(ERR,
					    "ParseErr:ifindex is not valid\n");
				return;
			}
			ULP_COMP_FLD_IDX_WR(params,
					    BNXT_ULP_CF_IDX_DRV_FUNC_PARIF,
					    parif);
		}
	}
}
/*
 * Function to handle the post processing of the computed
 * fields for the interface.
 */
Function to handle the post processing of the computed
fields for the interface.
Function to handle the post processing of the computed fields for the interface .
static void
bnxt_ulp_comp_fld_intf_update(struct ulp_rte_parser_params *params)
{
	uint32_t ifindex;
	uint16_t port_id, parif;
	uint32_t mtype;
	enum bnxt_ulp_direction_type dir;
	dir = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_DIRECTION);
	port_id = ULP_COMP_FLD_IDX_RD(params,
				      BNXT_ULP_CF_IDX_INCOMING_IF);
	if (ulp_port_db_dev_port_to_ulp_index(params->ulp_ctx,
					      port_id,
					      &ifindex)) {
		BNXT_TF_DBG(ERR, "ParseErr:Portid is not valid\n");
		return;
	}
	if (dir == BNXT_ULP_DIR_INGRESS) {
		if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
					  BNXT_ULP_PHY_PORT_PARIF, &parif)) {
			BNXT_TF_DBG(ERR, "ParseErr:ifindex is not valid\n");
			return;
		}
		ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_PHY_PORT_PARIF,
				    parif);
	} else {
		mtype = ULP_COMP_FLD_IDX_RD(params,
					    BNXT_ULP_CF_IDX_MATCH_PORT_TYPE);
		if (mtype == BNXT_ULP_INTF_TYPE_VF_REP) {
			ULP_COMP_FLD_IDX_WR(params,
					    BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP,
					    1);
			if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
						  BNXT_ULP_VF_FUNC_PARIF,
						  &parif)) {
				BNXT_TF_DBG(ERR,
					    "ParseErr:ifindex is not valid\n");
				return;
			}
			ULP_COMP_FLD_IDX_WR(params,
					    BNXT_ULP_CF_IDX_VF_FUNC_PARIF,
					    parif);
			ULP_COMP_FLD_IDX_WR(params,
					    BNXT_ULP_CF_IDX_LOOPBACK_PARIF,
					    BNXT_ULP_SYM_VF_FUNC_PARIF);
		} else {
			if (ulp_port_db_parif_get(params->ulp_ctx, ifindex,
						  BNXT_ULP_DRV_FUNC_PARIF,
						  &parif)) {
				BNXT_TF_DBG(ERR,
					    "ParseErr:ifindex is not valid\n");
				return;
			}
			ULP_COMP_FLD_IDX_WR(params,
					    BNXT_ULP_CF_IDX_DRV_FUNC_PARIF,
					    parif);
		}
	}
}
static void bnxt_ulp_comp_fld_intf_update ( struct ulp_rte_parser_params * params ) { uint32_t ifindex ; uint16_t port_id , parif ; uint32_t mtype ; enum bnxt_ulp_direction_type dir ; dir = ULP_COMP_FLD_IDX_RD ( params , BNXT_ULP_CF_IDX_DIRECTION ) ; port_id = ULP_COMP_FLD_IDX_RD ( params , BNXT_ULP_CF_IDX_INCOMING_IF ) ; if ( ulp_port_db_dev_port_to_ulp_index ( params -> ulp_ctx , port_id , & ifindex ) ) { BNXT_TF_DBG ( ERR , " \n " ) ; return ; } if ( dir == BNXT_ULP_DIR_INGRESS ) { if ( ulp_port_db_parif_get ( params -> ulp_ctx , ifindex , BNXT_ULP_PHY_PORT_PARIF , & parif ) ) { BNXT_TF_DBG ( ERR , " \n " ) ; return ; } ULP_COMP_FLD_IDX_WR ( params , BNXT_ULP_CF_IDX_PHY_PORT_PARIF , parif ) ; } else { mtype = ULP_COMP_FLD_IDX_RD ( params , BNXT_ULP_CF_IDX_MATCH_PORT_TYPE ) ; if ( mtype == BNXT_ULP_INTF_TYPE_VF_REP ) { ULP_COMP_FLD_IDX_WR ( params , BNXT_ULP_CF_IDX_MATCH_PORT_IS_VFREP , 1 ) ; if ( ulp_port_db_parif_get ( params -> ulp_ctx , ifindex , BNXT_ULP_VF_FUNC_PARIF , & parif ) ) { BNXT_TF_DBG ( ERR , " \n " ) ; return ; } ULP_COMP_FLD_IDX_WR ( params , BNXT_ULP_CF_IDX_VF_FUNC_PARIF , parif ) ; ULP_COMP_FLD_IDX_WR ( params , BNXT_ULP_CF_IDX_LOOPBACK_PARIF , BNXT_ULP_SYM_VF_FUNC_PARIF ) ; } else { if ( ulp_port_db_parif_get ( params -> ulp_ctx , ifindex , BNXT_ULP_DRV_FUNC_PARIF , & parif ) ) { BNXT_TF_DBG ( ERR , " \n " ) ; return ; } ULP_COMP_FLD_IDX_WR ( params , BNXT_ULP_CF_IDX_DRV_FUNC_PARIF , parif ) ; } } }
Function to handle the post processing of the computed
 fields for the interface.
Function to handle the post processing of the computed fields for the interface .
/* get the direction details */ /* read the port id details */ /* Set port PARIF */ /* Get the match port type */ /* Set VF func PARIF */ /* populate the loopback parif */ /* Set DRV func PARIF */