diff mbox

The ssthresh reduce during 3WHS

Message ID CAH4NVoT4ofCNKAmcnO1AgEbs+ywbXom=E28k2VU4dB+yK79S_A@mail.gmail.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Yong Zhang March 12, 2014, 1:46 p.m. UTC
hi,

I am trying to to apply patch 9ad7c049f0f79c418e293b1b68cf10d68f54fcdb
to my old version kernel, but I am not understanding the following
changes.

The comments int the patch say ssthresh may reduce unnecessarily
druing 3WHS,  but i can not find the reduce operation of ssthresh
during 3WHS.

Can you please explain when dose this may hanppen?



Thanks,
Fel
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eric Dumazet March 12, 2014, 2:26 p.m. UTC | #1
On Wed, 2014-03-12 at 21:46 +0800, Yong Zhang wrote:
> hi,
> 
> I am trying to to apply patch 9ad7c049f0f79c418e293b1b68cf10d68f54fcdb
> to my old version kernel, but I am not understanding the following
> changes.
> 
> The comments int the patch say ssthresh may reduce unnecessarily
> druing 3WHS,  but i can not find the reduce operation of ssthresh
> during 3WHS.
> 
> Can you please explain when dose this may hanppen?
> 

You might CC patch author when asking such questions...


> 
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index bef9f04..ea0d218 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -880,6 +880,11 @@ static void tcp_init_metrics(struct sock *sk)
> 
>         tp->snd_ssthresh = dst_metric(dst, RTAX_SSTHRESH);
>                  if (tp->snd_ssthresh > tp->snd_cwnd_clamp)
>                          tp->snd_ssthresh = tp->snd_cwnd_clamp;
> +       } else {
> +                /* ssthresh may have been reduced unnecessarily during.
> +                * 3WHS. Restore it back to its initial default.
> +                */
> +                tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
>          }
> 
> 
> Thanks,
> Fel
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yuchung Cheng March 12, 2014, 3:44 p.m. UTC | #2
On Wed, Mar 12, 2014 at 7:26 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> On Wed, 2014-03-12 at 21:46 +0800, Yong Zhang wrote:
> > hi,
> >
> > I am trying to to apply patch 9ad7c049f0f79c418e293b1b68cf10d68f54fcdb
> > to my old version kernel, but I am not understanding the following
> > changes.
> >
> > The comments int the patch say ssthresh may reduce unnecessarily
> > druing 3WHS,  but i can not find the reduce operation of ssthresh
> > during 3WHS.
> >
> > Can you please explain when dose this may hanppen?
I can think of two cases:

1. active open: syn -> (timeout) -> tcp_retransmit_timer ->
tcp_enter_loss -> reduce ssthresh

2. passive fast open: data sent during 3whs after syn-ack -> timeout
-> tcp_enter_loss -> reduce ssthresh

It's arguable the resetting is necessary or not. but resetting
ssthresh seems better b/c it is unlikely to be the BDP, especially in
case 1.

btw, it'll be easy to test this using https://code.google.com/p/packetdrill/

> >
>
> You might CC patch author when asking such questions...
>
>
> >
> > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> > index bef9f04..ea0d218 100644
> > --- a/net/ipv4/tcp_input.c
> > +++ b/net/ipv4/tcp_input.c
> > @@ -880,6 +880,11 @@ static void tcp_init_metrics(struct sock *sk)
> >
> >         tp->snd_ssthresh = dst_metric(dst, RTAX_SSTHRESH);
> >                  if (tp->snd_ssthresh > tp->snd_cwnd_clamp)
> >                          tp->snd_ssthresh = tp->snd_cwnd_clamp;
> > +       } else {
> > +                /* ssthresh may have been reduced unnecessarily during.
> > +                * 3WHS. Restore it back to its initial default.
> > +                */
> > +                tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
> >          }
> >
> >
> > Thanks,
> > Fel
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index bef9f04..ea0d218 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -880,6 +880,11 @@  static void tcp_init_metrics(struct sock *sk)

        tp->snd_ssthresh = dst_metric(dst, RTAX_SSTHRESH);
                 if (tp->snd_ssthresh > tp->snd_cwnd_clamp)
                         tp->snd_ssthresh = tp->snd_cwnd_clamp;
+       } else {
+                /* ssthresh may have been reduced unnecessarily during.
+                * 3WHS. Restore it back to its initial default.
+                */
+                tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
         }