summaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-08-30 11:20:09 -0700
committerDavid S. Miller <davem@davemloft.net>2017-08-30 11:20:09 -0700
commit2c667d40a67a6a49343a75437b5e49d301a07a53 (patch)
treea4635a632732b39ef560a8f72eb3a81d04f01605 /include/net/tcp.h
parent0da93d2ebb5d198a4601bd5ad7695f3c6fd36062 (diff)
parent31770e34e43d6c8dee129bfee77e56c34e61f0e5 (diff)
downloadlinux-2c667d40a67a6a49343a75437b5e49d301a07a53.tar.bz2
Merge branch 'tcp-readd-hp'
Florian Westphal says: ==================== tcp: re-add header prediction Eric reported a performance regression caused by header prediction removal. We now call tcp_ack() much more frequently, for some workloads this brings in enough cache line misses to become noticeable. We could possibly still kill HP provided we find a different way to suppress unneeded tcp_ack, but given we're late in the cycle it seems preferable to revert. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index c614ff135b66..9c3db054e47f 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -634,6 +634,29 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp)
return usecs_to_jiffies((tp->srtt_us >> 3) + tp->rttvar_us);
}
+static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
+{
+ tp->pred_flags = htonl((tp->tcp_header_len << 26) |
+ ntohl(TCP_FLAG_ACK) |
+ snd_wnd);
+}
+
+static inline void tcp_fast_path_on(struct tcp_sock *tp)
+{
+ __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale);
+}
+
+static inline void tcp_fast_path_check(struct sock *sk)
+{
+ struct tcp_sock *tp = tcp_sk(sk);
+
+ if (RB_EMPTY_ROOT(&tp->out_of_order_queue) &&
+ tp->rcv_wnd &&
+ atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf &&
+ !tp->urg_data)
+ tcp_fast_path_on(tp);
+}
+
/* Compute the actual rto_min value */
static inline u32 tcp_rto_min(struct sock *sk)
{
@@ -910,8 +933,9 @@ enum tcp_ca_event {
/* Information about inbound ACK, passed to cong_ops->in_ack_event() */
enum tcp_ca_ack_event_flags {
- CA_ACK_WIN_UPDATE = (1 << 0), /* ACK updated window */
- CA_ACK_ECE = (1 << 1), /* ECE bit is set on ack */
+ CA_ACK_SLOWPATH = (1 << 0), /* In slow path processing */
+ CA_ACK_WIN_UPDATE = (1 << 1), /* ACK updated window */
+ CA_ACK_ECE = (1 << 2), /* ECE bit is set on ack */
};
/*