DPDK usage discussions
 help / color / mirror / Atom feed
From: "Wiles, Keith" <keith.wiles@intel.com>
To: Chris Hall <chris.hall@stackpath.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: [dpdk-users] PKTGEN option to limit sending packets per second
Date: Mon, 3 Apr 2017 18:58:02 +0000	[thread overview]
Message-ID: <A5F80E84-F773-428A-98DC-1D3582FB6414@intel.com> (raw)
In-Reply-To: <MWHPR10MB14536B87F9904859DBA4A6F192080@MWHPR10MB1453.namprd10.prod.outlook.com>


> On Apr 3, 2017, at 1:02 PM, Chris Hall <chris.hall@stackpath.com> wrote:
> 
> Hi Keith, 
>  
> Just figured I would ask. ��
> I was able to whip up some LUA that seems to work thus far. 


BTW, the current version of Pktgen 3.2.x has support for decimal numbers in the rate values. e.g. 10.1, 0.01, 93.4, ...

> 
> fwiw, LUA snippet: 
> 
> -- ?? may add logic to adjust these values over each interation(s) ?? *shrug*
> pktgen.set(sendport, 'rate', 1);
> pktgen.set(sendport, 'burst', 32);
> 
> ……
> 
> local total_rt  = 60;   -- total script runtime
> local loop_rt   = 30;   -- loop runtime (in seconds) before increasing packet count ("pkt_m")
> local pkt_m     = 100;   -- increase packet count by pkt_m at each interation ("loop_rt")
>  
> function main()
>  
>     loadSettings();
>  
>     local run_t = 0;
>     local start_t = os.time();
>  
>     print(string.format("Starting - %.2fs", start_t));
>     pktgen.clear('all');
>     pkt_cnt = 0;
>  
>     while run_t <= total_rt do
>  
>         pkt_cnt = (pkt_cnt + pkt_m);
>         print(string.format("Sending %d packets for %d seconds",pkt_cnt,loop_rt));
>  
>         local pkt_send_t = 0;
>         local pkt_send_sart_t =  os.time();
>  
>         while pkt_send_t <= loop_rt do
>             pktgen.set(sendport, "count", pkt_cnt);
>             pktgen.start(sendport);
>             doWait(sendport,10);
>             pkt_send_t = os.time() - pkt_send_sart_t;
>         end
>  
>         run_t = os.time() - start_t;
>  
>         -- *meh* no harm here
>         if(run_t >= total_rt) then
>             goto exit;
>         end
>     end
>  
>  
> ::exit::
> pktgen.stop(sendport);
> print(string.format("Completed - elapsed: %.2fs",run_t));
> return;
> 
>  
>  
>  
> From: Wiles, Keith
> Sent: Monday, April 3, 2017 12:31 PM
> To: Chris Hall
> Cc: users@dpdk.org
> Subject: Re: [dpdk-users] PKTGEN option to limit sending packets per second
>  
> 
> > On Apr 3, 2017, at 11:59 AM, Chris Hall <chris.hall@stackpath.com> wrote:
> > 
> > Hello,
> > 
> > We are doing various tests using dpdk-pktgen. One thing we were looking at is sending a consent stream of packets at a specified number of pps over a period of time. Was wondering if this could be an added feature ? something like “set 0 pps N” ?  I’ve played with the rate/burst delay, etc.. but I can’t really put a cap on packets per second.
> 
> I have not thought about rate at PPS, but it is a good idea. I do not think it will be hard to do at least I do not think so :-)
> 
> At this time I send a burst of packets up to 32 at a time using an interval or cycles. Did you really want the packets spaced equally over the second or do you want the burst of packets to be used in the calculations. At very low PPS it is possible to have 1 packet per second. The reason for the burst size is to get the best performance, but if we space the single packets across time then getting to wire rate maybe hard.
> 
> > 
> > Thanks much
> > Chris
> > 
> > 
> 
> Regards,
> Keith

Regards,
Keith


  reply	other threads:[~2017-04-03 18:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 16:59 Chris Hall
2017-04-03 17:30 ` Wiles, Keith
2017-04-03 18:02   ` Chris Hall
2017-04-03 18:58     ` Wiles, Keith [this message]
2017-04-04 22:58 Chris Hall

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=A5F80E84-F773-428A-98DC-1D3582FB6414@intel.com \
    --to=keith.wiles@intel.com \
    --cc=chris.hall@stackpath.com \
    --cc=users@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).