From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id C90E21B488 for ; Thu, 22 Nov 2018 17:51:36 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 304AB882EA; Thu, 22 Nov 2018 16:51:36 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D63A1693A; Thu, 22 Nov 2018 16:51:34 +0000 (UTC) From: Kevin Traynor To: Phil Yang Cc: Gavin Hu , Ferruh Yigit , dpdk stable Date: Thu, 22 Nov 2018 16:49:03 +0000 Message-Id: <20181122164957.13003-11-ktraynor@redhat.com> In-Reply-To: <20181122164957.13003-1-ktraynor@redhat.com> References: <20181122164957.13003-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 22 Nov 2018 16:51:36 +0000 (UTC) Subject: [dpdk-stable] patch 'app/testpmd: fix vdev socket initialization' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:51:37 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/28/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From c9ffe9488bf80156fbe175bba519441a98bb92fe Mon Sep 17 00:00:00 2001 From: Phil Yang Date: Fri, 12 Oct 2018 17:34:55 +0800 Subject: [PATCH] app/testpmd: fix vdev socket initialization [ upstream commit 29841336438400ce040e394c0c00040c21644727 ] 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 --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") Signed-off-by: Phil Yang Reviewed-by: Gavin Hu Reviewed-by: Ferruh Yigit --- app/test-pmd/testpmd.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 51de403de..6808415f3 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -708,10 +708,4 @@ init_config(void) memset(port_per_socket,0,RTE_MAX_NUMA_NODES); - if (numa_support) { - memset(port_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); - memset(rxring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); - memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); - } - /* Configuration of logical cores. */ fwd_lcores = rte_zmalloc("testpmd: fwd_lcores", @@ -754,7 +748,10 @@ init_config(void) uint32_t socket_id = rte_eth_dev_socket_id(pid); - /* if socket_id is invalid, set to 0 */ + /* + * if socket_id is invalid, + * set to the first available socket. + */ if (check_socket_id(socket_id) < 0) - socket_id = 0; + socket_id = socket_ids[0]; port_per_socket[socket_id]++; } @@ -912,7 +909,10 @@ init_fwd_streams(void) port->socket_id = rte_eth_dev_socket_id(pid); - /* if socket_id is invalid, set to 0 */ + /* + * if socket_id is invalid, + * set to the first available socket. + */ if (check_socket_id(port->socket_id) < 0) - port->socket_id = 0; + port->socket_id = socket_ids[0]; } } @@ -2010,7 +2010,7 @@ attach_port(char *identifier) socket_id = (unsigned)rte_eth_dev_socket_id(pi); - /* if socket_id is invalid, set to 0 */ + /* if socket_id is invalid, set to the first available socket. */ if (check_socket_id(socket_id) < 0) - socket_id = 0; + socket_id = socket_ids[0]; reconfig(pi, socket_id); rte_eth_promiscuous_enable(pi); @@ -2651,4 +2651,9 @@ init_port(void) RTE_MAX_ETHPORTS); } + + /* Initialize ports NUMA structures */ + memset(port_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); + memset(rxring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); + memset(txring_numa, NUMA_NO_CONFIG, RTE_MAX_ETHPORTS); } -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-22 16:47:32.558863709 +0000 +++ 0011-app-testpmd-fix-vdev-socket-initialization.patch 2018-11-22 16:47:32.000000000 +0000 @@ -1,8 +1,10 @@ -From 29841336438400ce040e394c0c00040c21644727 Mon Sep 17 00:00:00 2001 +From c9ffe9488bf80156fbe175bba519441a98bb92fe Mon Sep 17 00:00:00 2001 From: Phil Yang Date: Fri, 12 Oct 2018 17:34:55 +0800 Subject: [PATCH] app/testpmd: fix vdev socket initialization +[ upstream commit 29841336438400ce040e394c0c00040c21644727 ] + 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 @@ -24,7 +26,6 @@ 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 Reviewed-by: Gavin Hu @@ -34,10 +35,10 @@ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c -index 5dbbf783f..cce5a9773 100644 +index 51de403de..6808415f3 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c -@@ -1022,10 +1022,4 @@ init_config(void) +@@ -708,10 +708,4 @@ init_config(void) memset(port_per_socket,0,RTE_MAX_NUMA_NODES); - if (numa_support) { @@ -48,7 +49,7 @@ - /* Configuration of logical cores. */ fwd_lcores = rte_zmalloc("testpmd: fwd_lcores", -@@ -1064,7 +1058,10 @@ init_config(void) +@@ -754,7 +748,10 @@ init_config(void) uint32_t socket_id = rte_eth_dev_socket_id(pid); - /* if socket_id is invalid, set to 0 */ @@ -61,7 +62,7 @@ + socket_id = socket_ids[0]; port_per_socket[socket_id]++; } -@@ -1222,7 +1219,10 @@ init_fwd_streams(void) +@@ -912,7 +909,10 @@ init_fwd_streams(void) port->socket_id = rte_eth_dev_socket_id(pid); - /* if socket_id is invalid, set to 0 */ @@ -74,7 +75,7 @@ + port->socket_id = socket_ids[0]; } } -@@ -2295,7 +2295,7 @@ attach_port(char *identifier) +@@ -2010,7 +2010,7 @@ attach_port(char *identifier) socket_id = (unsigned)rte_eth_dev_socket_id(pi); - /* if socket_id is invalid, set to 0 */ @@ -84,7 +85,7 @@ + socket_id = socket_ids[0]; reconfig(pi, socket_id); rte_eth_promiscuous_enable(pi); -@@ -2955,4 +2955,9 @@ init_port(void) +@@ -2651,4 +2651,9 @@ init_port(void) RTE_MAX_ETHPORTS); } +