aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 1c839c99114c..517d737059d1 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1806,40 +1806,6 @@ static bool tcp_snd_wnd_test(const struct tcp_sock *tp,
1806 return !after(end_seq, tcp_wnd_end(tp)); 1806 return !after(end_seq, tcp_wnd_end(tp));
1807} 1807}
1808 1808
1809/* This checks if the data bearing packet SKB (usually tcp_send_head(sk))
1810 * should be put on the wire right now. If so, it returns the number of
1811 * packets allowed by the congestion window.
1812 */
1813static unsigned int tcp_snd_test(const struct sock *sk, struct sk_buff *skb,
1814 unsigned int cur_mss, int nonagle)
1815{
1816 const struct tcp_sock *tp = tcp_sk(sk);
1817 unsigned int cwnd_quota;
1818
1819 tcp_init_tso_segs(skb, cur_mss);
1820
1821 if (!tcp_nagle_test(tp, skb, cur_mss, nonagle))
1822 return 0;
1823
1824 cwnd_quota = tcp_cwnd_test(tp, skb);
1825 if (cwnd_quota && !tcp_snd_wnd_test(tp, skb, cur_mss))
1826 cwnd_quota = 0;
1827
1828 return cwnd_quota;
1829}
1830
1831/* Test if sending is allowed right now. */
1832bool tcp_may_send_now(struct sock *sk)
1833{
1834 const struct tcp_sock *tp = tcp_sk(sk);
1835 struct sk_buff *skb = tcp_send_head(sk);
1836
1837 return skb &&
1838 tcp_snd_test(sk, skb, tcp_current_mss(sk),
1839 (tcp_skb_is_last(sk, skb) ?
1840 tp->nonagle : TCP_NAGLE_PUSH));
1841}
1842
1843/* Trim TSO SKB to LEN bytes, put the remaining data into a new packet 1809/* Trim TSO SKB to LEN bytes, put the remaining data into a new packet
1844 * which is put after SKB on the list. It is very much like 1810 * which is put after SKB on the list. It is very much like
1845 * tcp_fragment() except that it may make several kinds of assumptions 1811 * tcp_fragment() except that it may make several kinds of assumptions