From owner-freebsd-net@FreeBSD.ORG Tue Jan 8 22:39:31 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 967EDBAA for ; Tue, 8 Jan 2013 22:39:31 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx1.freebsd.org (Postfix) with ESMTP id 3B146FFF for ; Tue, 8 Jan 2013 22:39:31 +0000 (UTC) Received: by mail-vc0-f169.google.com with SMTP id gb23so960667vcb.14 for ; Tue, 08 Jan 2013 14:39:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=96TlGwCm6FULF3571vpotA/BEMFZpRFnM5168BovkSk=; b=AIHRO6erieniN1XhM0AQt9K++bbXEbFr79wbO06s8aDzvclacUoRdPAP7xjrrUZdbM +mQTg+uvH6poLz5lMTaDA7XN/NjZ3m88n35RPIbkh6ZrscME733SeR+Lo7RkGe3Mzcm9 /OotBHbxOvIV6csIKmQaXUAeqxmJVd7epyS4F6/i4BLRDPmYe48pq0CzURDna8ReHXDD zBiI0rLdoHV37EFaEv3TP/0kzEyOB67bbiQDFUeAoOrE5os/0Mr1GbAUhU4JP3pmN6k6 EKhAEluBEwZUsqV1ITlKJOaKuCZZzusD0661tsH3hgTelT+cuSnh+gfMMTmvu7Jyvg00 sgZA== Received: by 10.52.26.229 with SMTP id o5mr76638751vdg.66.1357684770324; Tue, 08 Jan 2013 14:39:30 -0800 (PST) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.58.164.100 with HTTP; Tue, 8 Jan 2013 14:39:10 -0800 (PST) From: =?ISO-8859-1?Q?Olivier_Cochard=2DLabb=E9?= Date: Tue, 8 Jan 2013 23:39:10 +0100 X-Google-Sender-Auth: fUm7pGiab1mIKCaBfQVwxRf9iPM Message-ID: Subject: How to use netmap pkt-gen on 9.1? To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 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: Tue, 08 Jan 2013 22:39:31 -0000 Hi, I'm try to use netmap pkt-gen on real and virtual (virtualbox) hardware with FreeBSD 9.1. My setup is pretty simple: ( HOST1 em0:1.1.1.1 ) <------> ( em0:1.1.1.2 HOST2 ) But I didn't reach to use pkt-gen (from tools/tools/netmap), I've got errors (on both physical and virtual machines): - Unable to get if info for em0 - Unable to mmap 0 KB - Unable to register interface em0 Here are all the steps I've done, where is my mistake ? [root@HOST1]~# uname -r 9.1-RELEASE [root@HOST1]~# kldload netmap 018.237252 netmap_new_obj_allocator [425] objsize 1024 clustsize 4096 objects 4 018.248826 netmap_new_obj_allocator [503] Pre-allocated 128 clusters (4/512KB) for 'netmap_if' 018.252891 netmap_new_obj_allocator [425] objsize 36864 clustsize 36864 objects 1 018.257305 netmap_new_obj_allocator [503] Pre-allocated 200 clusters (36/7200KB) for 'netmap_ring' 018.259826 netmap_new_obj_allocator [425] objsize 2048 clustsize 4096 objects 2 018.332819 netmap_new_obj_allocator [503] Pre-allocated 50000 clusters (4/200000KB) for 'netmap_buf' 018.351183 netmap_memory_init [553] Have 512 KB for interfaces, 7200 KB for rings and 195 MB for buffers netmap: loaded module with 202 Mbytes [root@HOST1]~# ifconfig em0 em0: flags=8843 metric 0 mtu 1500 options=9b ether aa:aa:00:01:01:01 inet 1.1.1.1 netmask 0xffffff00 broadcast 1.1.1.255 inet6 fe80::a8aa:ff:fe01:101%em0 prefixlen 64 scopeid 0x1 nd6 options=21 media: Ethernet autoselect (1000baseT ) status: active [root@HOST1]~# ping -c 1 1.1.1.2 PING 1.1.1.2 (1.1.1.2): 56 data bytes 64 bytes from 1.1.1.2: icmp_seq=0 ttl=64 time=0.466 ms --- 1.1.1.2 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.466/0.466/0.466/0.000 ms [root@HOST1]~# arp 1.1.1.2 ? (1.1.1.2) at aa:aa:00:00:02:12 on em0 expires in 1197 seconds [ethernet] [root@HOST1]~# pkt-gen -i em0 -t 500 -s 1.1.1.1 -d 1.1.1.2 -D aa:aa:00:00:02 main [808] ether_aton(aa:aa:00:00:02) gives 0x0 main [876] map size is 207712 Kb main [882] Unable to get if info for em0 main [889] bad nthreads 1, have 0 queues main [898] mmapping 0 Kbytes main [903] Unable to mmap 0 KB main [917] 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) main [951] Wait 2 secs for phy reset main [953] Ready... main [1004] Unable to register em0 main [1061] 0 pps Sent 0 packets, 60 bytes each, in 0.00 seconds. Speed: nanpps. Bandwidth: nanbps.