[dpdk-dev] [PATCH] eal: rename --lcores option to --threads

2015-04-01 Thread Ananyev, Konstantin
Hi Thomas,

> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Tuesday, March 31, 2015 11:34 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] eal: rename --lcores option to --threads
> 
> Threads are no longer strictly assigned to a lcore with a 1:1 map.
> So they really should be called threads.
> The term lcore should be reserved for a physical hyperthreaded CPU part.
> 
> This patch only renames the option --lcores to avoid confusion from a
> user perspective. But a deeper cleanup should be done later in EAL:
> e.g. lcore_id should be renamed to thread_id.
> 

I don't see much point in such renaming.
As I remember, it was already discussed should we rename 'lcore' to 'lthread'
(or something similar) and the conclusion was to avoid that.
Such renaming would require too much changes across whole DPDK and external 
apps, and it seems no real benefit in doing that.
It seems much easier to document the new notion of 'lcore' means. 
Again probably 'lcore' is not a best name, but it was there for a while, and 
people get used to it.
While 'thread' seems a bit overloaded to me - not clear what exactly we mean 
here:
is it an EAL thread, is it just a pthread the user can create on its will?   

Konstantin

> Signed-off-by: Thomas Monjalon 
> ---
>  app/test/test_eal_flags.c   | 34 -
>  doc/guides/prog_guide/env_abstraction_layer.rst | 25 ---
>  doc/guides/testpmd_app_ug/run_app.rst   | 10 +--
>  lib/librte_eal/common/eal_common_options.c  | 96 
> -
>  lib/librte_eal/common/eal_options.h |  4 +-
>  5 files changed, 84 insertions(+), 85 deletions(-)
> 
> diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
> index 0352f87..1096bea 100644
> --- a/app/test/test_eal_flags.c
> +++ b/app/test/test_eal_flags.c
> @@ -512,7 +512,7 @@ test_missing_c_flag(void)
> 
>   /* -c flag but no coremask value */
>   const char *argv1[] = { prgname, prefix, mp_flag, "-n", "3", "-c"};
> - /* No -c, -l or --lcores flag at all */
> + /* No -c, -l or --threads flag at all */
>   const char *argv2[] = { prgname, prefix, mp_flag, "-n", "3"};
>   /* bad coremask value */
>   const char *argv3[] = { prgname, prefix, mp_flag,
> @@ -538,37 +538,37 @@ test_missing_c_flag(void)
>   const char *argv11[] = { prgname, prefix, mp_flag,
>"-n", "3", "-l", "1-2,3" };
> 
> - /* --lcores flag but no lcores value */
> + /* --threads flag but no lcores value */
>   const char *argv12[] = { prgname, prefix, mp_flag,
> -  "-n", "3", "--lcores" };
> +  "-n", "3", "--threads" };
>   const char *argv13[] = { prgname, prefix, mp_flag,
> -  "-n", "3", "--lcores", " " };
> +  "-n", "3", "--threads", " " };
>   /* bad lcores value */
>   const char *argv14[] = { prgname, prefix, mp_flag,
> -  "-n", "3", "--lcores", "1-3-5" };
> +  "-n", "3", "--threads", "1-3-5" };
>   const char *argv15[] = { prgname, prefix, mp_flag,
> -  "-n", "3", "--lcores", "0-1,,2" };
> +  "-n", "3", "--threads", "0-1,,2" };
>   const char *argv16[] = { prgname, prefix, mp_flag,
> -  "-n", "3", "--lcores", "0-,1" };
> +  "-n", "3", "--threads", "0-,1" };
>   const char *argv17[] = { prgname, prefix, mp_flag,
> -  "-n", "3", "--lcores", "(0-,2-4)" };
> +  "-n", "3", "--threads", "(0-,2-4)" };
>   const char *argv18[] = { prgname, prefix, mp_flag,
> -  "-n", "3", "--lcores", "(-1,2)" };
> +  "-n", "3", "--threads", "(-1,2)" };
>   const char *argv19[] = { prgname, prefix, mp_flag,
> -  "-n", "3", "--lcores", "(2-4)@(2-4-6)" };
> +   

[dpdk-dev] [PATCH] eal: rename --lcores option to --threads

2015-04-01 Thread Thomas Monjalon
Threads are no longer strictly assigned to a lcore with a 1:1 map.
So they really should be called threads.
The term lcore should be reserved for a physical hyperthreaded CPU part.

This patch only renames the option --lcores to avoid confusion from a
user perspective. But a deeper cleanup should be done later in EAL:
e.g. lcore_id should be renamed to thread_id.

Signed-off-by: Thomas Monjalon 
---
 app/test/test_eal_flags.c   | 34 -
 doc/guides/prog_guide/env_abstraction_layer.rst | 25 ---
 doc/guides/testpmd_app_ug/run_app.rst   | 10 +--
 lib/librte_eal/common/eal_common_options.c  | 96 -
 lib/librte_eal/common/eal_options.h |  4 +-
 5 files changed, 84 insertions(+), 85 deletions(-)

diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 0352f87..1096bea 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -512,7 +512,7 @@ test_missing_c_flag(void)

/* -c flag but no coremask value */
const char *argv1[] = { prgname, prefix, mp_flag, "-n", "3", "-c"};
-   /* No -c, -l or --lcores flag at all */
+   /* No -c, -l or --threads flag at all */
const char *argv2[] = { prgname, prefix, mp_flag, "-n", "3"};
/* bad coremask value */
const char *argv3[] = { prgname, prefix, mp_flag,
@@ -538,37 +538,37 @@ test_missing_c_flag(void)
const char *argv11[] = { prgname, prefix, mp_flag,
 "-n", "3", "-l", "1-2,3" };

-   /* --lcores flag but no lcores value */
+   /* --threads flag but no lcores value */
const char *argv12[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores" };
+"-n", "3", "--threads" };
const char *argv13[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", " " };
+"-n", "3", "--threads", " " };
/* bad lcores value */
const char *argv14[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "1-3-5" };
+"-n", "3", "--threads", "1-3-5" };
const char *argv15[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "0-1,,2" };
+"-n", "3", "--threads", "0-1,,2" };
const char *argv16[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "0-,1" };
+"-n", "3", "--threads", "0-,1" };
const char *argv17[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "(0-,2-4)" };
+"-n", "3", "--threads", "(0-,2-4)" };
const char *argv18[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "(-1,2)" };
+"-n", "3", "--threads", "(-1,2)" };
const char *argv19[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "(2-4)@(2-4-6)" };
+"-n", "3", "--threads", "(2-4)@(2-4-6)" };
const char *argv20[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "(a,2)" };
+"-n", "3", "--threads", "(a,2)" };
const char *argv21[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "1-3@(1,3)" };
+"-n", "3", "--threads", "1-3@(1,3)" };
const char *argv22[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "3@((1,3)" };
+"-n", "3", "--threads", "3@((1,3)" };
const char *argv23[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "(4-7)=(1,3)" };
+"-n", "3", "--threads", "(4-7)=(1,3)" };
const char *argv24[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores", "[4-7]@(1,3)" };
+"-n", "3", "--threads", "[4-7]@(1,3)" };
/* sanity check of tests - valid lcores value */
const char *argv25[] = { prgname, prefix, mp_flag,
-"-n", "3", "--lcores",
+"-n", "3", "--threads",
 "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"};

if (launch_proc(argv1) == 0
@@ -601,7 +601,7 @@ test_missing_c_flag(void)
return -1;
}

-   /* start --lcores tests */
+   /* start --threads tests */
if (launch_proc(argv12) == 0 || launch_proc(argv13) == 0 ||
launch_proc(argv14) == 0 || launch_proc(argv15) == 0 ||
launch_proc(argv16) == 0 || launch_proc(argv17) == 0 ||
diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst