[dpdk-dev] random pkt generator PMD

Dumitrescu, Cristian cristian.dumitrescu at intel.com
Wed Jun 15 15:03:30 CEST 2016

> -----Original Message-----
> From: Yerden Zhumabekov [mailto:e_zhumabekov at sts.kz]
> Sent: Wednesday, June 15, 2016 1:55 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu at intel.com>; Panu Matilainen
> <pmatilai at redhat.com>; dev at dpdk.org
> Subject: Re: [dpdk-dev] random pkt generator PMD
> On 15.06.2016 18:25, Dumitrescu, Cristian wrote:
> >>>> So add a loop-mode to pcap pmd?
> >>> It would be nice to have an option like "...,rewind=1,...".
> >> As Cristian points out in
> >> http://dpdk.org/ml/archives/dev/2016-June/041589.html, the current
> pmd
> >> behavior of stopping is the odd man out in the pmd crowd.
> >>
> >> Rather than whether to rewind or not, I'd make the number of loops
> >> configurable, defaulting to forever and 1 being the equal to current
> >> behavior.
> >>
> >> 	- Panu -
> > +1
> I'm afraid, all packets from pcap file would need to be preloaded to
> memory. Otherwise, each loop would infer pcap_open/pcap_close(), am I
> wrong?

This exactly what the code in source port is doing.

Basically, this is optimized for the case when number of packets in the PCAP file is relatively small, so the PCAP memory footprint when loaded into memory is small so it fits the L1/L2 cache. Provides traffic generation capability when performance measurements are not key: testing, code development on your laptop while on board of a plane, simulation environments, etc.

When the PCAP is large (e.g. capture of the traffic in your local cloud for 2 mins), then PCAP memory gets swapped to disk and performance obviously drops. Still better than opening PCAC for each packet. Useful for e.g. IDS/IPS testing. 

More information about the dev mailing list