src/dpdk/drivers/net/mvpp2/mrvl_flow.c
static int
mrvl_parse_ip4_dscp(const struct rte_flow_item_ipv4 *spec,
		    const struct rte_flow_item_ipv4 *mask,
		    struct rte_flow *flow)
{
	struct pp2_cls_rule_key_field *key_field;
	uint8_t k, m;

	key_field = &flow->rule.fields[flow->rule.num_fields];
	mrvl_alloc_key_mask(key_field);
	key_field->size = 1;

	k = (spec->hdr.type_of_service & MRVL_IPV4_DSCP_MASK) >> 2;
	m = (mask->hdr.type_of_service & MRVL_IPV4_DSCP_MASK) >> 2;
	snprintf((char *)key_field->key, MRVL_CLS_STR_SIZE_MAX, "%u", k);
	snprintf((char *)key_field->mask, MRVL_CLS_STR_SIZE_MAX, "%u", m);

	flow->table_key.proto_field[flow->rule.num_fields].proto =
		MV_NET_PROTO_IP4;
	flow->table_key.proto_field[flow->rule.num_fields].field.ipv4 =
		MV_NET_IP4_F_DSCP;
	flow->table_key.key_size += key_field->size;

	flow->rule.num_fields += 1;

	return 0;
}
/**
 * Parse the dscp field of the ipv4 rte flow item.
 *
 * This will create classifier rule that matches dscp field.
 *
 * @param spec Pointer to the specific flow item.
 * @param mask Pointer to the specific flow item's mask.
 * @param flow Pointer to the flow.
 * @return 0 in case of success, negative error value otherwise.
 */
Parse the dscp field of the ipv4 rte flow item.
This will create classifier rule that matches dscp field.

@param spec Pointer to the specific flow item.
@param mask Pointer to the specific flow item's mask.
@param flow Pointer to the flow.
@return 0 in case of success, negative error value otherwise.
Parse the dscp field of the ipv4 rte flow item . This will create classifier rule that matches dscp field . @param spec Pointer to the specific flow item . @param mask Pointer to the specific flow item ' s mask . @param flow Pointer to the flow . @return 0 in case of success negative error value otherwise .
static int
mrvl_parse_ip4_dscp(const struct rte_flow_item_ipv4 *spec,
		    const struct rte_flow_item_ipv4 *mask,
		    struct rte_flow *flow)
{
	struct pp2_cls_rule_key_field *key_field;
	uint8_t k, m;
	key_field = &flow->rule.fields[flow->rule.num_fields];
	mrvl_alloc_key_mask(key_field);
	key_field->size = 1;
	k = (spec->hdr.type_of_service & MRVL_IPV4_DSCP_MASK) >> 2;
	m = (mask->hdr.type_of_service & MRVL_IPV4_DSCP_MASK) >> 2;
	snprintf((char *)key_field->key, MRVL_CLS_STR_SIZE_MAX, "%u", k);
	snprintf((char *)key_field->mask, MRVL_CLS_STR_SIZE_MAX, "%u", m);
	flow->table_key.proto_field[flow->rule.num_fields].proto =
		MV_NET_PROTO_IP4;
	flow->table_key.proto_field[flow->rule.num_fields].field.ipv4 =
		MV_NET_IP4_F_DSCP;
	flow->table_key.key_size += key_field->size;
	flow->rule.num_fields += 1;
	return 0;
}
static int mrvl_parse_ip4_dscp ( const struct rte_flow_item_ipv4 * spec , const struct rte_flow_item_ipv4 * mask , struct rte_flow * flow ) { struct pp2_cls_rule_key_field * key_field ; uint8_t k , m ; key_field = & flow -> rule . fields [ flow -> rule . num_fields ] ; mrvl_alloc_key_mask ( key_field ) ; key_field -> size = 1 ; k = ( spec -> hdr . type_of_service & MRVL_IPV4_DSCP_MASK ) >> 2 ; m = ( mask -> hdr . type_of_service & MRVL_IPV4_DSCP_MASK ) >> 2 ; snprintf ( ( char * ) key_field -> key , MRVL_CLS_STR_SIZE_MAX , " " , k ) ; snprintf ( ( char * ) key_field -> mask , MRVL_CLS_STR_SIZE_MAX , " " , m ) ; flow -> table_key . proto_field [ flow -> rule . num_fields ] . proto = MV_NET_PROTO_IP4 ; flow -> table_key . proto_field [ flow -> rule . num_fields ] . field . ipv4 = MV_NET_IP4_F_DSCP ; flow -> table_key . key_size += key_field -> size ; flow -> rule . num_fields += 1 ; return 0 ; }
Parse the dscp field of the ipv4 rte flow item.
Parse the dscp field of the ipv4 rte flow item .