Skip to content

Commit

Permalink
tcp: fix tso_should_defer in 64bit
Browse files Browse the repository at this point in the history
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: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed Dec 6, 2008
1 parent d5dd917 commit a2acde0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/tcp_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb)

/* Defer for less than two clock ticks. */
if (tp->tso_deferred &&
((jiffies << 1) >> 1) - (tp->tso_deferred >> 1) > 1)
(((u32)jiffies << 1) >> 1) - (tp->tso_deferred >> 1) > 1)
goto send_now;

in_flight = tcp_packets_in_flight(tp);
Expand Down

0 comments on commit a2acde0

Please sign in to comment.