From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D4B6CFE5 for ; Sun, 24 May 2015 01:43:09 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 23 May 2015 16:43:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,484,1427785200"; d="scan'208";a="497512622" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by FMSMGA003.fm.intel.com with ESMTP; 23 May 2015 16:43:08 -0700 Received: from orsmsx153.amr.corp.intel.com (10.22.226.247) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.224.2; Sat, 23 May 2015 16:43:08 -0700 Received: from fmsmsx108.amr.corp.intel.com (10.18.124.206) by ORSMSX153.amr.corp.intel.com (10.22.226.247) with Microsoft SMTP Server (TLS) id 14.3.224.2; Sat, 23 May 2015 16:43:07 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.213]) by FMSMSX108.amr.corp.intel.com ([169.254.9.74]) with mapi id 14.03.0224.002; Sat, 23 May 2015 16:43:07 -0700 From: "Wiles, Keith" To: Jakub Mazur , "dev@dpdk.org" Thread-Topic: [dpdk-dev] Generating packets into queues Thread-Index: AQHQlZ7DDfkF0X4EpE2XqnfoPwfsu52Ka3iA Date: Sat, 23 May 2015 23:43:06 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.8.67] Content-Type: text/plain; charset="us-ascii" Content-ID: <063FCAC84D487E4DB575A14CB9664057@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] Generating packets into queues 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: Sat, 23 May 2015 23:43:10 -0000 On 5/23/15, 5:23 PM, "Jakub Mazur" wrote: >Hello, > >I've just got to grips with DPDK and started writing my own applications. >However, I am struggling to figure out how to test my applications in >terms >of sending packets to the ports I am polling. > >I've got Pktgen-DPDK up and running but I don't know how to use it to >interact with my own application. One possible solution I use and if you have enough ports available to use. Lets say you need two ports for your application, but you have 4 ports in your system. I physically loop back the cables to have port 0 connect to port 2 and port 1 connected to port 3. Now I can give two ports to my application and two ports to Pktgen. Setup if pktgen and your application you have to startup each one a bit differently to make sure they share the resources like memory and the ports. I will use two Pktgen running on the same machine, which just means you have to setup your application as one of the applications. In my machine I have 8 10G ports and 72 lcores between 2 sockets. Plus I have 1024 hugepages per socket for a total of 2048. #rkwiles@rkwiles-desk:~/projects/intel/dpdk$ lspci |grep Ether #06:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01) #06:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01) #08:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01) #08:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01) #09:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01) #09:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01) #83:00.1 Ethernet controller: Intel Corporation DH8900CC Null Device (rev 21) #87:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01) #87:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01) #89:00.0 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01) #89:00.1 Ethernet controller: Intel Corporation Ethernet Converged Network Adapter X520-Q1 (rev 01) ./app/app/${target}/pktgen -c ff2 -n 3 --proc-type auto --socket-mem 512,512 --file-prefix pg1 -b 09:00.0 -b 09:00.1 -b 83:00.1 -b 06:00.0 -b 06:00.1 -b 08:00.0 -b 08:00.1 -- -T -P -m "[4:6].0, [5:7].1, [8:10].2, [9:11].3" -f themes/black-yellow.theme ./app/app/${target}/pktgen -c ff004 -n 3 --proc-type auto --socket-mem 512,512 --file-prefix pg2 -b 09:00.0 -b 09:00.1 -b 83:00.1 -b 87:00.0 -b 87:00.1 -b 89:00.0 -b 89:00.1 -- -T -P -m "[12:16].0, [13:17].1, [14:18].2, [15:19].3" -f themes/black-yellow.theme Notice I black list the three onboard devices and then black list the other 4 ports I will not be using for each of the pktgen instances. I need 8+1 lcores for each instance for Pktgen use. The -c option of ff2 and FF004 lcores, the ff value are used for port handling and the 2/4 is used because pktgen needs the first lcore for display and timers. The -m option then assigns lcores to the ports. The information from above is taken from two new files pktgen-master.sh and pktgen-slave.sh, have a look at them and adjust as you need. The other solution is to use two machines with cables connected back to back, this works if you have a second machine. > >Any help would be welcome. > >Thanks