How to use netmap pkt-gen on 9.1?

Olivier Cochard-Labbé olivier at cochard.me
Tue Jan 8 22:39:31 UTC 2013


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 at HOST1]~# uname -r
9.1-RELEASE
[root at 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 at HOST1]~# ifconfig em0
em0: flags=8843<UP,BROADCAST,
RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        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<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active

[root at 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 at 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 at 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.


More information about the freebsd-net mailing list