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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 20 Dec 2007 00:02:56 +0200 (EET) From: "Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi> To: David Miller <davem@...emloft.net> cc: Netdev <netdev@...r.kernel.org> Subject: Re: TSO trimming question On Wed, 19 Dec 2007, Ilpo Järvinen wrote: > I'm not fully sure what's purpose of this code in tcp_write_xmit: > > if (skb->len < limit) { > unsigned int trim = skb->len % mss_now; > > if (trim) > limit = skb->len - trim; > } > > Is it used to make sure we send only multiples of mss_now here and leave > the left-over into another skb? Or does it try to make sure that > tso_fragment result honors multiple of mss_now boundaries when snd_wnd > is the limitting factor? For latter IMHO this would be necessary: > > if (skb->len > limit) > limit -= limit % mss_now; ...Anyway, here's an untested patch to just do it :-): -- i. [PATCH] [TCP]: Force tso skb split to mss_now boundary (if snd_wnd limits) If snd_wnd was limitting factor, the tso_fragment might not create full-sized skbs but would include the window left-overs as well. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi> --- net/ipv4/tcp_output.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 1c7ef17..8dafda9 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1453,6 +1453,8 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) if (trim) limit = skb->len - trim; + } else if (skb->len > limit) { + limit -= limit % mss_now; } } @@ -1525,6 +1527,8 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now) if (trim) limit = skb->len - trim; + } else if (skb->len > limit) { + limit -= limit % mss_now; } } -- 1.5.0.6
Powered by blists - more mailing lists