src/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
int32_t
bnxt_ulp_rte_parser_hdr_parse(const struct rte_flow_item pattern[],
			      struct ulp_rte_parser_params *params)
{
	const struct rte_flow_item *item = pattern;
	struct bnxt_ulp_rte_hdr_info *hdr_info;

	params->field_idx = BNXT_ULP_PROTO_HDR_SVIF_NUM;

	/* Set the computed flags for no vlan tags before parsing */
	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_NO_VTAG, 1);
	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_NO_VTAG, 1);

	/* Parse all the items in the pattern */
	while (item && item->type != RTE_FLOW_ITEM_TYPE_END) {
		/* get the header information from the flow_hdr_info table */
		hdr_info = &ulp_hdr_info[item->type];
		if (hdr_info->hdr_type == BNXT_ULP_HDR_TYPE_NOT_SUPPORTED) {
			BNXT_TF_DBG(ERR,
				    "Truflow parser does not support type %d\n",
				    item->type);
			return BNXT_TF_RC_PARSE_ERR;
		} else if (hdr_info->hdr_type == BNXT_ULP_HDR_TYPE_SUPPORTED) {
			/* call the registered callback handler */
			if (hdr_info->proto_hdr_func) {
				if (hdr_info->proto_hdr_func(item, params) !=
				    BNXT_TF_RC_SUCCESS) {
					return BNXT_TF_RC_ERROR;
				}
			}
		}
		item++;
	}
	/* update the implied SVIF */
	return ulp_rte_parser_implicit_match_port_process(params);
}
/*
 * Function to handle the parsing of RTE Flows and placing
 * the RTE flow items into the ulp structures.
 */
Function to handle the parsing of RTE Flows and placing
the RTE flow items into the ulp structures.
Function to handle the parsing of RTE Flows and placing the RTE flow items into the ulp structures .
int32_t
bnxt_ulp_rte_parser_hdr_parse(const struct rte_flow_item pattern[],
			      struct ulp_rte_parser_params *params)
{
	const struct rte_flow_item *item = pattern;
	struct bnxt_ulp_rte_hdr_info *hdr_info;
	params->field_idx = BNXT_ULP_PROTO_HDR_SVIF_NUM;
	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_O_NO_VTAG, 1);
	ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_I_NO_VTAG, 1);
	while (item && item->type != RTE_FLOW_ITEM_TYPE_END) {
		hdr_info = &ulp_hdr_info[item->type];
		if (hdr_info->hdr_type == BNXT_ULP_HDR_TYPE_NOT_SUPPORTED) {
			BNXT_TF_DBG(ERR,
				    "Truflow parser does not support type %d\n",
				    item->type);
			return BNXT_TF_RC_PARSE_ERR;
		} else if (hdr_info->hdr_type == BNXT_ULP_HDR_TYPE_SUPPORTED) {
			if (hdr_info->proto_hdr_func) {
				if (hdr_info->proto_hdr_func(item, params) !=
				    BNXT_TF_RC_SUCCESS) {
					return BNXT_TF_RC_ERROR;
				}
			}
		}
		item++;
	}
	return ulp_rte_parser_implicit_match_port_process(params);
}
int32_t bnxt_ulp_rte_parser_hdr_parse ( const struct rte_flow_item pattern [ ] , struct ulp_rte_parser_params * params ) { const struct rte_flow_item * item = pattern ; struct bnxt_ulp_rte_hdr_info * hdr_info ; params -> field_idx = BNXT_ULP_PROTO_HDR_SVIF_NUM ; ULP_COMP_FLD_IDX_WR ( params , BNXT_ULP_CF_IDX_O_NO_VTAG , 1 ) ; ULP_COMP_FLD_IDX_WR ( params , BNXT_ULP_CF_IDX_I_NO_VTAG , 1 ) ; while ( item && item -> type != RTE_FLOW_ITEM_TYPE_END ) { hdr_info = & ulp_hdr_info [ item -> type ] ; if ( hdr_info -> hdr_type == BNXT_ULP_HDR_TYPE_NOT_SUPPORTED ) { BNXT_TF_DBG ( ERR , " \n " , item -> type ) ; return BNXT_TF_RC_PARSE_ERR ; } else if ( hdr_info -> hdr_type == BNXT_ULP_HDR_TYPE_SUPPORTED ) { if ( hdr_info -> proto_hdr_func ) { if ( hdr_info -> proto_hdr_func ( item , params ) != BNXT_TF_RC_SUCCESS ) { return BNXT_TF_RC_ERROR ; } } } item ++ ; } return ulp_rte_parser_implicit_match_port_process ( params ) ; }
Function to handle the parsing of RTE Flows and placing
 the RTE flow items into the ulp structures.
Function to handle the parsing of RTE Flows and placing the RTE flow items into the ulp structures .
/* Set the computed flags for no vlan tags before parsing */ /* Parse all the items in the pattern */ /* get the header information from the flow_hdr_info table */ /* call the registered callback handler */ /* update the implied SVIF */