On 25-Jan-19 9:53 AM, David Marchand wrote:
On Fri, Jan 25, 2019 at 9:06 AM Ilya Maximets <i.maxim...@samsung.com
<mailto:i.maxim...@samsung.com>> 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: sta...@dpdk.org <mailto:sta...@dpdk.org>
>
Reported-by: Shuai Zhu <shuaix....@intel.com
<mailto:shuaix....@intel.com>>
> Signed-off-by: Ilya Maximets <i.maxim...@samsung.com
<mailto:i.maxim...@samsung.com>>
> ---
> 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;
> }
>
>
Reviewed-by: David Marchand <david.march...@redhat.com
<mailto:david.march...@redhat.com>>
--
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.
--
Thanks,
Anatoly