[dpdk-stable] patch 'app/testpmd: fix vdev socket initialization' has been queued to LTS release 17.11.5
Yongseok Koh
yskoh at mellanox.com
Fri Nov 30 00:11:00 CET 2018
Hi,
FYI, your patch has been queued to LTS release 17.11.5
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/01/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.
Yongseok
---
>From a913869db7339a40e41f5c67f3dfdca73d1bc81b Mon Sep 17 00:00:00 2001
From: Phil Yang <phil.yang at arm.com>
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 <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")
Signed-off-by: Phil Yang <phil.yang at arm.com>
Reviewed-by: Gavin Hu <gavin.hu at arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
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 7c4c5820d..5d6a7f5d4 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -674,12 +674,6 @@ 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",
sizeof(struct fwd_lcore *) * nb_lcores,
@@ -709,9 +703,12 @@ init_config(void)
else {
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]++;
}
}
@@ -845,9 +842,12 @@ init_fwd_streams(void)
else {
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];
}
}
else {
@@ -1896,9 +1896,9 @@ attach_port(char *identifier)
return;
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);
@@ -2464,6 +2464,11 @@ init_port(void)
"rte_zmalloc(%d struct rte_port) failed\n",
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);
}
static void
--
2.11.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2018-11-29 15:01:48.140656021 -0800
+++ 0066-app-testpmd-fix-vdev-socket-initialization.patch 2018-11-29 15:01:45.170963000 -0800
@@ -1,8 +1,10 @@
-From 29841336438400ce040e394c0c00040c21644727 Mon Sep 17 00:00:00 2001
+From a913869db7339a40e41f5c67f3dfdca73d1bc81b Mon Sep 17 00:00:00 2001
From: Phil Yang <phil.yang at arm.com>
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 at dpdk.org
Signed-off-by: Phil Yang <phil.yang at arm.com>
Reviewed-by: Gavin Hu <gavin.hu at arm.com>
@@ -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 7c4c5820d..5d6a7f5d4 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
-@@ -1021,12 +1021,6 @@ init_config(void)
+@@ -674,12 +674,6 @@ init_config(void)
memset(port_per_socket,0,RTE_MAX_NUMA_NODES);
@@ -50,7 +51,7 @@
/* Configuration of logical cores. */
fwd_lcores = rte_zmalloc("testpmd: fwd_lcores",
sizeof(struct fwd_lcore *) * nb_lcores,
-@@ -1063,9 +1057,12 @@ init_config(void)
+@@ -709,9 +703,12 @@ init_config(void)
else {
uint32_t socket_id = rte_eth_dev_socket_id(pid);
@@ -65,7 +66,7 @@
port_per_socket[socket_id]++;
}
}
-@@ -1221,9 +1218,12 @@ init_fwd_streams(void)
+@@ -845,9 +842,12 @@ init_fwd_streams(void)
else {
port->socket_id = rte_eth_dev_socket_id(pid);
@@ -80,7 +81,7 @@
}
}
else {
-@@ -2294,9 +2294,9 @@ attach_port(char *identifier)
+@@ -1896,9 +1896,9 @@ attach_port(char *identifier)
return;
socket_id = (unsigned)rte_eth_dev_socket_id(pi);
@@ -92,7 +93,7 @@
reconfig(pi, socket_id);
rte_eth_promiscuous_enable(pi);
-@@ -2954,6 +2954,11 @@ init_port(void)
+@@ -2464,6 +2464,11 @@ init_port(void)
"rte_zmalloc(%d struct rte_port) failed\n",
RTE_MAX_ETHPORTS);
}
More information about the stable
mailing list