patch-2.3.99-pre4 linux/include/net/tcp.h

Next file: linux/include/scsi/sg.h
Previous file: linux/include/net/sock.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre3/linux/include/net/tcp.h linux/include/net/tcp.h
@@ -669,8 +669,6 @@
 						  struct tcphdr *th, int len, 
 						  struct sk_buff *skb);
 
-extern void			tcp_v4_send_reset(struct sk_buff *skb);
-
 extern int			tcp_v4_conn_request(struct sock *sk,
 						    struct sk_buff *skb);
 
@@ -908,6 +906,13 @@
 
 #define TCP_SKB_CB(__skb)	((struct tcp_skb_cb *)&((__skb)->cb[0]))
 
+/*
+ *	Compute minimal free write space needed to queue new packets. 
+ */
+#define tcp_min_write_space(__sk) \
+	(atomic_read(&(__sk)->wmem_alloc) / 2)
+
+
 /* This determines how many packets are "in the network" to the best
  * of our knowledge.  In many cases it is conservative, but where
  * detailed information is available from the receiver (via SACK
@@ -1342,6 +1347,15 @@
 
 	if (sk->rcvbuf < 3*rcvbuf)
 		sk->rcvbuf = min (3*rcvbuf, sysctl_rmem_max);
+
+	/* Reserve slack space to reduce jitter of advertised window. */
+	if (tp->window_clamp >= tcp_full_space(sk)) {
+		int nwin = tcp_full_space(sk) - tp->mss_clamp;
+
+		if (nwin >= MAX_TCP_WINDOW && nwin >= 2*tp->advmss)
+			tp->window_clamp = nwin;
+	}
+
 	if (sk->sndbuf < 3*sndbuf)
 		sk->sndbuf = min (3*sndbuf, sysctl_wmem_max);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)