diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/net/tcp.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index b92bdc7c92a9..0a4ed6e85c6f 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -719,6 +719,34 @@ static inline void tcp_ca_event(struct sock *sk, const enum tcp_ca_event event) | |||
719 | icsk->icsk_ca_ops->cwnd_event(sk, event); | 719 | icsk->icsk_ca_ops->cwnd_event(sk, event); |
720 | } | 720 | } |
721 | 721 | ||
722 | /* These functions determine how the current flow behaves in respect of SACK | ||
723 | * handling. SACK is negotiated with the peer, and therefore it can vary | ||
724 | * between different flows. | ||
725 | * | ||
726 | * tcp_is_sack - SACK enabled | ||
727 | * tcp_is_reno - No SACK | ||
728 | * tcp_is_fack - FACK enabled, implies SACK enabled | ||
729 | */ | ||
730 | static inline int tcp_is_sack(const struct tcp_sock *tp) | ||
731 | { | ||
732 | return tp->rx_opt.sack_ok; | ||
733 | } | ||
734 | |||
735 | static inline int tcp_is_reno(const struct tcp_sock *tp) | ||
736 | { | ||
737 | return !tcp_is_sack(tp); | ||
738 | } | ||
739 | |||
740 | static inline int tcp_is_fack(const struct tcp_sock *tp) | ||
741 | { | ||
742 | return tp->rx_opt.sack_ok & 2; | ||
743 | } | ||
744 | |||
745 | static inline void tcp_enable_fack(struct tcp_sock *tp) | ||
746 | { | ||
747 | tp->rx_opt.sack_ok |= 2; | ||
748 | } | ||
749 | |||
722 | static inline unsigned int tcp_left_out(const struct tcp_sock *tp) | 750 | static inline unsigned int tcp_left_out(const struct tcp_sock *tp) |
723 | { | 751 | { |
724 | return tp->sacked_out + tp->lost_out; | 752 | return tp->sacked_out + tp->lost_out; |