[dpdk-users] PKTGEN option to limit sending packets per second

Wiles, Keith keith.wiles at intel.com
Mon Apr 3 20:58:02 CEST 2017


> On Apr 3, 2017, at 1:02 PM, Chris Hall <chris.hall at 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 at 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 at 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



More information about the users mailing list