summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Petlund <apetlund@simula.no>2010-02-18 02:45:45 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-18 15:43:07 -0800
commit5aa4b32fc86408705337e941ed716880c63d1590 (patch)
tree7385d30e16f2c7203a74a3723728b7e8c6ecfa7b /include
parent16cad981863344ef779ab703545bb6f261a0f0ce (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/net/tcp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 75a00c80bdda..0bdc3f640247 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -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,