route: Add net.route.kmalloc_limit tunable to raise M_RTABLE limit
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 16 Jan 2012 03:11:52 +0000 (11:11 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 16 Jan 2012 03:15:36 +0000 (11:15 +0800)
sys/net/route.c

index 5f88536..f4cc4c5 100644 (file)
@@ -134,6 +134,9 @@ int route_assert_owner_access = 0;
 SYSCTL_INT(_net_route, OID_AUTO, assert_owner_access, CTLFLAG_RW,
            &route_assert_owner_access, 0, "");
 
+u_long route_kmalloc_limit = 0;
+TUNABLE_ULONG("net.route.kmalloc_limit", &route_kmalloc_limit);
+
 /*
  * Initialize the route table(s) for protocol domains and
  * create a helper thread which will be responsible for updating
@@ -155,6 +158,9 @@ route_init(void)
                            0, cpu, "rtable_cpu %d", cpu);
                rt_ports[cpu] = &rtd->td_msgport;
        }
+
+       if (route_kmalloc_limit)
+               kmalloc_raise_limit(M_RTABLE, route_kmalloc_limit);
 }
 
 static void