From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mgw.gov.kz (mgw.gov.kz [89.218.88.242]) by dpdk.org (Postfix) with ESMTP id 2811AADF0 for ; Tue, 21 Jun 2016 10:43:15 +0200 (CEST) Received: from sts.kz (mail.sts.kz [178.89.4.9]) by mgw.gov.kz with ESMTP id u5L8hDC1022599-u5L8hDC3022599 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 21 Jun 2016 14:43:14 +0600 Received: from [172.20.19.232] (unknown [178.89.4.11]) by sts.kz (Postfix) with ESMTPA id 598814059; Tue, 21 Jun 2016 14:43:13 +0600 (ALMT) DKIM-Filter: OpenDKIM Filter v2.10.3 sts.kz 598814059 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sts.kz; s=mail; t=1466498593; bh=bknHWPugqXmadwbIn9X2+XwYDTLtxaIK58HrVuXVqYw=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=Yqar/HHLXb/8QS6EZX37bqLDZh0onqjjrfwVzkspXWTaJbr8W60agWC2quelds6V5 2EBhr/zbjh6aK/2agjYgqQ7G75wzz9r81mD7ykvmo1W4gHfZTpQpS3IJKkWApNEerI oSEeKRSyaGWdYzotDZru7DmINMSuIkLrl2x26tUA= To: Bruce Richardson References: <5761235C.2090906@sts.kz> <20160615094922.GB10172@bricha3-MOBL3> <5761280F.6020106@sts.kz> <20160615100701.GC10172@bricha3-MOBL3> Cc: dev@dpdk.org From: Yerden Zhumabekov Message-ID: <5768FE21.30904@sts.kz> Date: Tue, 21 Jun 2016 14:43:13 +0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160615100701.GC10172@bricha3-MOBL3> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] random pkt generator PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 08:43:15 -0000 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