summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Yang <phil.yang@arm.com>2018-10-17 09:36:30 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-18 10:24:39 +0200
commiteffdb8bbb018bd8a611b2ac86a15739f67ea7cbc (patch)
tree1aadd5c21a7d3e090eff663eb166eabbca505415 /app
parent9396ad3346720b424a10dcf6640c919e37a4fcf7 (diff)
downloaddpdk-effdb8bbb018bd8a611b2ac86a15739f67ea7cbc.zip
dpdk-effdb8bbb018bd8a611b2ac86a15739f67ea7cbc.tar.gz
dpdk-effdb8bbb018bd8a611b2ac86a15739f67ea7cbc.tar.xz
app/testpmd: fix physical port socket initialization
Once the lcore list setting excluded the socket which physical device attached, it will cause failure. Meanwhile, it will disable Testpmd cross NUMA scenario. Fixes: dbfb8ec7094c ("app/testpmd: optimize mbuf pool allocation") Cc: stable@dpdk.org Signed-off-by: Phil Yang <phil.yang@arm.com> Reviewed-by: Gavin Hu <gavin.hu@arm.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'app')
-rw-r--r--app/test-pmd/testpmd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index cce5a97..404d8fe 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -565,9 +565,21 @@ set_default_fwd_ports_config(void)
portid_t pt_id;
int i = 0;
- RTE_ETH_FOREACH_DEV(pt_id)
+ RTE_ETH_FOREACH_DEV(pt_id) {
fwd_ports_ids[i++] = pt_id;
+ /* Update sockets info according to the attached device */
+ int socket_id = rte_eth_dev_socket_id(pt_id);
+ if (socket_id >= 0 && new_socket_id(socket_id)) {
+ if (num_sockets >= RTE_MAX_NUMA_NODES) {
+ rte_exit(EXIT_FAILURE,
+ "Total sockets greater than %u\n",
+ RTE_MAX_NUMA_NODES);
+ }
+ socket_ids[num_sockets++] = socket_id;
+ }
+ }
+
nb_cfg_ports = nb_ports;
nb_fwd_ports = nb_ports;
}