Commit a2acde07 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by David S. Miller

tcp: fix tso_should_defer in 64bit

Since jiffies is unsigned long, the types get expanded into
that and after long enough time the difference will therefore
always be > 1 (and that probably happens near boot as well as
iirc the first jiffies wrap is scheduler close after boot to
find out problems related to that early).

This was originally noted by Bill Fink in Dec'07 but nobody
never ended fixing it.
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d5dd9175
...@@ -1334,7 +1334,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) ...@@ -1334,7 +1334,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb)
/* Defer for less than two clock ticks. */ /* Defer for less than two clock ticks. */
if (tp->tso_deferred && if (tp->tso_deferred &&
((jiffies << 1) >> 1) - (tp->tso_deferred >> 1) > 1) (((u32)jiffies << 1) >> 1) - (tp->tso_deferred >> 1) > 1)
goto send_now; goto send_now;
in_flight = tcp_packets_in_flight(tp); in_flight = tcp_packets_in_flight(tp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment