PERFORCE change 166543 for review

Andre Oppermann andre at FreeBSD.org
Sat Jul 25 10:33:39 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=166543

Change 166543 by andre at andre_t61 on 2009/07/25 10:32:52

	Use SYSCTL_PROC() with sysctl_zonelimit to handle zone limit modifications
	to the reassembly zone.

Affected files ...

.. //depot/projects/tcp_reass/netinet/tcp_reass.c#49 edit

Differences ...

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

@@ -115,8 +115,9 @@
     "Per connection limit of TCP segment blocks in reassembly queue");
 
 static int tcp_reass_globalmaxblocks = 65535;
-SYSCTL_INT(_net_inet_tcp_reass, OID_AUTO, globalmaxblocks, CTLFLAG_RDTUN,
-    &tcp_reass_globalmaxblocks, 0,
+SYSCTL_PROC(_net_inet_tcp_reass, OID_AUTO, globalmaxblocks,
+    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;
@@ -168,7 +169,7 @@
 	tcp_reass_zone = uma_zcreate("tcpreass", sizeof(struct tcp_reass_block),
 	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
 	uma_zone_set_max(tcp_reass_zone, tcp_reass_globalmaxblocks);
-	tcp_reass_timeout = 30 * hz;
+	tcp_reass_timeout = 2 * TCPTV_MSL;
 }
 
 /*
@@ -380,8 +381,11 @@
 	else
 		thflags &= ~TH_FIN;
 
-	TCPSTAT_INC(tcps_rcvoopack);
-	TCPSTAT_ADD(tcps_rcvoobyte, len);
+	/* Statistics. */
+	if (tp->rcv_nxt != th_seq) {
+		TCPSTAT_INC(tcps_rcvoopack);
+		TCPSTAT_ADD(tcps_rcvoobyte, len);
+	}
 
 	/*
 	 * Get rid of packet header and mtags.


More information about the p4-projects mailing list