lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100914093758.GA24348@ms2.inr.ac.ru>
Date:	Tue, 14 Sep 2010 13:37:58 +0400
From:	Alexey Kuznetsov <kuznet@....inr.ac.ru>
To:	David Miller <davem@...emloft.net>
Cc:	ilpo.jarvinen@...sinki.fi, eric.dumazet@...il.com,
	leandroal@...il.com, netdev@...r.kernel.org
Subject: Re: TCP packet size and delivery packet decisions

Hello!

> Therefore, how about the following?

This will work.

There is one trap though. If pktsize > max_window, packets never
will be transmitted in normal path, only from probe timer, which
will be very slow.

If we do not want to mess with tcp_write_xmit(), it is still possible
to relax the bound to tp->max_window. (BTW, this even does not
contradict to RFC, only Fs = 1 for tiny windows). This should work:

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 34f5cc2..8cf8cdb 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -501,8 +501,22 @@ extern unsigned int tcp_current_mss(struct sock *sk);
 /* Bound MSS / TSO packet size with the half of the window */
 static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
 {
-	if (tp->max_window && pktsize > (tp->max_window >> 1))
-		return max(tp->max_window >> 1, 68U - tp->tcp_header_len);
+	int cutoff;
+
+	/* When peer uses tiny windows, there is no use in packetizing
+	 * to sub-MSS pieces for the sake of SWS or making sure there
+	 * are enough packets in the pipe for fast recovery.
+	 *
+	 * On the other hand, for extremely large MSS devices, handling
+	 * smaller than MSS windows in this way does make sense.
+	 */
+	if (tp->max_window >= 512)
+		cutoff = (tp->max_window >> 1);
+	else
+		cutoff = tp->max_window;
+
+	if (cutoff && pktsize > cutoff)
+		return max(cutoff, 68U - tp->tcp_header_len);
 	else
 		return pktsize;
 }


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ