src/dpdk/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
int32_t
ulp_rte_vxlan_hdr_handler(const struct rte_flow_item *item,
			  struct ulp_rte_parser_params *params)
{
	const struct rte_flow_item_vxlan *vxlan_spec = item->spec;
	const struct rte_flow_item_vxlan *vxlan_mask = item->mask;
	struct ulp_rte_hdr_field *field;
	struct ulp_rte_hdr_bitmap *hdr_bitmap = &params->hdr_bitmap;
	uint32_t idx = params->field_idx;
	uint32_t size;

	/*
	 * Copy the rte_flow_item for vxlan into hdr_field using vxlan
	 * header fields
	 */
	if (vxlan_spec) {
		size = sizeof(vxlan_spec->flags);
		field = ulp_rte_parser_fld_copy(&params->hdr_field[idx],
						&vxlan_spec->flags,
						size);
		size = sizeof(vxlan_spec->rsvd0);
		field = ulp_rte_parser_fld_copy(field,
						&vxlan_spec->rsvd0,
						size);
		size = sizeof(vxlan_spec->vni);
		field = ulp_rte_parser_fld_copy(field,
						&vxlan_spec->vni,
						size);
		size = sizeof(vxlan_spec->rsvd1);
		field = ulp_rte_parser_fld_copy(field,
						&vxlan_spec->rsvd1,
						size);
	}
	if (vxlan_mask) {
		ulp_rte_prsr_mask_copy(params, &idx,
				       &vxlan_mask->flags,
				       sizeof(vxlan_mask->flags));
		ulp_rte_prsr_mask_copy(params, &idx,
				       &vxlan_mask->rsvd0,
				       sizeof(vxlan_mask->rsvd0));
		ulp_rte_prsr_mask_copy(params, &idx,
				       &vxlan_mask->vni,
				       sizeof(vxlan_mask->vni));
		ulp_rte_prsr_mask_copy(params, &idx,
				       &vxlan_mask->rsvd1,
				       sizeof(vxlan_mask->rsvd1));
	}
	/* Add number of vxlan header elements */
	params->field_idx += BNXT_ULP_PROTO_HDR_VXLAN_NUM;

	/* Update the hdr_bitmap with vxlan */
	ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_T_VXLAN);
	return BNXT_TF_RC_SUCCESS;
}
/* Function to handle the parsing of RTE Flow item Vxlan Header. */
Function to handle the parsing of RTE Flow item Vxlan Header.
Function to handle the parsing of RTE Flow item Vxlan Header .
int32_t
ulp_rte_vxlan_hdr_handler(const struct rte_flow_item *item,
			  struct ulp_rte_parser_params *params)
{
	const struct rte_flow_item_vxlan *vxlan_spec = item->spec;
	const struct rte_flow_item_vxlan *vxlan_mask = item->mask;
	struct ulp_rte_hdr_field *field;
	struct ulp_rte_hdr_bitmap *hdr_bitmap = &params->hdr_bitmap;
	uint32_t idx = params->field_idx;
	uint32_t size;
	if (vxlan_spec) {
		size = sizeof(vxlan_spec->flags);
		field = ulp_rte_parser_fld_copy(&params->hdr_field[idx],
						&vxlan_spec->flags,
						size);
		size = sizeof(vxlan_spec->rsvd0);
		field = ulp_rte_parser_fld_copy(field,
						&vxlan_spec->rsvd0,
						size);
		size = sizeof(vxlan_spec->vni);
		field = ulp_rte_parser_fld_copy(field,
						&vxlan_spec->vni,
						size);
		size = sizeof(vxlan_spec->rsvd1);
		field = ulp_rte_parser_fld_copy(field,
						&vxlan_spec->rsvd1,
						size);
	}
	if (vxlan_mask) {
		ulp_rte_prsr_mask_copy(params, &idx,
				       &vxlan_mask->flags,
				       sizeof(vxlan_mask->flags));
		ulp_rte_prsr_mask_copy(params, &idx,
				       &vxlan_mask->rsvd0,
				       sizeof(vxlan_mask->rsvd0));
		ulp_rte_prsr_mask_copy(params, &idx,
				       &vxlan_mask->vni,
				       sizeof(vxlan_mask->vni));
		ulp_rte_prsr_mask_copy(params, &idx,
				       &vxlan_mask->rsvd1,
				       sizeof(vxlan_mask->rsvd1));
	}
	params->field_idx += BNXT_ULP_PROTO_HDR_VXLAN_NUM;
	ULP_BITMAP_SET(hdr_bitmap->bits, BNXT_ULP_HDR_BIT_T_VXLAN);
	return BNXT_TF_RC_SUCCESS;
}
int32_t ulp_rte_vxlan_hdr_handler ( const struct rte_flow_item * item , struct ulp_rte_parser_params * params ) { const struct rte_flow_item_vxlan * vxlan_spec = item -> spec ; const struct rte_flow_item_vxlan * vxlan_mask = item -> mask ; struct ulp_rte_hdr_field * field ; struct ulp_rte_hdr_bitmap * hdr_bitmap = & params -> hdr_bitmap ; uint32_t idx = params -> field_idx ; uint32_t size ; if ( vxlan_spec ) { size = sizeof ( vxlan_spec -> flags ) ; field = ulp_rte_parser_fld_copy ( & params -> hdr_field [ idx ] , & vxlan_spec -> flags , size ) ; size = sizeof ( vxlan_spec -> rsvd0 ) ; field = ulp_rte_parser_fld_copy ( field , & vxlan_spec -> rsvd0 , size ) ; size = sizeof ( vxlan_spec -> vni ) ; field = ulp_rte_parser_fld_copy ( field , & vxlan_spec -> vni , size ) ; size = sizeof ( vxlan_spec -> rsvd1 ) ; field = ulp_rte_parser_fld_copy ( field , & vxlan_spec -> rsvd1 , size ) ; } if ( vxlan_mask ) { ulp_rte_prsr_mask_copy ( params , & idx , & vxlan_mask -> flags , sizeof ( vxlan_mask -> flags ) ) ; ulp_rte_prsr_mask_copy ( params , & idx , & vxlan_mask -> rsvd0 , sizeof ( vxlan_mask -> rsvd0 ) ) ; ulp_rte_prsr_mask_copy ( params , & idx , & vxlan_mask -> vni , sizeof ( vxlan_mask -> vni ) ) ; ulp_rte_prsr_mask_copy ( params , & idx , & vxlan_mask -> rsvd1 , sizeof ( vxlan_mask -> rsvd1 ) ) ; } params -> field_idx += BNXT_ULP_PROTO_HDR_VXLAN_NUM ; ULP_BITMAP_SET ( hdr_bitmap -> bits , BNXT_ULP_HDR_BIT_T_VXLAN ) ; return BNXT_TF_RC_SUCCESS ; }
Function to handle the parsing of RTE Flow item Vxlan Header.
Function to handle the parsing of RTE Flow item Vxlan Header .
/*
	 * Copy the rte_flow_item for vxlan into hdr_field using vxlan
	 * header fields
	 */ /* Add number of vxlan header elements */ /* Update the hdr_bitmap with vxlan */