Rather than silently ignore an invalid value, raise an error for
stats-period user input.

Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically")
Cc: sta...@dpdk.org

Signed-off-by: David Marchand <david.march...@redhat.com>
---
 app/test-pmd/parameters.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 11b0cce577..d715750bb8 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -776,7 +776,7 @@ launch_args_parse(int argc, char** argv)
                                n = strtoul(optarg, &end, 10);
                                if ((optarg[0] == '\0') || (end == NULL) ||
                                                (*end != '\0'))
-                                       break;
+                                       rte_exit(EXIT_FAILURE, "Invalid 
stats-period value\n");
 
                                stats_period = n;
                                break;
-- 
2.44.0

Reply via email to