diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index df6a2eb20193..a64022199b62 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -779,6 +779,21 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk) | |||
779 | /* Use define here intentionally to get WARN_ON location shown at the caller */ | 779 | /* Use define here intentionally to get WARN_ON location shown at the caller */ |
780 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) | 780 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) |
781 | 781 | ||
782 | /* | ||
783 | * Convert RFC 3390 larger initial window into an equivalent number of packets. | ||
784 | * | ||
785 | * John Heffner states: | ||
786 | * | ||
787 | * The RFC specifies a window of no more than 4380 bytes | ||
788 | * unless 2*MSS > 4380. Reading the pseudocode in the RFC | ||
789 | * is a bit misleading because they use a clamp at 4380 bytes | ||
790 | * rather than a multiplier in the relevant range. | ||
791 | */ | ||
792 | static inline u32 rfc3390_bytes_to_packets(const u32 smss) | ||
793 | { | ||
794 | return smss <= 1095 ? 4 : (smss > 1460 ? 2 : 3); | ||
795 | } | ||
796 | |||
782 | extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); | 797 | extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); |
783 | extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); | 798 | extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); |
784 | 799 | ||