app/testpmd: fix vdev socket initialization
authorPhil Yang <phil.yang@arm.com>
Fri, 12 Oct 2018 09:34:55 +0000 (17:34 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 18 Oct 2018 08:24:39 +0000 (10:24 +0200)
commit29841336438400ce040e394c0c00040c21644727
tree46a055e9665b4466edfa394ab3ac82b7b5d0b882
parentdcf3d57fa4e35d49ea0b1d01514eb702aac4a23f
app/testpmd: fix vdev socket initialization

The cmdline settings of port-numa-config and rxring-numa-config have
been flushed by the following init_config. If we don't configure the
port-numa-config, the virtual device will allocate the device ports to
socket 0. It will cause failure when the socket 0 is unavailable.

eg:
testpmd -l <cores from socket 1> --vdev net_pcap0,iface=lo
--socket-mem=64 -- --numa --port-numa-config="(0,1)"
--ring-numa-config="(0,1,1),(0,2,1)" -i

...
Configuring Port 0 (socket 0)
Failed to setup RX queue:No mempool allocation on the socket 0
EAL: Error - exiting with code: 1
  Cause: Start ports failed

Fix by allocate the devices port to the first available socket or the
socket configured in port-numa-config.

Fixes: 487f9a592a27 ("app/testpmd: fix NUMA structures initialization")
Fixes: 20a0286fd2c0 ("app/testpmd: check socket id validity")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/testpmd.c