[dpdk-dev] random pkt generator PMD

Yerden Zhumabekov e_zhumabekov at sts.kz
Tue Jun 21 10:43:13 CEST 2016


I've developed some preliminary version of the driver. The code is 
derived from Null PMD, but required a lot of rework.

It uses following devargs to generate packets:

1) edit=offset:size:[rnd|value]
     Edit a field within an mbuf packet data with given offset and size. 
Mark it as 'rnd' or assign it a hex value, for example:
    'edit=8:16:rnd' tags field with offset 8 bytes and with size of 16 
bytes random-generated,
    'edit=14:4:0xdeadbeef' assigns a specified sequence of bytes to the 
field (network byte order).

2) tmpl=name
     Use a template with name. Instead of editing data manually, specify 
a hard-coded template and then edit only intended fields. Implemented 
icmp4, tcp4, but needs to be expanded.

3) size=len
     Specify a size of packet. May not be less than size of template 
(checked on devinit).

I ran testpmd (start/stop), then l2fwd, looks like it works, but I'd be 
happy to hear about additional tests I need to run to ensure the PMD 
conformance.

With 64 bytes packet and one 8-byte random field it's about 6-7 Mpps 
now. I use rte_rand()/lrand48() as a source of random bytes, it impacts 
a performance, but I haven't come up with anything else.


On 15.06.2016 16:07, Bruce Richardson wrote:
> On Wed, Jun 15, 2016 at 04:03:59PM +0600, Yerden Zhumabekov wrote:
>>
>> Right, but development of various features regarding L3/L4 etc requires more
>> subtle approach, like live packets, different protocol versions, fields
>> manipulation. In this case some packet mangling/randomizing capabilities
>> would be quite useful. Something similar to what is done in Pktgen, but more
>> lightweight approach, in a same app.
>>
>> I've almost made my mind :) so the next question: is there any guide on PMD
>> dev? I'm looking through rte_ether.h right now, but some doc would be very
>> nice.
> Unfortunately not. My suggestion is to take one of the simple vdev's e.g. ring,
> pcap, null, and work off a copy of it.
>
> /Bruce



More information about the dev mailing list