Skip to content
Snippets Groups Projects
Commit d6574608 authored by Eric Dumazet's avatar Eric Dumazet Committed by 谢秀奇
Browse files

tcp: hint compiler about sack flows


mainline inclusion
from mainline-v5.0-rc1
commit ebeef4bc
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: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Acked-by: default avatarYuchung Cheng <ycheng@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarBiaoxiang <yebiaoxiang@huawei.com>
Reviewed-by: default avatarMao Wenan <maowenan@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 5b51050a
No related branches found
No related tags found
No related merge requests found
......@@ -1115,7 +1115,7 @@ void tcp_rate_check_app_limited(struct sock *sk);
*/
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)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment