test: test zero socket-mem as valid
A message that is not in the archive (sent off-list or not yet received): CGME20190125075604eucas1p2ecf0177c3f953e889721d784ef387254@eucas1p2.samsung.com
PATCH 1/1 test: test zero socket-mem as valid
Dynamic memory mode allowes zero socket-mem because all the required memory could be allocated on demand.
--- test/test/test_eal_flags.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
test/test/test_eal_flags.c +3 -3
@@ -1158,7 +1158,7 @@ test_memory_flags(void)const char *argv1[] = {prgname,"-c" ,"10" ,"-n" ,"2" ,"--file-prefix=" memtest,"-m" ,DEFAULT_MEM_SIZE }; -/* invalid (zero) --socket-mem flag */ +/* valid (zero) --socket-mem flag */ const char *argv2[] = {prgname,"-c" ,"10" ,"-n" ,"2" ,"--file-prefix=" memtest,"--socket-mem=0,0,0,0" };
@@ -1256,8 +1256,8 @@ test_memory_flags(void)printf ("Error - process failed with valid -m flag!\n" );return -1 ; } -if (launch_proc (argv2) ==0 ) { -printf ("Error - process run ok with invalid (zero) --socket-mem!\n" ); +if (launch_proc (argv2) !=0 ) { +printf ("Error - process failed with valid (zero) --socket-mem!\n" );return -1 ; }
Signature · 1 line
2.17.1
Quoted 6 lines · Ilya Maximets
Dynamic memory mode allowes zero socket-mem because all the required memory could be allocated on demand.
Fixes 339c2244b4f1 ("eal: fix parsing zero socket memory and limits")
Quoted 30 lines
Signed-off-by Ilya Maximets <[email protected]>--- test/test/test_eal_flags.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)test/test/test_eal_flags.c +3
-3@@ -1158,7 +1158,7 @@ test_memory_flags(void)const char *argv1[] = {prgname,"-c" ,"10" ,"-n" ,"2" ,"--file-prefix=" memtest,"-m" ,DEFAULT_MEM_SIZE }; -/* invalid (zero) --socket-mem flag */ +/* valid (zero) --socket-mem flag */ const char *argv2[] = {prgname,"-c" ,"10" ,"-n" ,"2" ,"--file-prefix=" memtest,"--socket-mem=0,0,0,0" };@@ -1256,8 +1256,8 @@ test_memory_flags(void)printf ("Error - process failed with valid -m flag!\n" );return -1 ; } -if (launch_proc (argv2) ==0 ) { -printf ("Error - process run ok with invalid (zero) --socket-mem!\n" ); +if (launch_proc (argv2) !=0 ) { +printf ("Error - process failed with valid (zero) --socket-mem!\n" );return -1 ; }
David Marchand
Reviewed-byQuoted 36 lines · Ilya Maximets
Quoted 6 lines · Ilya Maximets
Dynamic memory mode allowes zero socket-mem because all the required memory could be allocated on demand.
Fixes 339c2244b4f1 ("eal: fix parsing zero socket memory and limits")Reported-by Shuai Zhu <[email protected]>Quoted 1 line
Signed-off-by Ilya Maximets <[email protected]>---
Quoted 17 lines
test/test/test_eal_flags.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)test/test/test_eal_flags.c +1
-1@@ -1158,7 +1158,7 @@ test_memory_flags(void)const char *argv1[] = {prgname,"-c" ,"10" ,"-n" ,"2" ,"--file-prefix=" memtest,"-m" ,DEFAULT_MEM_SIZE }; -/* invalid (zero) --socket-mem flag */ +/* valid (zero) --socket-mem flag */ const char *argv2[] = {prgname,"-c" ,"10" ,"-n" ,"2" ,"--file-prefix=" memtest,"--socket-mem=0,0,0,0" };test/test/test_eal_flags.c test_memory_flags(void) · line 1260
Quoted 5 lines
test/test/test_eal_flags.c +0
-2@@ -1256,8 +1256,8 @@ test_memory_flags(void)printf ("Error - process failed with valid -m flag!\n" );return -1 ; } -if (launch_proc (argv2) ==0 ) { - printf("Error - process run ok with invalid (zero)--socket-mem!\n");
Quoted 8 lines
test/test/test_eal_flags.c test_memory_flags(void) · line 1260
Quoted 2 lines
test/test/test_eal_flags.c +2
-0+if (launch_proc (argv2) !=0 ) { + printf("Error - process failed with valid (zero)--socket-mem!\n");
Quoted 4 lines
test/test/test_eal_flags.c +0
-0return -1 ; }
Signature · 1 line
David Marchand
Quoted 54 lines · David Marchand
On Fri, Jan 25, 2019 at 9:06 AM Ilya Maximets <[email protected] <mailto:[email protected]>> wrote:
On 25.01.2019 10:55, Ilya Maximets wrote: > Dynamic memory mode allowes zero socket-mem because all the > required memory could be allocated on demand. > > Fixes: 339c2244b4f1 ("eal: fix parsing zero socket memory and limits") > Cc: [email protected] <mailto:[email protected]> > Reported-by: Shuai Zhu <[email protected] <mailto:[email protected]>> > Signed-off-by: Ilya Maximets <[email protected] <mailto:[email protected]>> > --- > test/test/test_eal_flags.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c > index e3a60c7ae..81e345b87 100644 > --- a/test/test/test_eal_flags.c > +++ b/test/test/test_eal_flags.c > @@ -1158,7 +1158,7 @@ test_memory_flags(void) > const char *argv1[] = {prgname, "-c", "10", "-n", "2", > "--file-prefix=" memtest, "-m", DEFAULT_MEM_SIZE}; > > - /* invalid (zero) --socket-mem flag */ > + /* valid (zero) --socket-mem flag */ > const char *argv2[] = {prgname, "-c", "10", "-n", "2", > "--file-prefix=" memtest, "--socket-mem=0,0,0,0"}; > > @@ -1256,8 +1256,8 @@ test_memory_flags(void) > printf("Error - process failed with valid -m flag!\n"); > return -1; > } > - if (launch_proc(argv2) == 0) { > - printf("Error - process run ok with invalid (zero) --socket-mem!\n"); > + if (launch_proc(argv2) != 0) { > + printf("Error - process failed with valid (zero) --socket-mem!\n"); > return -1; > } > >
Quoted 5 lines
Reviewed-by David Marchand <[email protected] <mailto:[email protected]>>Signature · 1 line
David Marchand
Now that i think of it, maybe it's not that simple.
--socket-mem/-m flag with zero is still an invalid value *if* --legacy-mem is involved. However, it is a valid value in non-legacy mode.
So maybe the test should reflect this, and the previous fix should have instead added a check for legacy mode rather than disabling the zero check outright.
Signature · 2 lines
Thanks, Anatoly
Quoted 58 lines · Anatoly
Quoted 57 lines · David Marchand
On Fri, Jan 25, 2019 at 9:06 AM Ilya Maximets <[email protected] <mailto:[email protected]>> wrote:
On 25.01.2019 10:55, Ilya Maximets wrote:
> Dynamic memory mode allowes zero socket-mem because all the > required memory could be allocated on demand.
>
> Fixes:339c2244b4f1("eal: fix parsing zero socket memory and limits")
> Cc: [email protected] <mailto:[email protected]>
>Reported-by Shuai Zhu <[email protected]<mailto:[email protected]>>
> Signed-off-by: Ilya Maximets <[email protected] <mailto:[email protected]>>
> ---
>test/test/test_eal_flags.c| 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --gita/test/test/test_eal_flags.cb/test/test/test_eal_flags.c> indexe3a60c7ae..81e345b87100644
> ---a/test/test/test_eal_flags.c
> +++b/test/test/test_eal_flags.c
> @@ -1158,7 +1158,7 @@test_memory_flags(void)
> const char *argv1[] = {prgname, "-c", "10", "-n", "2", > "--file-prefix=" memtest, "-m",DEFAULT_MEM_SIZE};
>
> - /* invalid (zero) --socket-mem flag */
> + /* valid (zero) --socket-mem flag */
> const char *argv2[] = {prgname, "-c", "10", "-n", "2", > "--file-prefix=" memtest, "--socket-mem=0,0,0,0"};
>
> @@ -1256,8 +1256,8 @@test_memory_flags(void)
> printf("Error - process failed with valid -m flag!\n"); > return -1;
> }
> - if (launch_proc(argv2)== 0) {
> - printf("Error - process run ok with invalid (zero) --socket-mem!\n");
> + if (launch_proc(argv2)!= 0) {
> + printf("Error - process failed with valid (zero) --socket-mem!\n");
> return -1;
> }
>
>Reviewed-by David Marchand <[email protected] <mailto:[email protected]>>
Quoted 9 lines
Quoted 2 lines
--
David MarchandNow that i think of it, maybe it's not that simple.
--socket-mem/-m flag with zero is still an invalid value *if* --legacy-mem is involved. However, it is a valid value in non-legacy mode.
So maybe the test should reflect this, and the previous fix should have instead added a check for legacy mode rather than disabling the zero check outright.
I don't think that it's a big deal, because "--socket-mem=0 --legacy-mem" quickly fails with clear:
EAL: WARNING: Master core has no memory on local socket!
IMHO, It's actually more informative than previous:
EAL: invalid parameters for --socket-limit
I agree that we could add a test for a legacy-mem cases, but that's a bit different task.
Burakov, Anatoly
Acked-byQuoted 72 lines · Ilya Maximets
Quoted 58 lines · Anatoly
Quoted 57 lines · David Marchand
On Fri, Jan 25, 2019 at 9:06 AM Ilya Maximets <[email protected] <mailto:[email protected]>> wrote:
On 25.01.2019 10:55, Ilya Maximets wrote:
> Dynamic memory mode allowes zero socket-mem because all the > required memory could be allocated on demand.
>
> Fixes:339c2244b4f1("eal: fix parsing zero socket memory and limits")
> Cc: [email protected] <mailto:[email protected]>
>Reported-by Shuai Zhu <[email protected]<mailto:[email protected]>>
> Signed-off-by: Ilya Maximets <[email protected] <mailto:[email protected]>>
> ---
> test/test/test_eal_flags.c | 6 +++---> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --gita/test/test/test_eal_flags.cb/test/test/test_eal_flags.c> indexe3a60c7ae..81e345b87100644
> ---a/test/test/test_eal_flags.c
> +++b/test/test/test_eal_flags.c
> @@ -1158,7 +1158,7 @@test_memory_flags(void)
> const char *argv1[] = {prgname, "-c", "10", "-n", "2", > "--file-prefix=" memtest, "-m",DEFAULT_MEM_SIZE};
>
> - /* invalid (zero) --socket-mem flag */
> + /* valid (zero) --socket-mem flag */
> const char *argv2[] = {prgname, "-c", "10", "-n", "2", > "--file-prefix=" memtest, "--socket-mem=0,0,0,0"};
>
> @@ -1256,8 +1256,8 @@test_memory_flags(void)
> printf("Error - process failed with valid -m flag!\n"); > return -1;
> }
> - if (launch_proc(argv2)== 0) {
> - printf("Error - process run ok with invalid (zero) --socket-mem!\n");
> + if (launch_proc(argv2)!= 0) {
> + printf("Error - process failed with valid (zero) --socket-mem!\n");
> return -1;
> }
>
>Reviewed-by David Marchand <[email protected] <mailto:[email protected]>>Quoted 9 lines
Quoted 2 lines
Signature · 1 line
David MarchandNow that i think of it, maybe it's not that simple.
--socket-mem/-m flag with zero is still an invalid value *if* --legacy-mem is involved. However, it is a valid value in non-legacy mode.
So maybe the test should reflect this, and the previous fix should have instead added a check for legacy mode rather than disabling the zero check outright.
I don't think that it's a big deal, because "--socket-mem=0 --legacy-mem" quickly fails with clear:
Quoted 9 lines
EAL: WARNING: Master core has no memory on local socket!
IMHO, It's actually more informative than previous:
EAL: invalid parameters for --socket-limitI agree that we could add a test for a legacy-mem cases, but that's a bit different task.
Good point. Maybe leave it as is then :)
Signature · 2 lines
Thanks, Anatoly
Thomas Monjalon
Applied25/01/2019 15:12, Burakov, Anatoly:
Quoted 20 lines · Ilya Maximets
Quoted 19 lines · Anatoly
Quoted 10 lines · David Marchand
Quoted 2 lines
Reviewed-by David Marchand <[email protected] <mailto:[email protected]>>Now that i think of it, maybe it's not that simple.
--socket-mem/-m flag with zero is still an invalid value *if* --legacy-mem is involved. However, it is a valid value in non-legacy mode.
So maybe the test should reflect this, and the previous fix should have instead added a check for legacy mode rather than disabling the zero check outright.
I don't think that it's a big deal, because "--socket-mem=0 --legacy-mem" quickly fails with clear:
EAL: WARNING: Master core has no memory on local socket!
IMHO, It's actually more informative than previous:
Quoted 8 lines
Quoted 4 lines
EAL: invalid parameters for --socket-limitI agree that we could add a test for a legacy-mem cases, but that's a bit different task.
Good point. Maybe leave it as is then :)
Acked-by Anatoly Burakov <[email protected]>
Applied, thanks