From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6B2A943C9F for ; Wed, 13 Mar 2024 12:13:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60C8B40EE2; 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 CC77240A84 for ; Wed, 13 Mar 2024 12:13:17 +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-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-510-LuJtNT3nPMC6t4lq9CVpOw-1; Wed, 13 Mar 2024 07:13:16 -0400 X-MC-Unique: LuJtNT3nPMC6t4lq9CVpOw-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-513340d10ccso4930423e87.2 for ; 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=UQPqhLCsmgUOtOhup7B69moeeuVqB2hx6FfajAVl80NG1PQPbrIJbJ4Y90fpsW56vU +tEm21/rcpOFRxkWb2ivex0UQ78fSu7mKcbQL3nw8c299EXPrLdwjo9c/OFNe0ZnrLkr gA/w+nahW+O2WajXxHu4YYczat1hFMP5rJJqxez6CrZ76i7hvKr4MfjfVWI109MR0cZz b5w0erv6gdSoN7u0NleFAzT0+KAk7eN/OD8yOv4qx+0Uhj12NEiJiL7mUElnyLMCRfpL m+rRALdEfccd5CF+tBAS1nGyNGg3tqaGxKS30Sa/R3Btuc7KcAYnc3CineoH2lf+BClR I5/g== X-Forwarded-Encrypted: i=1; AJvYcCXCojM2CAFNvrQski9Zry1cKsbDZVFi+H4TWspcc/En+gBf4a6icH4YC5fIpe0he21lGrUisOmwZp791ecQhbI= X-Gm-Message-State: AOJu0YweYfO4uwBTStFIVbhM57/c0VTVSPgm3MHv5Ui+b2Zo9RWLpv5l 05kgR4Q0po00kSkOueb/z9znexYzLvrlcC0HMPx6slXmp6O2g1iTSVF93m3cUjiItN3RBGV9i5o AajyX6yvoQKnfY/kdzWc8IrND4KmfRoGs2nei6zoikhfBpEjWo7C4UujSNM2MUl+o/kOOrGKUNt hv08kSCnwWPREt6tHmNg4= X-Received: by 2002:ac2:5547:0:b0:513:c5c4:7861 with SMTP id l7-20020ac25547000000b00513c5c47861mr1732294lfk.28.1710328394711; 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> <70c06f94-bba1-48f3-8c59-9e523ff0498d@amd.com> In-Reply-To: <70c06f94-bba1-48f3-8c59-9e523ff0498d@amd.com> From: David Marchand Date: Wed, 13 Mar 2024 12:13:02 +0100 Message-ID: Subject: Re: [PATCH 2/4] app/testpmd: fix burst option parsing To: Ferruh Yigit Cc: dev@dpdk.org, stable@dpdk.org, Aman Singh , Yuying Zhang , Ivan Ilchenko , Andrew Rybchenko , Bernard Iremonger X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Wed, Mar 13, 2024 at 11:37=E2=80=AFAM Ferruh Yigit wrote: > > On 3/13/2024 7:24 AM, David Marchand wrote: > > On Tue, Mar 12, 2024 at 5:47=E2=80=AFPM Ferruh Yigit 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 > >>> --- > >>> 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