From: Eric Dumazet <dada1@cosmosbay.com>
To: Denys <nuclearcat@nuclearcat.com>,
"David S. Miller" <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: 2.6.21 -> 2.6.22 & 2.6.23-rc8 performance regression
Date: Mon, 01 Oct 2007 22:10:03 +0200 [thread overview]
Message-ID: <4701541B.70108@cosmosbay.com> (raw)
In-Reply-To: <47008CB0.7010808@cosmosbay.com>
[-- Attachment #1: Type: text/plain, Size: 673 bytes --]
So maybe the following patch is necessary...
I believe IPV6 & DCCP are immune to this problem.
Thanks again Denys for spotting this.
Eric
[PATCH] TCP : secure_tcp_sequence_number() should not use a too fast clock
TCP V4 sequence numbers are 32bits, and RFC 793 assumed a 250 KHz clock.
In order to follow network speed increase, we can use a faster clock, but
we should limit this clock so that the delay between two rollovers is
greater than MSL (TCP Maximum Segment Lifetime : 2 minutes)
Choosing a 64 nsec clock should be OK, since the rollovers occur every
274 seconds.
Problem spotted by Denys Fedoryshchenko
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
[-- Attachment #2: seq.patch --]
[-- Type: text/plain, Size: 990 bytes --]
--- linux-2.6.22/drivers/char/random.c 2007-10-01 10:18:42.000000000 +0200
+++ linux-2.6.22-ed/drivers/char/random.c 2007-10-01 21:47:58.000000000 +0200
@@ -1550,11 +1550,13 @@ __u32 secure_tcp_sequence_number(__be32
* As close as possible to RFC 793, which
* suggests using a 250 kHz clock.
* Further reading shows this assumes 2 Mb/s networks.
- * For 10 Gb/s Ethernet, a 1 GHz clock is appropriate.
- * That's funny, Linux has one built in! Use it!
- * (Networks are faster now - should this be increased?)
+ * For 10 Mb/s Ethernet, a 1 MHz clock is appropriate.
+ * For 10 Gb/s Ethernet, a 1 GHz clock should be ok, but
+ * we also need to limit the resolution so that the u32 seq
+ * overlaps less than one time per MSL (2 minutes).
+ * Choosing a clock of 64 ns period is OK. (period of 274 s)
*/
- seq += ktime_get_real().tv64;
+ seq += ktime_get_real().tv64 >> 6;
#if 0
printk("init_seq(%lx, %lx, %d, %d) = %d\n",
saddr, daddr, sport, dport, seq);
next prev parent reply other threads:[~2007-10-01 20:10 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-30 14:48 2.6.21 -> 2.6.22 & 2.6.23-rc8 performance regression Denys
2007-09-30 17:48 ` Eric Dumazet
2007-09-30 4:25 ` Nick Piggin
2007-09-30 22:04 ` Denys
2007-10-01 10:01 ` Andi Kleen
2007-10-01 10:30 ` Denys
2007-10-01 11:14 ` Andi Kleen
2007-10-01 11:52 ` Denys
2007-10-01 11:57 ` Andi Kleen
2007-10-01 12:04 ` Denys
2007-09-30 22:35 ` Denys
2007-10-01 5:59 ` Eric Dumazet
2007-10-01 7:12 ` David Miller
2007-10-01 8:07 ` Denys
2007-10-01 8:20 ` Eric Dumazet
2007-10-01 8:35 ` Eric Dumazet
2007-10-01 12:10 ` Denys
2007-10-01 13:26 ` Denys
2007-10-01 20:10 ` Eric Dumazet [this message]
2007-10-01 20:57 ` David Miller
2007-09-30 23:24 ` Denys
2007-10-01 6:43 ` Denys
2007-09-30 18:45 ` Denys
-- strict thread matches above, loose matches on Subject: below --
2007-09-30 15:22 Denys
2007-09-30 17:31 Denys
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4701541B.70108@cosmosbay.com \
--to=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nuclearcat@nuclearcat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox