mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
tcp: fix ssthresh u16 leftover
It was once upon time so that snd_sthresh was a 16-bit quantity. ...That has not been true for long period of time. I run across some ancient compares which still seem to trust such legacy. Put all that magic into a single place, I hopefully found all of them. Compile tested, though linking of allyesconfig is ridiculous nowadays it seems. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
036d6a673f
commit
0b6a05c1db
6 changed files with 15 additions and 7 deletions
|
@ -793,6 +793,13 @@ static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp)
|
|||
return tp->packets_out - tcp_left_out(tp) + tp->retrans_out;
|
||||
}
|
||||
|
||||
#define TCP_INFINITE_SSTHRESH 0x7fffffff
|
||||
|
||||
static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp)
|
||||
{
|
||||
return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH;
|
||||
}
|
||||
|
||||
/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd.
|
||||
* The exception is rate halving phase, when cwnd is decreasing towards
|
||||
* ssthresh.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue