All of lore.kernel.org
 help / color / mirror / Atom feed
From: Soheil Hassas Yeganeh <soheil@google.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Neal Cardwell <ncardwell@google.com>,
	Yuchung Cheng <ycheng@google.com>,
	Willem de Bruijn <willemb@google.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH net] tcp: refactor tcp_retransmit_timer()
Date: Tue, 3 Dec 2019 11:08:21 -0500	[thread overview]
Message-ID: <CACSApvZ5GTrWLkR-i1YcAw608=xSOST_6uVsooafFo6P5Z6z=g@mail.gmail.com> (raw)
In-Reply-To: <20191203160552.31071-1-edumazet@google.com>

On Tue, Dec 3, 2019 at 11:05 AM Eric Dumazet <edumazet@google.com> wrote:
>
> It appears linux-4.14 stable needs a backport of commit
> 88f8598d0a30 ("tcp: exit if nothing to retransmit on RTO timeout")
>
> Since tcp_rtx_queue_empty() is not in pre 4.15 kernels,
> let's refactor tcp_retransmit_timer() to only use tcp_rtx_queue_head()
>
> I will provide to stable teams the squashed patches.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Willem de Bruijn <willemb@google.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Acked-by: Soheil Hassas Yeganeh <soheil@google.com>

Thanks, Eric!

> ---
>  net/ipv4/tcp_timer.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
> index dd5a6317a8018a45ad609f832ced6df2937ad453..1097b438befe14ae3f375f3dbcc1f2d375a93879 100644
> --- a/net/ipv4/tcp_timer.c
> +++ b/net/ipv4/tcp_timer.c
> @@ -434,6 +434,7 @@ void tcp_retransmit_timer(struct sock *sk)
>         struct net *net = sock_net(sk);
>         struct inet_connection_sock *icsk = inet_csk(sk);
>         struct request_sock *req;
> +       struct sk_buff *skb;
>
>         req = rcu_dereference_protected(tp->fastopen_rsk,
>                                         lockdep_sock_is_held(sk));
> @@ -446,7 +447,12 @@ void tcp_retransmit_timer(struct sock *sk)
>                  */
>                 return;
>         }
> -       if (!tp->packets_out || WARN_ON_ONCE(tcp_rtx_queue_empty(sk)))
> +
> +       if (!tp->packets_out)
> +               return;
> +
> +       skb = tcp_rtx_queue_head(sk);
> +       if (WARN_ON_ONCE(!skb))
>                 return;
>
>         tp->tlp_high_seq = 0;
> @@ -480,7 +486,7 @@ void tcp_retransmit_timer(struct sock *sk)
>                         goto out;
>                 }
>                 tcp_enter_loss(sk);
> -               tcp_retransmit_skb(sk, tcp_rtx_queue_head(sk), 1);
> +               tcp_retransmit_skb(sk, skb, 1);
>                 __sk_dst_reset(sk);
>                 goto out_reset_timer;
>         }
> --
> 2.24.0.393.g34dc348eaf-goog
>

  reply	other threads:[~2019-12-03 16:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 16:05 [PATCH net] tcp: refactor tcp_retransmit_timer() Eric Dumazet
2019-12-03 16:08 ` Soheil Hassas Yeganeh [this message]
2019-12-03 19:13 ` Greg Kroah-Hartman
2019-12-03 19:15   ` Eric Dumazet
2019-12-03 19:22     ` Greg Kroah-Hartman
2019-12-03 19:30       ` Eric Dumazet
2019-12-03 20:23         ` Greg Kroah-Hartman
2019-12-03 19:53 ` David Miller
2019-12-03 20:23   ` Greg KH
     [not found]     ` <CANn89iKP7EZZRBtdcvFZVWP5-zs6uUWTgvo_Az+W+PKyA=rvxw@mail.gmail.com>
2019-12-03 21:15       ` Greg Kroah-Hartman
2019-12-03 21:18     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACSApvZ5GTrWLkR-i1YcAw608=xSOST_6uVsooafFo6P5Z6z=g@mail.gmail.com' \
    --to=soheil@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.com \
    --cc=ycheng@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.