提交 d6574608 编写于 作者: E Eric Dumazet 提交者: Xie XiuQi

tcp: hint compiler about sack flows

mainline inclusion
from mainline-v5.0-rc1
commit ebeef4bcccf4681ba3de04fbf3a005f6054f7999
category: perf
bugzilla: NA
CVE: NA

-------------------------------------------------
Tell the compiler that most TCP flows are using SACK these days.

There is no need to add the unlikely() clause in tcp_is_reno(),
the compiler is able to infer it.
Signed-off-by: NEric Dumazet <edumazet@google.com>
Acked-by: NNeal Cardwell <ncardwell@google.com>
Acked-by: NYuchung Cheng <ycheng@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NBiaoxiang <yebiaoxiang@huawei.com>
Reviewed-by: NMao Wenan <maowenan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5b51050a
...@@ -1115,7 +1115,7 @@ void tcp_rate_check_app_limited(struct sock *sk); ...@@ -1115,7 +1115,7 @@ void tcp_rate_check_app_limited(struct sock *sk);
*/ */
static inline int tcp_is_sack(const struct tcp_sock *tp) static inline int tcp_is_sack(const struct tcp_sock *tp)
{ {
return tp->rx_opt.sack_ok; return likely(tp->rx_opt.sack_ok);
} }
static inline bool tcp_is_reno(const struct tcp_sock *tp) static inline bool tcp_is_reno(const struct tcp_sock *tp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册