netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Linux Kernel Network Bug Report] tcp_rmem[1] is not resulting in correct TCP window size since 3.4
       [not found] <CAM5yEy0ZU42Kew4JcQVNsda_X2O8QL9m8F15-02tPAVrz6o54w@mail.gmail.com>
@ 2021-02-10 15:37 ` Eric Dumazet
  2021-02-10 15:45   ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2021-02-10 15:37 UTC (permalink / raw)
  To: Zhibin Liu; +Cc: netdev, Tianpeng Jin, Chunlei Zhu, Weiming Liu, Yuchung Cheng

On Wed, Feb 10, 2021 at 4:14 PM Zhibin Liu <zhibinliu@google.com> wrote:
>
> Hi, Linux Kernel Networking TCP maintainers,
>
> I sent this bug report mail following the reporting bug guideline.
>
> Here is the details of the bug:
> tcp_rmem[1] has value 87380, which will result in a window of 65535 when tcp_adv_win_scale=2. (87380 - 87380/2^2 = 65535)
>
> But since 3.4, commit b49960a05e32121d29316cfdf653894b88ac9190, tcp_adv_win_scale default value is changed from 2 to 1.
>
> The change causes tcp_rmem[1] with value 87380 will result in a window of 43690, instead of expected 65535.


win of 65535 was used in SYN and SYNACK way after commit
b49960a05e32121d (this commit is 8 years old : Wed May 2 02:28:41
2012)

Change was done by Yuchung in 2018
in commit a337531b942bd8a03e7052444d7e36972aac2d92 tcp: up initial
rmem to 128KB and SYN rwin to around 64KB



>
> Now the doc Documentation/networking/ip-sysctl.rst is still mentioning 87380 tcp_rmem[1] will result in 65535 window size with default tcp_adv_win_scale.
>
> tcp_rmem[1] should be changed from 87380 to 131070.


Do you have a packetdrill test demonstrating the issue, on recent
upstream kernels ?

I suspect you use an old kernel with missing backports.

>
> At same time, tcp_rmem[2] should be changed from "between 87380B and 6MB" to "between 131070B and 6MB".
>
> I've fired a bug in Kernel Bugzilla, too. The bug is assigned to Stephen Hemminger <stephen@networkplumber.org> instead of you. So I sent this mail.
>
> Thanks,
>
> Zhibin Liu | Software Engineer | zhibinliu@google.com | +86 21 6123 2345

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Linux Kernel Network Bug Report] tcp_rmem[1] is not resulting in correct TCP window size since 3.4
  2021-02-10 15:37 ` [Linux Kernel Network Bug Report] tcp_rmem[1] is not resulting in correct TCP window size since 3.4 Eric Dumazet
@ 2021-02-10 15:45   ` Eric Dumazet
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2021-02-10 15:45 UTC (permalink / raw)
  To: Zhibin Liu
  Cc: netdev, Tianpeng Jin, Chunlei Zhu, Weiming Liu, Yuchung Cheng,
	Neal Cardwell

On Wed, Feb 10, 2021 at 4:37 PM Eric Dumazet <edumazet@google.com> wrote:
>
> On Wed, Feb 10, 2021 at 4:14 PM Zhibin Liu <zhibinliu@google.com> wrote:
> >
> > Hi, Linux Kernel Networking TCP maintainers,
> >
> > I sent this bug report mail following the reporting bug guideline.
> >
> > Here is the details of the bug:
> > tcp_rmem[1] has value 87380, which will result in a window of 65535 when tcp_adv_win_scale=2. (87380 - 87380/2^2 = 65535)
> >
> > But since 3.4, commit b49960a05e32121d29316cfdf653894b88ac9190, tcp_adv_win_scale default value is changed from 2 to 1.
> >
> > The change causes tcp_rmem[1] with value 87380 will result in a window of 43690, instead of expected 65535.
>
>
> win of 65535 was used in SYN and SYNACK way after commit
> b49960a05e32121d (this commit is 8 years old : Wed May 2 02:28:41
> 2012)
>
> Change was done by Yuchung in 2018
> in commit a337531b942bd8a03e7052444d7e36972aac2d92 tcp: up initial
> rmem to 128KB and SYN rwin to around 64KB
>
>

One thing to consider is that tcp_rmem[1] was overridden with a bigger
value depending on MSS of the connection
at connect() or accept() time.

On these old kernels, this was done in tcp_fixup_rcvbuf()

So I suggest you use getsockopt( ... SO_RCVBUF ) right after connect()
or accept() to double check what is the actual value for sk->sk_rcvbuf



>
> >
> > Now the doc Documentation/networking/ip-sysctl.rst is still mentioning 87380 tcp_rmem[1] will result in 65535 window size with default tcp_adv_win_scale.
> >
> > tcp_rmem[1] should be changed from 87380 to 131070.
>
>
> Do you have a packetdrill test demonstrating the issue, on recent
> upstream kernels ?
>
> I suspect you use an old kernel with missing backports.
>
> >
> > At same time, tcp_rmem[2] should be changed from "between 87380B and 6MB" to "between 131070B and 6MB".
> >
> > I've fired a bug in Kernel Bugzilla, too. The bug is assigned to Stephen Hemminger <stephen@networkplumber.org> instead of you. So I sent this mail.
> >
> > Thanks,
> >
> > Zhibin Liu | Software Engineer | zhibinliu@google.com | +86 21 6123 2345

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Linux Kernel Network Bug Report] tcp_rmem[1] is not resulting in correct TCP window size since 3.4
@ 2021-02-10 15:34 Zhibin Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Zhibin Liu @ 2021-02-10 15:34 UTC (permalink / raw)
  To: Eric Dumazet, netdev; +Cc: Chunlei Zhu, Tianpeng Jin, Weiming Liu, stephen

Hi, Linux Kernel Networking TCP maintainers,

tcp_rmem[1] has value 87380, which will result in a window of 65535
when tcp_adv_win_scale=2. (87380 - 87380/2^2 = 65535)

But since 3.4, commit b49960a05e32121d29316cfdf653894b88ac9190,
tcp_adv_win_scale default value is changed from 2 to 1.

The change causes tcp_rmem[1] with value 87380 will result in a window
of 43690, instead of expected 65535.

Now the doc Documentation/networking/ip-sysctl.rst is still mentioning
87380 tcp_rmem[1] will result in 65535 window size with default
tcp_adv_win_scale.

tcp_rmem[1] should be changed from 87380 to 131070.
At same time, tcp_rmem[2] should be changed from "between 87380B and
6MB" to "between 131070B and 6MB".

I've fired a bug (id 211677) in Kernel Bugzilla, too. The bug is
assigned to Stephen Hemminger <stephen@networkplumber.org> instead of
you. So I sent this mail.

Thanks,

Zhibin Liu | Software Engineer | zhibinliu@google.com | +86 21 6123 2345

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-10 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAM5yEy0ZU42Kew4JcQVNsda_X2O8QL9m8F15-02tPAVrz6o54w@mail.gmail.com>
2021-02-10 15:37 ` [Linux Kernel Network Bug Report] tcp_rmem[1] is not resulting in correct TCP window size since 3.4 Eric Dumazet
2021-02-10 15:45   ` Eric Dumazet
2021-02-10 15:34 Zhibin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).