eal: fix logs for '--lcores'

Message ID 20240613161429.168287-1-ktraynor@redhat.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series eal: fix logs for '--lcores' |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Kevin Traynor June 13, 2024, 4:14 p.m. UTC
  The argument is '--lcores' but it is being logged as '--lcore'
in several places.

e.g.
$ dpdk-testpmd -l 8,10,12 --lcores 8,10,12
EAL: Option --lcore is ignored, because (-l) is set!

Fix the spelling in logs and tests.

Fixes: 117eaa70584b ("eal: add error check for core options")
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 app/test/test_eal_flags.c           | 2 +-
 lib/eal/common/eal_common_options.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
  

Comments

David Marchand June 13, 2024, 4:20 p.m. UTC | #1
On Thu, Jun 13, 2024 at 6:14 PM Kevin Traynor <ktraynor@redhat.com> wrote:
>
> The argument is '--lcores' but it is being logged as '--lcore'
> in several places.
>
> e.g.
> $ dpdk-testpmd -l 8,10,12 --lcores 8,10,12
> EAL: Option --lcore is ignored, because (-l) is set!
>
> Fix the spelling in logs and tests.
>
> Fixes: 117eaa70584b ("eal: add error check for core options")
and Fixes: 128ee4c26d87 ("app/test: add unit tests for --lcores
option") (but no need for a v2 for this).

> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>
Thanks for the quick fix.
  
David Marchand June 17, 2024, 2:37 p.m. UTC | #2
On Thu, Jun 13, 2024 at 6:20 PM David Marchand
<david.marchand@redhat.com> wrote:
> On Thu, Jun 13, 2024 at 6:14 PM Kevin Traynor <ktraynor@redhat.com> wrote:
> >
> > The argument is '--lcores' but it is being logged as '--lcore'
> > in several places.
> >
> > e.g.
> > $ dpdk-testpmd -l 8,10,12 --lcores 8,10,12
> > EAL: Option --lcore is ignored, because (-l) is set!
> >
> > Fix the spelling in logs and tests.
> >
> > Fixes: 117eaa70584b ("eal: add error check for core options")
> Fixes: 128ee4c26d87 ("app/test: add unit tests for --lcores option")
>
> > Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.
  

Patch

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 6cb4b06757..71d8dba731 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -672,5 +672,5 @@  test_missing_c_flag(void)
 	    launch_proc(argv28) == 0 || launch_proc(argv30) == 0) {
 		printf("Error - "
-		       "process ran without error with invalid --lcore flag\n");
+		       "process ran without error with invalid --lcores flag\n");
 		return -1;
 	}
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index e541f07939..f1a5e329a5 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -1688,5 +1688,5 @@  eal_parse_common_option(int opt, const char *optarg,
 			EAL_LOG(ERR, "Option -c is ignored, because (%s) is set!",
 				(core_parsed == LCORE_OPT_LST) ? "-l" :
-				(core_parsed == LCORE_OPT_MAP) ? "--lcore" :
+				(core_parsed == LCORE_OPT_MAP) ? "--lcores" :
 				"-c");
 			return -1;
@@ -1721,5 +1721,5 @@  eal_parse_common_option(int opt, const char *optarg,
 			EAL_LOG(ERR, "Option -l is ignored, because (%s) is set!",
 				(core_parsed == LCORE_OPT_MSK) ? "-c" :
-				(core_parsed == LCORE_OPT_MAP) ? "--lcore" :
+				(core_parsed == LCORE_OPT_MAP) ? "--lcores" :
 				"-l");
 			return -1;
@@ -1902,8 +1902,8 @@  eal_parse_common_option(int opt, const char *optarg,
 
 		if (core_parsed) {
-			EAL_LOG(ERR, "Option --lcore is ignored, because (%s) is set!",
+			EAL_LOG(ERR, "Option --lcores is ignored, because (%s) is set!",
 				(core_parsed == LCORE_OPT_LST) ? "-l" :
 				(core_parsed == LCORE_OPT_MSK) ? "-c" :
-				"--lcore");
+				"--lcores");
 			return -1;
 		}