src/dpdk/drivers/net/mlx5/linux/mlx5_os.c
static void *
mlx5_alloc_verbs_buf(size_t size, void *data)
{
	struct mlx5_dev_ctx_shared *sh = data;
	void *ret;
	size_t alignment = rte_mem_page_size();
	if (alignment == (size_t)-1) {
		DRV_LOG(ERR, "Failed to get mem page size");
		rte_errno = ENOMEM;
		return NULL;
	}

	MLX5_ASSERT(data != NULL);
	ret = mlx5_malloc(0, size, alignment, sh->numa_node);
	if (!ret && size)
		rte_errno = ENOMEM;
	return ret;
}
/**
 * Verbs callback to allocate a memory. This function should allocate the space
 * according to the size provided residing inside a huge page.
 * Please note that all allocation must respect the alignment from libmlx5
 * (i.e. currently rte_mem_page_size()).
 *
 * @param[in] size
 *   The size in bytes of the memory to allocate.
 * @param[in] data
 *   A pointer to the callback data.
 *
 * @return
 *   Allocated buffer, NULL otherwise and rte_errno is set.
 */
Verbs callback to allocate a memory. This function should allocate the space
according to the size provided residing inside a huge page.
Please note that all allocation must respect the alignment from libmlx5
).

@param[in] size
The size in bytes of the memory to allocate.
@param[in] data
A pointer to the callback data.

@return
Allocated buffer, NULL otherwise and rte_errno is set.
Verbs callback to allocate a memory . This function should allocate the space according to the size provided residing inside a huge page . Please note that all allocation must respect the alignment from libmlx5 ) . @param [ in ] size The size in bytes of the memory to allocate . @param [ in ] data A pointer to the callback data . @return Allocated buffer NULL otherwise and rte_errno is set .
static void *
mlx5_alloc_verbs_buf(size_t size, void *data)
{
	struct mlx5_dev_ctx_shared *sh = data;
	void *ret;
	size_t alignment = rte_mem_page_size();
	if (alignment == (size_t)-1) {
		DRV_LOG(ERR, "Failed to get mem page size");
		rte_errno = ENOMEM;
		return NULL;
	}
	MLX5_ASSERT(data != NULL);
	ret = mlx5_malloc(0, size, alignment, sh->numa_node);
	if (!ret && size)
		rte_errno = ENOMEM;
	return ret;
}
static void * mlx5_alloc_verbs_buf ( size_t size , void * data ) { struct mlx5_dev_ctx_shared * sh = data ; void * ret ; size_t alignment = rte_mem_page_size ( ) ; if ( alignment == ( size_t ) -1 ) { DRV_LOG ( ERR , " " ) ; rte_errno = ENOMEM ; return NULL ; } MLX5_ASSERT ( data != NULL ) ; ret = mlx5_malloc ( 0 , size , alignment , sh -> numa_node ) ; if ( ! ret && size ) rte_errno = ENOMEM ; return ret ; }
Verbs callback to allocate a memory.
Verbs callback to allocate a memory .