patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: "Singh, Aman Deep" <aman.deep.singh@intel.com>,
	Gregory Etelson <getelson@nvidia.com>,
	dev@dpdk.org
Cc: matan@nvidia.com, rasland@nvidia.com, stephen@networkplumber.org,
	stable@dpdk.org, Yuying Zhang <yuying.zhang@intel.com>
Subject: Re: [PATCH v2] app/testpmd: fix interactive mode with no ports
Date: Thu, 19 Jan 2023 15:09:24 +0000	[thread overview]
Message-ID: <2c0f5afd-4408-6e87-9183-ade2f8ea46ce@amd.com> (raw)
In-Reply-To: <9bfc0585-beb4-e4ef-ae1e-2d5b241136f8@intel.com>

On 11/16/2022 4:23 AM, Singh, Aman Deep wrote:
> Hi Gregory,
> 
> Thanks for the patch.
> 
> On 11/9/2022 10:39 PM, Gregory Etelson wrote:
>> Testpmd terminated unconditionally if it failed to start all ports.
>>
>> The patch allows testpmd to get into the command line,
>> if the interactive mode was requested.
> 
> I tested testpmd in interactive mode with no ports.
> It did get into command line-
> 
> $./dpdk-testpmd -n 4 -c 0x1f -- -i
> testpmd: No probed ethernet devices
> Interactive-mode selected
> testpmd: create a new mbuf pool <mb_pool_0>: n=179456, size=2176, socket=0
> testpmd: preferred mempool ops selected: ring_mp_mc
> Done
> testpmd>
> 
>>
>> Fixes: 6937d2103e22 ("app/testpmd: add option to not start device")
>>
>> Cc: stephen@networkplumber.org
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
>> ---
>> v2: add Cc
>> ---
>>   app/test-pmd/testpmd.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
>> index 7381dfd9e5..8517f376db 100644
>> --- a/app/test-pmd/testpmd.c
>> +++ b/app/test-pmd/testpmd.c
>> @@ -4433,8 +4433,11 @@ main(int argc, char** argv)
>>           }
>>       }
>>   -    if (!no_device_start && start_port(RTE_PORT_ALL) != 0)
> 
> With no ports, start_port returns 0 so it doesn't exits.
> 

Hi Aman,

I think patch is for the case port exists and 'start_port()' failed, in
that case testpmd exits.

With patch, testpmd only continues after 'start_port()' failure only if
interactive mode is selected, that also looks good to me.


Gregory,

Only for non interactive case if 'start_port()' fails, application exit
value changed to 'EXIT_SUCCESS', which is not quite right, can you
please fix it?

>> -        rte_exit(EXIT_FAILURE, "Start ports failed\n");
>> +    if (!no_device_start && start_port(RTE_PORT_ALL) != 0) {
>> +        fprintf(stderr, "Start ports failed\n");
>> +        if (!interactive)
>> +            goto eal_out;
>> +    }
>>         /* set all ports to promiscuous mode by default */
>>       RTE_ETH_FOREACH_DEV(port_id) {
>> @@ -4526,6 +4529,7 @@ main(int argc, char** argv)
>>               return 1;
>>       }
>>   +eal_out:
>>       ret = rte_eal_cleanup();
>>       if (ret != 0)
>>           rte_exit(EXIT_FAILURE,
> 


  reply	other threads:[~2023-01-19 15:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221109165410.1326-1-getelson@nvidia.com>
2022-11-09 17:09 ` Gregory Etelson
2022-11-16  4:23   ` Singh, Aman Deep
2023-01-19 15:09     ` Ferruh Yigit [this message]
2023-01-19 17:16   ` [PATCH v3] " Gregory Etelson
2023-01-19 17:23   ` Gregory Etelson
2023-01-19 17:28     ` Stephen Hemminger
2023-01-19 17:45   ` [PATCH v4] " Gregory Etelson
2023-01-27 23:04     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c0f5afd-4408-6e87-9183-ade2f8ea46ce@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=getelson@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).