From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 6244843C9F;
	Wed, 13 Mar 2024 12:13:20 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 9C97142D72;
	Wed, 13 Mar 2024 12:13:19 +0100 (CET)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.133.124])
 by mails.dpdk.org (Postfix) with ESMTP id 1F79A40EE2
 for <dev@dpdk.org>; Wed, 13 Mar 2024 12:13:18 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1710328397;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=XIUfkUWhZlelSPe3jLCrEqwb6ka6YBzjuqHED9qVJZM=;
 b=Ot2ni/OZynAhw84Gbkhbzy4MNpCu8/uk+2CQ8M3/Fzsbts2pEpoidLuXmJ5S6Y+yPYhgyx
 pwcXZGR0BX1/rOa+TSmWMAspvIyllUyMUF4AutS+yvXWYiK5vqJCQPreUxF1oCDK2shtpX
 eHvogLdU0xSoQ9u4AYwAmURO688MhlA=
Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com
 [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-246-epyaWQxmMkC250CPUkEOFw-1; Wed, 13 Mar 2024 07:13:16 -0400
X-MC-Unique: epyaWQxmMkC250CPUkEOFw-1
Received: by mail-lf1-f70.google.com with SMTP id
 2adb3069b0e04-513b16110a1so2405750e87.3
 for <dev@dpdk.org>; Wed, 13 Mar 2024 04:13:15 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1710328394; x=1710933194;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=XIUfkUWhZlelSPe3jLCrEqwb6ka6YBzjuqHED9qVJZM=;
 b=rrr77T5cw1ruJeOx+/5+1y65JaDDJhrgwGfSpwKV2hpNBY3hSPCRrqT0V65nYLMDoU
 mut+tW6Lz7u2pSdCgt+lG/gy4HhhH9n5BmPCReD0ybhS5HvXip3OkOKydKvyqGsvJrcF
 R6Zea/Q6UUvWc2KKI56Wv2O7GuWlRuuYIE4OIK0OWV+QHdbLyR5l2aAhKmZcxsv8/M0H
 8NPkKmBh+PW+d1T1VgFz7zbocRg4gJTBfGr0c/pYRtq5J4ZR+/iQwUy7I3B3VOZYjQX9
 RjguGNypv5ErZWFOdnPSM7bZPvaGEl6wG+h8d+2eDuxHsT9lOiZ9MnM1nyzs2hIb2e83
 9bqA==
X-Gm-Message-State: AOJu0YwNL/jzXS+wttO04saDHgjhfoXPZfYkLfP6cMrLi9rkZEPHomZ6
 F2VoS7TAJpdjbHPvcoPkKoFxvjxjfnwRVyhfJKFKnLBHtO9H6GOFNJqGUHoS6aYLKmWkALbbDnl
 +tUV24RuOkjOowLfhLim8rU9c4IXscNj5iznBCcH5hmPCGqMVItCV7NYj9Np91YIVAbspP5KnUC
 RMVMOAGuLPQVQcRso=
X-Received: by 2002:ac2:5547:0:b0:513:c5c4:7861 with SMTP id
 l7-20020ac25547000000b00513c5c47861mr1732299lfk.28.1710328394718; 
 Wed, 13 Mar 2024 04:13:14 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IHykjGCaw3up77jnmJuXK9oFryv78sLX6djbQD4st8NXktfN4wnrB5s3HWMz5Cut51yluFZ3eXwCaqBphj2G6k=
X-Received: by 2002:ac2:5547:0:b0:513:c5c4:7861 with SMTP id
 l7-20020ac25547000000b00513c5c47861mr1732285lfk.28.1710328394372; Wed, 13 Mar
 2024 04:13:14 -0700 (PDT)
MIME-Version: 1.0
References: <20240308144841.3615262-1-david.marchand@redhat.com>
 <20240308144841.3615262-3-david.marchand@redhat.com>
 <92e9792e-9054-4c8e-a409-739176707175@amd.com>
 <CAJFAV8xDxRUjhR2295OLbd=t9WYYDfrYWh=7qgQAD=GfGp=EVA@mail.gmail.com>
 <70c06f94-bba1-48f3-8c59-9e523ff0498d@amd.com>
In-Reply-To: <70c06f94-bba1-48f3-8c59-9e523ff0498d@amd.com>
From: David Marchand <david.marchand@redhat.com>
Date: Wed, 13 Mar 2024 12:13:02 +0100
Message-ID: <CAJFAV8xUK9jHjfsK4=uQoMQuoEDJBAemp7x-3_zd0tAx7K=1Uw@mail.gmail.com>
Subject: Re: [PATCH 2/4] app/testpmd: fix burst option parsing
To: Ferruh Yigit <ferruh.yigit@amd.com>
Cc: dev@dpdk.org, stable@dpdk.org, Aman Singh <aman.deep.singh@intel.com>, 
 Yuying Zhang <yuying.zhang@intel.com>,
 Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>, 
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>, 
 Bernard Iremonger <bernard.iremonger@intel.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
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>
Errors-To: dev-bounces@dpdk.org

On Wed, Mar 13, 2024 at 11:37=E2=80=AFAM Ferruh Yigit <ferruh.yigit@amd.com=
> wrote:
>
> On 3/13/2024 7:24 AM, David Marchand wrote:
> > On Tue, Mar 12, 2024 at 5:47=E2=80=AFPM Ferruh Yigit <ferruh.yigit@amd.=
com> wrote:
> >>
> >> On 3/8/2024 2:48 PM, David Marchand wrote:
> >>> rte_eth_dev_info_get() is not supposed to fail for a valid port_id, b=
ut
> >>> for the theoretical case when it would fail, raise an error rather th=
an
> >>> skip subsequent options.
> >>>
> >>> Fixes: 6f51deb903b2 ("app/testpmd: check status of getting ethdev inf=
o")
> >>> Cc: stable@dpdk.org
> >>>
> >>> Signed-off-by: David Marchand <david.marchand@redhat.com>
> >>> ---
> >>>  app/test-pmd/parameters.c | 6 +++---
> >>>  1 file changed, 3 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> >>> index d715750bb8..8c21744009 100644
> >>> --- a/app/test-pmd/parameters.c
> >>> +++ b/app/test-pmd/parameters.c
> >>> @@ -1128,9 +1128,9 @@ launch_args_parse(int argc, char** argv)
> >>>                                                               0,
> >>>                                                               &dev_in=
fo);
> >>>                                       if (ret !=3D 0)
> >>> -                                             return;
> >>> -
> >>> -                                     rec_nb_pkts =3D dev_info
> >>> +                                             rec_nb_pkts =3D 0;
> >>> +                                     else
> >>> +                                             rec_nb_pkts =3D dev_inf=
o
> >>>                                               .default_rxportconf.bur=
st_size;
> >>>
> >>>                                       if (rec_nb_pkts =3D=3D 0)
> >>
> >> 'eth_dev_info_get_print_err()' already fail, but it may not be very
> >> clear to the user,
> >> OK to print a failure log, but setting 'rec_nb_pkts =3D 0;' as above a=
lso
> >> will generate an error message that also may be confusing to the user.
> >>
> >> What about print an explicit error message for the
> >> 'eth_dev_info_get_print_err()' failed case?
> >
> > rte_exit(EXIT_FAILURE, "Failed to retrieve device info, this is
> > probably a driver bug. "
> >         "To workaround this issue, please provide a value between 1
> > and %d\n", MAX_PKT_BURST);
> >
> > Does it work for you?
> >
> >
>
> 'eth_dev_info_get_print_err()' already logs error about getting device
> info, but driver recommended 'burst' setting failed information is missin=
g.
>
> What about more direct,
> "Failed to get driver recommended burst size, please provide a value
> between 1 and MAX_PKT_BURST"

Which is really close to the existing log message.

                                        if (rec_nb_pkts =3D=3D 0)
                                                rte_exit(EXIT_FAILURE,
                                                        "PMD does not
recommend a burst size. "
                                                        "Provided
value must be between "
                                                        "1 and %d\n",
MAX_PKT_BURST);

I am unconvinced, but if you think strongly for this, I won't debate more.


--=20
David Marchand