src/dpdk/drivers/net/mvpp2/mrvl_flow.c
static int
mrvl_parse_eth(const struct rte_flow_item *item, struct rte_flow *flow,
	       struct rte_flow_error *error)
{
	const struct rte_flow_item_eth *spec = NULL, *mask = NULL;
	struct rte_ether_addr zero;
	int ret;

	ret = mrvl_parse_init(item, (const void **)&spec, (const void **)&mask,
			      &rte_flow_item_eth_mask,
			      sizeof(struct rte_flow_item_eth), error);
	if (ret)
		return ret;

	memset(&zero, 0, sizeof(zero));

	if (memcmp(&mask->dst, &zero, sizeof(mask->dst))) {
		ret = mrvl_parse_dmac(spec, mask, flow);
		if (ret)
			goto out;
	}

	if (memcmp(&mask->src, &zero, sizeof(mask->src))) {
		ret = mrvl_parse_smac(spec, mask, flow);
		if (ret)
			goto out;
	}

	if (mask->type) {
		MRVL_LOG(WARNING, "eth type mask is ignored");
		ret = mrvl_parse_type(spec, mask, flow);
		if (ret)
			goto out;
	}

	return 0;
out:
	rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
			   "Reached maximum number of fields in cls tbl key\n");
	return -rte_errno;
}
/**
 * Parse eth flow item.
 *
 * @param item Pointer to the flow item.
 * @param flow Pointer to the flow.
 * @param error Pointer to the flow error.
 * @returns 0 on success, negative value otherwise.
 */
Parse eth flow item.
@param item Pointer to the flow item.
@param flow Pointer to the flow.
@param error Pointer to the flow error.
@returns 0 on success, negative value otherwise.
Parse eth flow item . @param item Pointer to the flow item . @param flow Pointer to the flow . @param error Pointer to the flow error . @returns 0 on success negative value otherwise .
static int
mrvl_parse_eth(const struct rte_flow_item *item, struct rte_flow *flow,
	       struct rte_flow_error *error)
{
	const struct rte_flow_item_eth *spec = NULL, *mask = NULL;
	struct rte_ether_addr zero;
	int ret;
	ret = mrvl_parse_init(item, (const void **)&spec, (const void **)&mask,
			      &rte_flow_item_eth_mask,
			      sizeof(struct rte_flow_item_eth), error);
	if (ret)
		return ret;
	memset(&zero, 0, sizeof(zero));
	if (memcmp(&mask->dst, &zero, sizeof(mask->dst))) {
		ret = mrvl_parse_dmac(spec, mask, flow);
		if (ret)
			goto out;
	}
	if (memcmp(&mask->src, &zero, sizeof(mask->src))) {
		ret = mrvl_parse_smac(spec, mask, flow);
		if (ret)
			goto out;
	}
	if (mask->type) {
		MRVL_LOG(WARNING, "eth type mask is ignored");
		ret = mrvl_parse_type(spec, mask, flow);
		if (ret)
			goto out;
	}
	return 0;
out:
	rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
			   "Reached maximum number of fields in cls tbl key\n");
	return -rte_errno;
}
static int mrvl_parse_eth ( const struct rte_flow_item * item , struct rte_flow * flow , struct rte_flow_error * error ) { const struct rte_flow_item_eth * spec = NULL , * mask = NULL ; struct rte_ether_addr zero ; int ret ; ret = mrvl_parse_init ( item , ( const void * * ) & spec , ( const void * * ) & mask , & rte_flow_item_eth_mask , sizeof ( struct rte_flow_item_eth ) , error ) ; if ( ret ) return ret ; memset ( & zero , 0 , sizeof ( zero ) ) ; if ( memcmp ( & mask -> dst , & zero , sizeof ( mask -> dst ) ) ) { ret = mrvl_parse_dmac ( spec , mask , flow ) ; if ( ret ) goto out ; } if ( memcmp ( & mask -> src , & zero , sizeof ( mask -> src ) ) ) { ret = mrvl_parse_smac ( spec , mask , flow ) ; if ( ret ) goto out ; } if ( mask -> type ) { MRVL_LOG ( WARNING , " " ) ; ret = mrvl_parse_type ( spec , mask , flow ) ; if ( ret ) goto out ; } return 0 ; out : rte_flow_error_set ( error , EINVAL , RTE_FLOW_ERROR_TYPE_UNSPECIFIED , NULL , " \n " ) ; return - rte_errno ; }
Parse eth flow item.
Parse eth flow item .