How to use netmap pkt-gen on 9.1?

Olivier Cochard-Labbé olivier at cochard.me
Wed Jan 9 16:50:34 UTC 2013


On Wed, Jan 9, 2013 at 2:54 PM, Luigi Rizzo <rizzo at iet.unipi.it> 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 at 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 at orange.bsdrp.net:/usr/obj/BSDRP.amd64/usr/local/BSDRP/FreeBSD/src/sys/amd64
 amd6

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


More information about the freebsd-net mailing list