netdev-dpdk: Fix crash when there is no pci numa info.
authorAlex Wang <alexw@nicira.com>
Thu, 25 Sep 2014 20:10:55 +0000 (13:10 -0700)
committerAlex Wang <alexw@nicira.com>
Thu, 25 Sep 2014 21:17:54 +0000 (14:17 -0700)
commit1b7a04e05b6fd15fb4caa7ec20d09ba7aa73399f
tree6c3445f5a62d7a0b399d9e007e7ac14933bb5563
parentf6d0d4b3d0d0a2cdc4740ebe3bcf091508e62492
netdev-dpdk: Fix crash when there is no pci numa info.

When kernel cannot obtain the pci numa info, the numa_node file
in corresponding pci directory in sysfs will show -1.  Then the
rte_eth_dev_socket_id() function will return it to ovs.  On
current master, ovs assumes rte_eth_dev_socket_id() always
returns non-negative value.  So using this -1 in pmd thread
creation will cause ovs crash.

To fix the above issue, this commit makes ovs always check the
return value of rte_eth_dev_socket_id() and use numa node 0 if
the return value is negative.

Reported-by: Daniel Badea <daniel.badea@windriver.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Daniele Di Proietto <ddiproietto@vmware.com>
AUTHORS
lib/netdev-dpdk.c