From owner-freebsd-net@FreeBSD.ORG Wed Jan 9 16:50:34 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6ABDA7E4 for ; Wed, 9 Jan 2013 16:50:34 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx1.freebsd.org (Postfix) with ESMTP id F2D17D4B for ; Wed, 9 Jan 2013 16:50:33 +0000 (UTC) Received: by mail-vc0-f172.google.com with SMTP id fw7so1761412vcb.31 for ; Wed, 09 Jan 2013 08:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=aI8avfPfZw0ZA+D4d8590tN3vNM3UCgeocwJn6c9Qgo=; b=yqefe5dlExcUrXESYZl/oScng9GFeVHmQ4wWoCGr1xZr4tBHiu0WKtLhBXpbz15KsY RMdA6wpGu3HoLtnq2ulvScUVGlXvj4hQPin8QhDp9HymCBr89yS8bQMmkrkYr6Fvmmay lqbGhjrQXeKXojXDKNDkNi0LrQVhLpwa1knICOSSctmFXpsPZZFqx3K6lGNl4155pkVW kxpbRn5vOKhuo+h3xJjzMOh31ooJxW86y6/NyWuZt/g7Es1cqLkiH9/F4EzGuoMbVdPX 0NqxAkZ3YpqdWuLhORpCVPE4V9GqlJGwQg5W/QKGlfOXXHqJ8GebtMW0zRyZHdNrH5u4 9G8w== Received: by 10.220.142.74 with SMTP id p10mr16496435vcu.63.1357750227059; Wed, 09 Jan 2013 08:50:27 -0800 (PST) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.58.164.100 with HTTP; Wed, 9 Jan 2013 08:50:06 -0800 (PST) In-Reply-To: References: <20130108230200.GA36903@onelab2.iet.unipi.it> From: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= Date: Wed, 9 Jan 2013 17:50:06 +0100 X-Google-Sender-Auth: NddaLawf4yfelvjAMX3cUhJSVuY Message-ID: Subject: Re: How to use netmap pkt-gen on 9.1? To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 16:50:34 -0000 On Wed, Jan 9, 2013 at 2:54 PM, Luigi Rizzo wrote: > you need to add a "device netmap" option in your kernel config file in order > to > build the device drivers with the required changes. "device netmap" was the forgotten part ! Now I reach to use it on -current and, following your advice, on 9.1 too. The patch (for 9.1-release) that I've used his here: http://gugus69.free.fr/freebsd/freebsd.netmap.patch But I didn't adapt the ixgbe drivers (only em and re): - the DEV_NETMAP part in the ixgbe drivers include new -current drivers code and simply copy the full -current ixgbe drivers didn't works - I didn't have this hardware for testing it Tested on virtualbox: [root@router]~# uname -a FreeBSD router.bsdrp.net 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243710M: Wed Jan 9 16:30:29 CET 2013 root@orange.bsdrp.net:/usr/obj/BSDRP.amd64/usr/local/BSDRP/FreeBSD/src/sys/amd64 amd6 [root@router]~# pkt-gen -i em0 -t 50 -d 1.1.1.2 -D aa:aa:00:00:02:12 -s 1.1.1.1 main [832] ether627.452946 netmap_mmap_single [511] cdev 0xfffffe00022d4a00 foff 0 size 343019520 objp 0xffffff800033ba08 prot 3 _aton(aa:aa:00:00:02:12) gives 0x800f9a292 main [900] map size is 334980 Kb main [922] mmapping 334980 Kbytes 627.461541 netmap_set_ringid [886] ringid em0 set to all 1 HW RINGS Sending on em0: 1 queues, 1 threads and 1 cpus. 1.1.1.1 -> 1.1.1.2 (aa:aa:00:01:01:01 -> aa:aa:00:00:02:12) main [975] Wait 2 secs for phy reset main [977] Ready629.517672 netmap_memory_finalize [724] busy (refcount 2) ... 629.520162 netmap_set_ringid [886] ringid em0 set to all 1 HW RINGS sender_body [479] start main [1085] 50 p630.528557 netmap_ioctl [1073] deprecated, data is 0xffffff800033bbc0 ps 630.531703 netmap_memory_deref [950] refcount = 1 Sent 50 packets,630.533182 netmap_ioctl [1073] deprecated, data is 0xffffff800033bbc0 60 bytes each, in 0.02 seconds. Speed: 3.22Kpps. Bandwidth: 1.54Mbps (2.16Mbps with overhead).630.536432 netmap_dev_pager_dtor [494] ready to release memory for 0xfffffe00022d4a00 630.538334 netmap_close [575] dev 0xfffffe00022d4a00 fflag 0x3 devtype 8192 td 0xfffffe00050ec8e0 630.540230 netmap_dtor_locked [354] deleting last netmap instance for em0 630.620152 netmap_memory_deref [950] refcount = 0 4 Thanks, Olivier