summaryrefslogtreecommitdiffstats
path: root/src/plugins/rdma
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2019-10-07 15:57:32 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-15 10:45:50 +0000
commit8413f48d6edc114cd8d88f0dedec48e7a414cc1e (patch)
tree3924b9b31224fc00ff8391005d046182b6aec1aa /src/plugins/rdma
parenta086e304e4061569c0cb1cfb20a5c045c0e92c16 (diff)
rdma: fix crash when failing to detect numa node on create
Type: fix Change-Id: Ibb8e7c1c13869c1dce2385f58bd7260fcf776c5a Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 90ea5dc1bd7adcedd0d5765c3ee04c98c4853337)
Diffstat (limited to 'src/plugins/rdma')
-rw-r--r--src/plugins/rdma/device.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/rdma/device.c b/src/plugins/rdma/device.c
index 32b7ea55006..ea6d2785845 100644
--- a/src/plugins/rdma/device.c
+++ b/src/plugins/rdma/device.c
@@ -635,6 +635,11 @@ rdma_create_if (vlib_main_t * vm, rdma_create_if_args_t * args)
rd->pci = vlib_pci_get_device_info (vm, &pci_addr, &args->error);
if (!rd->pci)
goto err2;
+
+ /* if we failed to parse NUMA node, default to 0 */
+ if (-1 == rd->pci->numa_node)
+ rd->pci->numa_node = 0;
+
rd->pool = vlib_buffer_pool_get_default_for_numa (vm, rd->pci->numa_node);
if (strncmp ((char *) rd->pci->driver_name, "mlx5_core", 9))