net: TCP thin-stream detection

Inline function to dynamically detect thin streams based on
the number of packets in flight. Used to dynamically trigger
thin-stream mechanisms if enabled by ioctl or sysctl.

Signed-off-by: Andreas Petlund <apetlund@simula.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andreas Petlund
2010-02-18 02:45:45 +00:00
committed by David S. Miller
parent 16cad98186
commit 5aa4b32fc8
2 changed files with 55 additions and 0 deletions

View File

@@ -1386,6 +1386,14 @@ static inline void tcp_highest_sack_combine(struct sock *sk,
tcp_sk(sk)->highest_sack = new;
}
/* Determines whether this is a thin stream (which may suffer from
* increased latency). Used to trigger latency-reducing mechanisms.
*/
static inline unsigned int tcp_stream_is_thin(struct tcp_sock *tp)
{
return tp->packets_out < 4 && !tcp_in_initial_slowstart(tp);
}
/* /proc */
enum tcp_seq_states {
TCP_SEQ_STATE_LISTENING,