From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: [PATCH 2/2] net/mlx5: fix allocation when no memory on device NUMA node Date: Thu, 18 Jan 2018 14:00:43 +0100 Message-ID: <20180118130043.31773-2-olivier.matz@6wind.com> References: <20180118130043.31773-1-olivier.matz@6wind.com> Cc: stable@dpdk.org To: dev@dpdk.org, Adrien Mazarguil , Nelio Laranjeiro , Yongseok Koh Return-path: In-Reply-To: <20180118130043.31773-1-olivier.matz@6wind.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If there is no memory available on the same numa node than the device, it is preferable to fallback on another socket instead of failing. Fixes: 1e3a39f72d5d ("net/mlx5: allocate verbs object into shared memory") Cc: stable@dpdk.org Signed-off-by: Olivier Matz --- drivers/net/mlx5/mlx5.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 1c95f3520..312f3d5be 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -143,6 +143,10 @@ mlx5_alloc_verbs_buf(size_t size, void *data) assert(data != NULL); ret = rte_malloc_socket(__func__, size, alignment, priv->dev->device->numa_node); + if (ret == NULL) + ret = rte_malloc_socket(__func__, size, alignment, + SOCKET_ID_ANY); + DEBUG("Extern alloc size: %lu, align: %lu: %p", size, alignment, ret); return ret; } -- 2.11.0