DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix physic port socket initialization
@ 2018-10-16 10:14 Phil Yang
  2018-10-16 10:40 ` Ananyev, Konstantin
  2018-10-17  1:36 ` [dpdk-dev] [PATCH v2] " Phil Yang
  0 siblings, 2 replies; 7+ messages in thread
From: Phil Yang @ 2018-10-16 10:14 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, nd

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 <phil.yang@arm.com>
Reviewed-by: Gavin Hu <Gavin.Hu@arm.com>
---
 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-18  2:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-16 10:14 [dpdk-dev] [PATCH] app/testpmd: fix physic port socket initialization Phil Yang
2018-10-16 10:40 ` Ananyev, Konstantin
2018-10-17  1:41   ` Phil Yang (Arm Technology China)
2018-10-17  1:36 ` [dpdk-dev] [PATCH v2] " Phil Yang
2018-10-17 11:02   ` Ananyev, Konstantin
2018-10-17 13:04     ` Ferruh Yigit
2018-10-18  2:37       ` Phil Yang (Arm Technology China)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).