From ae605265d2d2791e91835d3628303cc8e2aecc42 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 21 Apr 2016 21:42:40 +0200 Subject: Use memory from other CPU sockets if there is no local This fixes crash when local socket memory is not available so rx/tx queue setup fails. Here we simply retry operation without being so picky about memory location. Change-Id: I5bae47defe3c0fe120853378ed13141893284a5a Signed-off-by: Damjan Marion --- vnet/vnet/devices/dpdk/init.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vnet') diff --git a/vnet/vnet/devices/dpdk/init.c b/vnet/vnet/devices/dpdk/init.c index 891190d30bd..b93e1eed43f 100644 --- a/vnet/vnet/devices/dpdk/init.c +++ b/vnet/vnet/devices/dpdk/init.c @@ -89,6 +89,11 @@ dpdk_port_setup (dpdk_main_t * dm, dpdk_device_t * xd) { rv = rte_eth_tx_queue_setup(xd->device_index, j, xd->nb_tx_desc, xd->cpu_socket, &xd->tx_conf); + + /* retry with any other CPU socket */ + if (rv < 0) + rv = rte_eth_tx_queue_setup(xd->device_index, j, xd->nb_tx_desc, + SOCKET_ID_ANY, &xd->tx_conf); if (rv < 0) break; } @@ -103,6 +108,12 @@ dpdk_port_setup (dpdk_main_t * dm, dpdk_device_t * xd) rv = rte_eth_rx_queue_setup(xd->device_index, j, xd->nb_rx_desc, xd->cpu_socket, 0, bm->pktmbuf_pools[xd->cpu_socket_id_by_queue[j]]); + + /* retry with any other CPU socket */ + if (rv < 0) + rv = rte_eth_rx_queue_setup(xd->device_index, j, xd->nb_rx_desc, + SOCKET_ID_ANY, 0, + bm->pktmbuf_pools[xd->cpu_socket_id_by_queue[j]]); if (rv < 0) return clib_error_return (0, "rte_eth_rx_queue_setup[%d]: err %d", xd->device_index, rv); -- cgit 1.2.3-korg