Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 726e07a8 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by David S. Miller
Browse files

tcp: move some parts from tcp_write_xmit

parent 41834b73
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -1530,13 +1530,6 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle)
	int cwnd_quota;
	int result;

	/* If we are closed, the bytes will have to remain here.
	 * In time closedown will finish, we empty the write queue and all
	 * will be happy.
	 */
	if (unlikely(sk->sk_state == TCP_CLOSE))
		return 0;

	sent_pkts = 0;

	/* Do MTU probing. */
@@ -1608,11 +1601,19 @@ void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
{
	struct sk_buff *skb = tcp_send_head(sk);

	if (skb) {
	if (!skb)
		return;

	/* If we are closed, the bytes will have to remain here.
	 * In time closedown will finish, we empty the write queue and
	 * all will be happy.
	 */
	if (unlikely(sk->sk_state == TCP_CLOSE))
		return;

	if (tcp_write_xmit(sk, cur_mss, nonagle))
		tcp_check_probe_timer(sk);
}
}

/* Send _single_ skb sitting at the send head. This function requires
 * true push pending frames to setup probe timer etc.