From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 98C92160 for ; Tue, 16 Oct 2018 12:15:05 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CFD76341; Tue, 16 Oct 2018 03:15:04 -0700 (PDT) Received: from phil-VirtualBox.shanghai.arm.com (unknown [10.169.107.186]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2D1053F59C; Tue, 16 Oct 2018 03:15:04 -0700 (PDT) From: Phil Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, nd@arm.com Date: Tue, 16 Oct 2018 18:14:52 +0800 Message-Id: <1539684892-19831-1-git-send-email-phil.yang@arm.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] app/testpmd: fix physic port socket initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 10:15:05 -0000 Once the lcore list setting excluded the socket which physic device attached, it will cause failure. Meanwhile, it will disable Testpmd cross NUMA scenario. Fixes: dbfb8ec ("app/testpmd: optimize mbuf pool allocation") Signed-off-by: Phil Yang Reviewed-by: Gavin Hu --- app/test-pmd/testpmd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 5dbbf78..4739ddb 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(pt_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; } -- 2.7.4