From owner-freebsd-current@freebsd.org Mon Feb 22 18:16:09 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2954FAB0835 for ; Mon, 22 Feb 2016 18:16:09 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF96E153F for ; Mon, 22 Feb 2016 18:16:08 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aXv1g-000F74-5L; Mon, 22 Feb 2016 21:16:04 +0300 Date: Mon, 22 Feb 2016 21:16:04 +0300 From: Slawa Olhovchenkov To: Luigi Rizzo Cc: freebsd-current Subject: Re: three new netmap tools: pcap player, link emulator, load distributor Message-ID: <20160222181603.GR68298@zxy.spb.ru> References: <20160222121415.GG37895@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2016 18:16:09 -0000 On Mon, Feb 22, 2016 at 08:17:06AM -0800, Luigi Rizzo wrote: > On Monday, February 22, 2016, Slawa Olhovchenkov wrote: > > > On Sun, Feb 21, 2016 at 10:18:36AM -0800, Luigi Rizzo wrote: > > > > > lb > > > a packet distributor that reads from a netmap port and distributes > > > traffic to multiple netmap ports, using ze​ro copy and a user-defined > > > hash function. This will be useful e.g. for people running multiple > > > instances of traffic monitors such as bro, suricata and the like. > > > It is not by chance that LB was originally developed by Seth Hall > > > at Broala, who kindly made it available, and Giuseppe Lettieri who > > > added a few features. > > > > Do you performance test of this tool? > > In my case, on my hardware similar code can rehash and forward only > > about 6.5Mpps in one thread. > > > > Well above 15mpps on a Vale switch. The devil is in the details so "similar > code" may perform wildly differently depending of what you actually do. Mostly outperformance for me in memory access, for netmap index access and hashing packet. > Give this a try and let us know. I can't compile this. # cc -o lb lb.c lb.c:17:10: fatal error: 'ctrs.h' file not found #include "ctrs.h" ^ 1 error generated. ok, give ctrs.h from netmap/examples/ # cc -o lb lb.c In file included from lb.c:18: ./lb.h:2:23: error: use of undeclared identifier 'ETH_ALEN' unsigned char h_dest[ETH_ALEN]; ^ ./lb.h:3:25: error: use of undeclared identifier 'ETH_ALEN' unsigned char h_source[ETH_ALEN]; ^ 2 errors generated.