dpdk: Be wary of the return value from rte_eth_dev_socket_id 27/38827/2
authorSteven Luong <sluong@cisco.com>
Mon, 15 May 2023 04:47:21 +0000 (21:47 -0700)
committersteven luong <sluong@cisco.com>
Mon, 15 May 2023 04:58:40 +0000 (04:58 +0000)
commite77af765e2c4eb2e1eb858c48441b1f236ed41f9
tree206d432b94f18c4b9818778fdb1e7c4aead44b66
parent4a0e08eb6068ada1d2867c32f0fb08c1af389e06
dpdk: Be wary of the return value from rte_eth_dev_socket_id

Prior to dpdk-22.11, VPP can count on rte_eth_dev_socket_id to return
numa node 0 if the device didn't set it. Ever since below patch is
committed in dpdk
https://patchwork.dpdk.org/project/dpdk/patch/20220929120512.480-1-olivier.matz@6wind.com/#152498
the aforementioned assumption is no longer true. If the device didn't
set the numa node, VPP gets -1 from the aforementioned API call. This
causes VPP to crash.

This fix is to set the numa node to 0 if the API returns -1, or SOCKET_ID_ANY

Type: fix

Change-Id: I2fde2870e5a3eb98473fe8d119fef594bfba9a8d
Signed-off-by: Steven Luong <sluong@cisco.com>
src/plugins/dpdk/device/init.c