From owner-freebsd-net@FreeBSD.ORG Wed Jan 9 13:55:08 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 2C340942 for ; Wed, 9 Jan 2013 13:55:08 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-ea0-f170.google.com (mail-ea0-f170.google.com [209.85.215.170]) by mx1.freebsd.org (Postfix) with ESMTP id B782D85 for ; Wed, 9 Jan 2013 13:55:07 +0000 (UTC) Received: by mail-ea0-f170.google.com with SMTP id d11so697665eaa.29 for ; Wed, 09 Jan 2013 05:55:01 -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:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=DBBL65k4ILBrxEJxT3Zc7dARMMq9UOllvRhqRtTfjtk=; b=Hv+T0UsdSaujjHvO9VwSK2An9h2GvOQICZs2km7tcmdSDUtSkO+3AnZhV+CU4yp3aM Ei3LnXXKJ94T+Nr0cArDrZl5PqyFKX+pPO2FdDxCHgxUA118OSondRn78ubCeVMs8eg+ EVrGbHncWP7vg2rezllTJjkypaYjF5d67yH79K1nYqVG2glQYsTdKMb8wmusKtkE9Jro lPGCkq8gatI2rLbErc8QoCFbLjL+YOLDRvRedcS5oPmYSXpnr12c8N3k9LWqnIc41xxX glMVy8np0Ipd8s3cBSv1Fe4gW8g9F5t5rPjUgjtYnEAG2GH82TR7gDvOpFEJnpPDqgmd gVXw== MIME-Version: 1.0 Received: by 10.14.209.193 with SMTP id s41mr183090505eeo.9.1357739682050; Wed, 09 Jan 2013 05:54:42 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.14.0.2 with HTTP; Wed, 9 Jan 2013 05:54:41 -0800 (PST) In-Reply-To: References: <20130108230200.GA36903@onelab2.iet.unipi.it> Date: Wed, 9 Jan 2013 05:54:41 -0800 X-Google-Sender-Auth: M-HQdAXOdEcN4yueh3UTBmkTWl4 Message-ID: Subject: Re: How to use netmap pkt-gen on 9.1? From: Luigi Rizzo To: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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 13:55:08 -0000 On Wed, Jan 9, 2013 at 5:21 AM, Olivier Cochard-Labb=E9 wrote: > On Wed, Jan 9, 2013 at 12:02 AM, Luigi Rizzo wrote: > > > not your mistake, on stable/9 i have not merged yet the > > device driver changes. > > Your best option is to copy sys/dev/netmap from HEAD, > > and add the device-specific chunks also from HEAD > > into the various drivers (dev/e1000, dev/ixgbe, dev/re) > > > > Ok but before starting to merge the changes, I've tested with a > -current and meet the same problem (under virtualbox): > you need to add a "device netmap" option in your kernel config file in order to build the device drivers with the required changes. This also introduces a dependency of these modules on the netmap module so you either have 'netmap' and 'em' statically compiled in, or first load netmap and then 'em'. (you see the same symptoms on 9.x but adding 'device netmap' won't help there because the drivers do not have the relevant modifications. cheers luigi > > [root@router]~# uname -a > FreeBSD router.bsdrp.net 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r245223: > Wed Jan 9 11:28:12 CET 2013 > root@orange.bsdrp.net: > /usr/obj/BSDRP.amd64/usr/local/BSDRPexp/FreeBSD/src/sys/amd64 > amd64 > [root@router]~# kldload netmap > netmap: loaded module > [root@router]~# pkt-gen -i em0 -t 50 -d 1.1.1.2 -s 1.1.1.1 -D > aa:aa:00:00:02:12 > main [832] ether887.679157 netmap_memory_config [688] reconfiguring > _aton(aa:aa:00:0887.682154 netmap_config_obj_allocator [563] objsize > 1024 clustsize 4096 objects 4 > 0:02:12) gives 0887.684256 netmap_config_obj_allocator [563] objsize > 36864 clustsize 36864 objects 1 > x800fc0a70 > 887.686584 netmap_config_obj_allocator [563] objsize 2048 clustsize > 4096 objects 2 > 887.688061 netmap_memory_config [708] Have 100 KB for interfaces, 7200 > KB for rings and 320 MB for buffers > 887.690015 netmap_finalize_obj_allocator [654] Pre-allocated 25 > clusters (4/100KB) for 'netmap_if' > 887.694443 netmap_finalize_obj_allocator [654] Pre-allocated 200 > clusters (36/7200KB) for 'netmap_ring' > 887.938950 netmap_finalize_obj_allocator [654] Pre-allocated 81920 > clusters (4/327680KB) for 'netmap_buf' > main [900] map size is 334980 Kb > main [906] Unable to get if info for em0 > main [913] bad nthreads 1, have 0 queues > main [922] mmapping 0 Kbytes > main [927] Unable to mmap 0 KB > main [941] Unable to register interface em0 > Sending on em0: 0 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] Ready889.942650 netmap_memory_finalize [724] busy (refcount 2) > ... > main [1028] Unable to register em0 > main [1085] 0 pp890.952608 netmap_ioctl [1073] deprecated, data is > 0xffffff8000323b90 > s > Sent 0 packets, 60 bytes each, in 0.00 second890.955473 > netmap_memory_deref [950] refcount =3D 1 > s. > Speed: nanpp890.956985 netmap_close [575] dev 0xfffffe00210f8400 fflag > 0x3 devtype 8192 td 0xfffffe000a0d8000 > s. Bandwidth: nanbps (nanbps with overhead). > 890.960688 netmap_memory_deref [950] refcount =3D 0 > --=20 -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------