Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jul 2009 13:12:33 GMT
From:      Andre Oppermann <andre@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 166553 for review
Message-ID:  <200907251312.n6PDCXmm004875@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=166553

Change 166553 by andre@andre_flirtbox on 2009/07/25 13:12:31

	For sysctl_zonelimit() the zone has to be passed by reference.

Affected files ...

.. //depot/projects/tcp_reass/kern/kern_sysctl.c#9 edit
.. //depot/projects/tcp_reass/netinet/tcp_reass.c#50 edit

Differences ...

==== //depot/projects/tcp_reass/kern/kern_sysctl.c#9 (text+ko) ====

@@ -972,9 +972,10 @@
 sysctl_zonelimit(SYSCTL_HANDLER_ARGS)
 {
 	int error, nitems;
-	uma_zone_t zone = (uma_zone_t)arg1;
+	uma_zone_t *zone;
+	zone = (uma_zone_t *)arg1;
 
-	nitems = uma_zone_get_max(zone);
+	nitems = uma_zone_get_max(*zone);
 
 	error = sysctl_handle_int(oidp, &nitems, 0, req);
 	if (error || !req->newptr)
@@ -983,7 +984,7 @@
 	if (nitems < 1)
 		return (EINVAL);
 
-	uma_zone_set_max(zone, nitems);
+	uma_zone_set_max(*zone, nitems);
 	return (error);
 }
 

==== //depot/projects/tcp_reass/netinet/tcp_reass.c#50 (text+ko) ====

@@ -63,7 +63,6 @@
  *
  * TODO:
  * - Improve comments and annotate RFC references.
- * - Resizing of tcp_reass_globalmaxblocks through sysctl.
  * - Style improvements.
  * - Lots of testing.
  */
@@ -99,7 +98,7 @@
 #include <netinet/tcp_var.h>
 #include <netinet/tcpip.h>
 
-VNET_DEFINE(uma_zone_t, tcp_reass_zone);
+uma_zone_t	tcp_reass_zone;
 
 SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0,
     "TCP Segment Reassembly Queue");
@@ -116,8 +115,8 @@
 
 static int tcp_reass_globalmaxblocks = 65535;
 SYSCTL_PROC(_net_inet_tcp_reass, OID_AUTO, globalmaxblocks,
-    CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_TUN, tcp_reass_zone,
-    0, sysctl_zonelimit, "I",
+    CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_TUN, &tcp_reass_zone, 0,
+    sysctl_zonelimit, "I",
     "Global limit of TCP segment blocks in reassembly queue");
 
 static int tcp_reass_timeout = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907251312.n6PDCXmm004875>