netmap and jumbo packets

David dajose22 at gmail.com
Thu Sep 11 18:13:36 UTC 2014


Hi,

I am learning to use netmap. Currently I got pkt-gen working (without
drivers). When I try to set packet size above 2048 I got an error.

Searching through the code I found in sys/dev/netmap/netmap_mem2.c the size
constrain. I change it like this:

diff --git a/sys/dev/netmap/netmap_mem2.c b/sys/dev/netmap/netmap_mem2.c
index a15a8c7..8c561cb 100644
--- a/sys/dev/netmap/netmap_mem2.c
+++ b/sys/dev/netmap/netmap_mem2.c
@@ -25,6 +25,7 @@

 #ifdef linux
 #include "bsd_glue.h"
+#include <linux/vmalloc.h>
 #endif /* linux */

 #ifdef __APPLE__
@@ -54,7 +55,7 @@ __FBSDID("$FreeBSD: head/sys/dev/netmap/netmap.c 241723
2012-1
 #include <dev/netmap/netmap_kern.h>
 #include "netmap_mem2.h"

-#define NETMAP_BUF_MAX_NUM     20*4096*2       /* large machine */
+#define NETMAP_BUF_MAX_NUM     10*4096*2       /* large machine */

 #define NETMAP_POOL_MAX_NAMSZ  32

@@ -183,7 +184,7 @@ struct netmap_obj_params netmap_params[NETMAP_POOLS_NR]
= {
                .num  = 200,
        },
        [NETMAP_BUF_POOL] = {
-               .size = 2048,
+               .size = 8192,
                .num  = NETMAP_BUF_MAX_NUM,
        },
 };


(first change is not related)

I had to change NETMAP_BUF_MAX_NUM because of the amount of memory needed.


This way I can send packets as big as 8192 (which is what I need). Is there
any problems this will bring on? (maybe decrease the performance or any
other side effect)

thanks

-- 
David Díaz Barquero

Ingeniería en Computadores
Tecnológico de Costa Rica


More information about the freebsd-net mailing list