Skip to content

Commit ebeef4b

Browse files
Eric Dumazetdavem330
authored andcommitted
tcp: hint compiler about sack flows
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: Eric Dumazet <[email protected]> Acked-by: Neal Cardwell <[email protected]> Acked-by: Yuchung Cheng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b0e3f1b commit ebeef4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/tcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ void tcp_rate_check_app_limited(struct sock *sk);
11241124
*/
11251125
static inline int tcp_is_sack(const struct tcp_sock *tp)
11261126
{
1127-
return tp->rx_opt.sack_ok;
1127+
return likely(tp->rx_opt.sack_ok);
11281128
}
11291129

11301130
static inline bool tcp_is_reno(const struct tcp_sock *tp)

0 commit comments

Comments
 (0)