vlib: fix error when creating avf interface on SMP system 60/28360/2
authorJieqiang Wang <jieqiang.wang@arm.com>
Mon, 13 Jan 2020 09:15:13 +0000 (17:15 +0800)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Thu, 13 Aug 2020 10:39:40 +0000 (10:39 +0000)
commitc81ba3d6a611e08b8eb0e5097b01c01c4356b5ff
tree45b5a8403447e46085ac52fc86940f283abf6764
parent7c8260196a8a54f8e66c65269fd8a00b86c7a854
vlib: fix error when creating avf interface on SMP system

On SMP architecture, '/sys/bus/pci/devices/<devices id>/numa_node' file
will return -1 as a valid value if it does not have any NUMA node information.
Using -1 as a valid node id to access data structures will cause memory issue.
Fix the error by setting the value of numa_node to 0 if '/sys/bus/pci/devices/
<devices id>/numa_node' returns -1 and it is a SMP system.

Type: fix

Change-Id: Ib60e79c3656fe5b17e08fd9011122683e8b08b6f
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
(cherry picked from commit 76c6159d83c2dfe29f84dc4b05d399cdbbdf2878)
src/vlib/linux/pci.c