From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dmarchan@redhat.com>
Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com
 [209.85.217.51]) by dpdk.org (Postfix) with ESMTP id 866431B614
 for <dev@dpdk.org>; Fri, 11 Jan 2019 16:07:03 +0100 (CET)
Received: by mail-vs1-f51.google.com with SMTP id b74so9373063vsd.9
 for <dev@dpdk.org>; Fri, 11 Jan 2019 07:07:03 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=GcCJ3AVfE8piO52yjKWhnfi40mFh0temUYqWO3f8F7M=;
 b=pEw1p4KoYI6hk2WTqH555FKk1IbNFdz/nH9mh8K3GnQ8jjGrPFhZ7U8jjxhop+2Tvz
 4faNtVHxg9PIyxXuQz4yGYHnK+hTPuxtFypxGV/8T8Jb4ODJpkwun9PHNS61z2fv1cu6
 r3BUfa3ztp7ti8qXpIXOZPmMLRNxcZ7IsksEhDm/0fh/ZGiq0cnor0dyJG48cJkDF2YW
 7zMMnm6uHHpIRwFdxO7VIMTeBDysNN3Ts6RDw9UskgtlIt+tAlsl7DB6vm/1Tqo3SYLg
 6UIunqBuq1Pa/8DF0koTnTisPOZ+STg4fUxpPPVjJvZWCOWNv7V5MseARhv4X7ndMv2K
 rA4Q==
X-Gm-Message-State: AJcUukdrAEGcvhFl34RzVfWDmy8hAK+dpanrzDPneYMmXvL0i9YVGW9t
 qpSnDTlv6SDBoVm5mfE+v0jkGEUesSaAc7/dQ7D+Cg==
X-Google-Smtp-Source: ALg8bN7/MbsdcvttPeYClAFpqem9cbL0FW3N31llacYanPIwtcbgAKzFl/NpicaVZwM07bzG+VRGOaMJCoIcBikw0Nw=
X-Received: by 2002:a67:2045:: with SMTP id g66mr6116605vsg.180.1547219222768; 
 Fri, 11 Jan 2019 07:07:02 -0800 (PST)
MIME-Version: 1.0
References: <1546518487-9942-1-git-send-email-hari.kumarx.vemula@intel.com>
 <1547216106-13680-1-git-send-email-hari.kumarx.vemula@intel.com>
In-Reply-To: <1547216106-13680-1-git-send-email-hari.kumarx.vemula@intel.com>
From: David Marchand <david.marchand@redhat.com>
Date: Fri, 11 Jan 2019 16:06:50 +0100
Message-ID: <CAJFAV8wsGUf0rNJK1N_EMe0TBjgn2at+x+1dJ1_Xhn4ySvFAvQ@mail.gmail.com>
To: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Cc: dev@dpdk.org, "Yigit, Ferruh" <ferruh.yigit@intel.com>,
 reshma.pattan@intel.com, 
 jananeex.m.parthasarathy@intel.com, dpdk stable <stable@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: Re: [dpdk-dev] [PATCH v4] eal: fix core number validation
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 11 Jan 2019 15:07:03 -0000

On Fri, Jan 11, 2019 at 3:15 PM Hari Kumar Vemula <
hari.kumarx.vemula@intel.com> wrote:

>
> diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c
> index 2acab9d69..fc45bf953 100644
> --- a/test/test/test_eal_flags.c
> +++ b/test/test/test_eal_flags.c
> @@ -18,6 +18,7 @@
>  #include <sys/file.h>
>  #include <limits.h>
>
> +#include <rte_per_lcore.h>
>  #include <rte_debug.h>
>  #include <rte_string_fns.h>
>
> @@ -513,6 +514,16 @@ test_missing_c_flag(void)
>         const char *argv25[] = { prgname, prefix, mp_flag,
>                                  "-n", "3", "--lcores",
>                                  "0-1,2@(5-7),(3-5)@(0,2),(0,6),7"};
>
+       /* core number is negative value */
> +       const char * const argv26[] = { prgname, prefix, mp_flag,
> +                               "-n", "3", "--lcores", "-5" };
> +       const char * const argv27[] = { prgname, prefix, mp_flag,
> +                               "-n", "3", "--lcores", "-5-7" };
>

I did not see this before, but you fixed the "-l" eal option, not
"--lcores" option.
So those unit tests are wrong.



> +       /* core number is maximum value */
> +       const char * const argv28[] = { prgname, prefix, mp_flag,
> +                               "-n", "3", "--lcores", "RTE_MAX_LCORE+1" };
> +       const char * const argv29[] = { prgname, prefix, mp_flag,
> +                               "-n", "3", "--lcores",
> "1-(RTE_MAX_LCORE+1)" };
>
>         if (launch_proc(argv2) != 0) {
>                 printf("Error - "
>

Passing "RTE_MAX_LCORE+1" is indeed wrong (be it with "-l" or "--lcores"
options), but I would still prefer to check the formatted value of
RTE_MAX_LCORE (no need for that +1, btw).
So please, in next version, test against "-l", RTE_STR(RTE_MAX_LCORE) and
"-l", "1-" RTE_STR(RTE_MAX_LCORE).


Thanks.

-- 
David Marchand