This patch fixed the reset function to avoid crash when user don't
call port reset , port stop and port start functions as sequence.

Fixes: 97f1e19679 ("app/testpmd: add port reset command")
Cc: sta...@dpdk.org

Signed-off-by: Wang ShougangX <shougangx.w...@intel.com>
---
 app/test-pmd/testpmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e8e2a39b6..273a7aa02 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2344,6 +2344,9 @@ reset_port(portid_t pid)
        if (port_id_is_invalid(pid, ENABLED_WARN))
                return;
 
+       printf("Stopping ports...\n");
+       stop_port(pid);
+
        printf("Resetting ports...\n");
 
        RTE_ETH_FOREACH_DEV(pi) {
@@ -2372,6 +2375,9 @@ reset_port(portid_t pid)
                }
        }
 
+       printf("Starting ports...\n");
+       start_port(pid);
+
        printf("Done\n");
 }
 
-- 
2.17.1

Reply via email to