diff options
author | Damjan Marion <damarion@cisco.com> | 2016-04-21 21:42:40 +0200 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2016-04-22 12:02:26 +0000 |
commit | ae605265d2d2791e91835d3628303cc8e2aecc42 (patch) | |
tree | fd3c42dd3a48522c49112ca3925f9fe3c5f65995 /vnet | |
parent | 7cd98ea5ad640e5e90303f1b442d11fd3757c34d (diff) |
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 <damarion@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/devices/dpdk/init.c | 11 |
1 files changed, 11 insertions, 0 deletions
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); |