From owner-freebsd-net@FreeBSD.ORG Tue Jan 8 23:02:49 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 6284182B for ; Tue, 8 Jan 2013 23:02:49 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id E1254176 for ; Tue, 8 Jan 2013 23:02:48 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id E0DDC7300A; Wed, 9 Jan 2013 00:02:00 +0100 (CET) Date: Wed, 9 Jan 2013 00:02:00 +0100 From: Luigi Rizzo To: Olivier Cochard-Labb? Subject: Re: How to use netmap pkt-gen on 9.1? Message-ID: <20130108230200.GA36903@onelab2.iet.unipi.it> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i 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: Tue, 08 Jan 2013 23:02:49 -0000 On Tue, Jan 08, 2013 at 11:39:10PM +0100, Olivier Cochard-Labb? wrote: > 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 ? 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) The changes are clearly identified by #ifdef DEV_NETMAP/#endif blocks. cheers luigi > [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 RUNNING,SIMPLEX,MULTICAST> 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. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"