DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: <dev@dpdk.org>, Aman Singh <aman.deep.singh@intel.com>
Subject: Re: [PATCH v1 1/1] app/testpmd: add sleep command
Date: Fri, 2 May 2025 16:35:08 +0200	[thread overview]
Message-ID: <60e02461-362c-4edd-b917-36a524670c5d@intel.com> (raw)
In-Reply-To: <aBS8e9GZkyXiCCJS@bricha3-mobl1.ger.corp.intel.com>

On 5/2/2025 2:37 PM, Bruce Richardson wrote:
> On Fri, May 02, 2025 at 01:27:29PM +0100, Anatoly Burakov wrote:
>> Test-pmd already has a way to run a list of commands from file, but there
>> is no way to pause execution for a specified amount of time between two
>> commands. This may be necessary for simple automation, particularly for
>> waiting on some asynchronous operation such as link status update.
>>
>> Add a simple sleep command to wait until certain number of milliseconds has
>> passed.
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> ---
>>   app/test-pmd/cmdline.c | 35 +++++++++++++++++++++++++++++++++++
>>   1 file changed, 35 insertions(+)
>>
>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
>> index d4bb3ec998..1e429e6d0a 100644
>> --- a/app/test-pmd/cmdline.c
>> +++ b/app/test-pmd/cmdline.c
>> @@ -151,6 +151,9 @@ static void cmd_help_long_parsed(void *parsed_result,
>>   
>>   			"quit\n"
>>   			"    Quit to prompt.\n\n"
>> +
>> +			"sleep ms\n"
>> +			"    Sleep for ms milliseconds.\n\n"
>>   		);
>>   	}
>>   
> 
> A "sleep" command, I would expect to sleep for a certain number of seconds,
> for compatibility e.g. with terminal "sleep" command.
> To keep this as "ms" granularity, how about making it explicit as a
> "sleep_ms" command. Alternatively, how about adding a usleep command? [Not
> sure "msleep" works, which is why I suggested sleep_ms instead]
> 
> /Bruce

I have no strong opinions on what it should do. My initial version *was* 
a "sleep in seconds" command, I just thought that maybe someone would 
want it more flexible. I suspect that actually "sleep" and second 
granularity is just fine.

-- 
Thanks,
Anatoly

  reply	other threads:[~2025-05-02 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02 12:27 Anatoly Burakov
2025-05-02 12:37 ` Bruce Richardson
2025-05-02 14:35   ` Burakov, Anatoly [this message]
2025-05-02 14:43     ` Bruce Richardson
2025-05-02 15:33       ` Morten Brørup
2025-05-02 15:42 ` Stephen Hemminger

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=60e02461-362c-4edd-b917-36a524670c5d@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /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).