How to use netmap pkt-gen on 9.1?

Luigi Rizzo rizzo at iet.unipi.it
Wed Jan 9 13:55:08 UTC 2013


On Wed, Jan 9, 2013 at 5:21 AM, Olivier Cochard-Labbé <olivier at cochard.me>wrote:

> On Wed, Jan 9, 2013 at 12:02 AM, Luigi Rizzo <rizzo at iet.unipi.it> 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 at 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 at orange.bsdrp.net:
> /usr/obj/BSDRP.amd64/usr/local/BSDRPexp/FreeBSD/src/sys/amd64
>  amd64
> [root at router]~# kldload netmap
> netmap: loaded module
> [root at 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 = 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 = 0
>


-- 
-----------------------------------------+-------------------------------
 Prof. Luigi RIZZO, rizzo at 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)
-----------------------------------------+-------------------------------


More information about the freebsd-net mailing list