src/dpdk/drivers/net/mvpp2/mrvl_flow.c
static int
mrvl_alloc_key_mask(struct pp2_cls_rule_key_field *field)
{
	unsigned int id = rte_socket_id();

	field->key = rte_zmalloc_socket(NULL, MRVL_CLS_STR_SIZE_MAX, 0, id);
	if (!field->key)
		goto out;

	field->mask = rte_zmalloc_socket(NULL, MRVL_CLS_STR_SIZE_MAX, 0, id);
	if (!field->mask)
		goto out_mask;

	return 0;
out_mask:
	rte_free(field->key);
out:
	field->key = NULL;
	field->mask = NULL;
	return -1;
}
/**
 * Allocate memory for classifier rule key and mask fields.
 *
 * @param field Pointer to the classifier rule.
 * @returns 0 in case of success, negative value otherwise.
 */
Allocate memory for classifier rule key and mask fields.
@param field Pointer to the classifier rule.
@returns 0 in case of success, negative value otherwise.
Allocate memory for classifier rule key and mask fields . @param field Pointer to the classifier rule . @returns 0 in case of success negative value otherwise .
static int
mrvl_alloc_key_mask(struct pp2_cls_rule_key_field *field)
{
	unsigned int id = rte_socket_id();
	field->key = rte_zmalloc_socket(NULL, MRVL_CLS_STR_SIZE_MAX, 0, id);
	if (!field->key)
		goto out;
	field->mask = rte_zmalloc_socket(NULL, MRVL_CLS_STR_SIZE_MAX, 0, id);
	if (!field->mask)
		goto out_mask;
	return 0;
out_mask:
	rte_free(field->key);
out:
	field->key = NULL;
	field->mask = NULL;
	return -1;
}
static int mrvl_alloc_key_mask ( struct pp2_cls_rule_key_field * field ) { unsigned int id = rte_socket_id ( ) ; field -> key = rte_zmalloc_socket ( NULL , MRVL_CLS_STR_SIZE_MAX , 0 , id ) ; if ( ! field -> key ) goto out ; field -> mask = rte_zmalloc_socket ( NULL , MRVL_CLS_STR_SIZE_MAX , 0 , id ) ; if ( ! field -> mask ) goto out_mask ; return 0 ; out_mask : rte_free ( field -> key ) ; out : field -> key = NULL ; field -> mask = NULL ; return -1 ; }
Allocate memory for classifier rule key and mask fields.
Allocate memory for classifier rule key and mask fields .