[PATCH net-next 1/5] tcp: fix SO_RCVLOWAT and RCVBUF autotuning

2018-04-16 Thread Eric Dumazet
Applications might use SO_RCVLOWAT on TCP socket hoping to receive one [E]POLLIN event only when a given amount of bytes are ready in socket receive queue. Problem is that receive autotuning is not aware of this constraint, meaning sk_rcvbuf might be too small to allow all bytes to be stored. Add

Re: [PATCH net-next 1/5] tcp: fix SO_RCVLOWAT and RCVBUF autotuning

2018-04-19 Thread Marcelo Ricardo Leitner
On Mon, Apr 16, 2018 at 10:33:35AM -0700, Eric Dumazet wrote: > Applications might use SO_RCVLOWAT on TCP socket hoping to receive > one [E]POLLIN event only when a given amount of bytes are ready in socket > receive queue. > > Problem is that receive autotuning is not aware of this constraint, > m

Re: [PATCH net-next 1/5] tcp: fix SO_RCVLOWAT and RCVBUF autotuning

2018-04-19 Thread Eric Dumazet
On Thu, Apr 19, 2018 at 7:02 PM Marcelo Ricardo Leitner < marcelo.leit...@gmail.com> wrote: > Hi Eric, > As val may be changed to a smaller value by the line above, shouldn't > it assign sk->sk_rcvlowat again? Otherwise it may still be bigger > than sk_rcvbuf. > Say val = 512k, sysctl_tcp_rmem[

Re: [PATCH net-next 1/5] tcp: fix SO_RCVLOWAT and RCVBUF autotuning

2018-04-19 Thread Marcelo Ricardo Leitner
On Fri, Apr 20, 2018 at 02:36:52AM +, Eric Dumazet wrote: > On Thu, Apr 19, 2018 at 7:02 PM Marcelo Ricardo Leitner < > marcelo.leit...@gmail.com> wrote: > > > Hi Eric, > > > As val may be changed to a smaller value by the line above, shouldn't > > it assign sk->sk_rcvlowat again? Otherwise it