Re: [PATCH v2 8/8] vsock/virtio: make the RX buffer size tunable

From: Stefano Garzarella
Date: Tue May 14 2019 - 12:12:28 EST


On Mon, May 13, 2019 at 08:46:19PM +0800, Jason Wang wrote:
>
> On 2019/5/13 äå6:05, Jason Wang wrote:
> >
> > On 2019/5/10 äå8:58, Stefano Garzarella wrote:
> > > The RX buffer size determines the memory consumption of the
> > > vsock/virtio guest driver, so we make it tunable through
> > > a module parameter.
> > >
> > > The size allowed are between 4 KB and 64 KB in order to be
> > > compatible with old host drivers.
> > >
> > > Suggested-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
> > > Signed-off-by: Stefano Garzarella <sgarzare@xxxxxxxxxx>
> >
> >
> > I don't see much value of doing this through kernel command line. We
> > should deal with them automatically like what virtio-net did. Or even a
> > module parameter is better.
> >
> > Thanks
>
>
> Sorry, I misread the patch. But even module parameter is something not
> flexible enough. We should deal with them transparently.
>

Okay, I'll try to understand how we can automatically adapt the RX
buffer size. Since the flow is stream based, the receiver doesn't know the
original packet size.

Maybe I can reuse the EWMA approach to understand if the buffers are
entirely filled or not.
In that case I can increase (e.g. double) or decrease the size.

I'll try to do it!

Thanks,
Stefano