Re: [PATCH v6 2/2] app/testpmd: fix port stop
From: Iremonger, Bernard <hidden>
Date: 2017-02-03 10:37:32
Hi Jingjing
-----Original Message----- From: Wu, Jingjing Sent: Friday, February 3, 2017 8:22 AM To: Iremonger, Bernard <redacted>; dev@dpdk.org Cc: stable@dpdk.org Subject: RE: [PATCH v6 2/2] app/testpmd: fix port stopquoted
-----Original Message----- From: Iremonger, Bernard Sent: Friday, January 27, 2017 6:50 PM To: dev@dpdk.org; Wu, Jingjing <redacted> Cc: Iremonger, Bernard <redacted>;stable@dpdk.orgquoted
Subject: [PATCH v6 2/2] app/testpmd: fix port stop The rte_eth_dev_stop function is not called if the port_status is not RTE_PORT_STARTED. This can happen if the rte_eth_dev_start function is called directly, ie not through the start_port function. Make sure rte_eth_dev_stop is always called in stop_port function. Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings") CC: stable@dpdk.org Signed-off-by: Bernard Iremonger <redacted> --- app/test-pmd/testpmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index3d25436..0d7a4d4 100644--- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c@@ -1490,13 +1490,13 @@ stop_port(portid_t pid) continue; } + rte_eth_dev_stop(pi); + port = &ports[pi]; if (rte_atomic16_cmpset(&(port->port_status),RTE_PORT_STARTED, RTE_PORT_HANDLING) == 0) continue; - rte_eth_dev_stop(pi); -I don't think this fix is correct to move rte_eth_dev_stop above. We need to make sure rte_eth_dev_start is called in start_port. For vmdq configuration, You just need to change the configuration when port is stopped.
I think the stop_port() function should always stop the port even if the port_status is not correct for any reason. At present stop_port() returns without stopping the port if the port_status is not RTE_PORT_STARTED. The VMDq configuration is done whet the port is stopped, however to the complete the VMDq configuration the port must be started. Regards, Bernard.