Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Si-Wei Liu
size as buffer length for big packets On Tue, Aug 09, 2022 at 09:49:03PM +, Parav Pandit wrote: From: Michael S. Tsirkin Sent: Tuesday, August 9, 2022 5:38 PM [..] I think virtio-net driver doesn't differentiate MTU and MRU, in which case the receive buffer will be reduced to fit the

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Michael S. Tsirkin
On Wed, Aug 10, 2022 at 05:06:33PM +, Parav Pandit wrote: > > > From: Michael S. Tsirkin > > Sent: Wednesday, August 10, 2022 12:59 PM > > > > On Wed, Aug 10, 2022 at 04:22:41PM +, Parav Pandit wrote: > > > > > > > From: Michael S. Tsirkin > > > > Sent: Wednesday, August 10, 2022 12:05

RE: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Parav Pandit via Virtualization
> From: Michael S. Tsirkin > Sent: Wednesday, August 10, 2022 12:59 PM > > On Wed, Aug 10, 2022 at 04:22:41PM +, Parav Pandit wrote: > > > > > From: Michael S. Tsirkin > > > Sent: Wednesday, August 10, 2022 12:05 PM > > > > > > On Wed, Aug 10, 2022 at 04:00:08PM +, Parav Pandit wrote:

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Michael S. Tsirkin
On Wed, Aug 10, 2022 at 12:58:58PM -0400, Michael S. Tsirkin wrote: > On Wed, Aug 10, 2022 at 04:22:41PM +, Parav Pandit wrote: > > > > > From: Michael S. Tsirkin > > > Sent: Wednesday, August 10, 2022 12:05 PM > > > > > > On Wed, Aug 10, 2022 at 04:00:08PM +, Parav Pandit wrote: > > > >

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Michael S. Tsirkin
On Wed, Aug 10, 2022 at 04:22:41PM +, Parav Pandit wrote: > > > From: Michael S. Tsirkin > > Sent: Wednesday, August 10, 2022 12:05 PM > > > > On Wed, Aug 10, 2022 at 04:00:08PM +, Parav Pandit wrote: > > > > > > > From: Michael S. Tsirkin > > > > Sent: Wednesday, August 10, 2022 5:03 A

RE: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Parav Pandit via Virtualization
> From: Michael S. Tsirkin > Sent: Wednesday, August 10, 2022 12:05 PM > > On Wed, Aug 10, 2022 at 04:00:08PM +, Parav Pandit wrote: > > > > > From: Michael S. Tsirkin > > > Sent: Wednesday, August 10, 2022 5:03 AM > > > > > > > > > > Should we make this depend on the vq reset ability mayb

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Michael S. Tsirkin
On Wed, Aug 10, 2022 at 04:00:08PM +, Parav Pandit wrote: > > > From: Michael S. Tsirkin > > Sent: Wednesday, August 10, 2022 5:03 AM > > > > > > > > Should we make this depend on the vq reset ability maybe? > > > > > > The advantage of this is to keep TX working. Or we can use device > > > r

RE: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Parav Pandit via Virtualization
> From: Michael S. Tsirkin > Sent: Wednesday, August 10, 2022 5:03 AM > > > > > > Should we make this depend on the vq reset ability maybe? > > > > The advantage of this is to keep TX working. Or we can use device > > reset as a fallback if there's no vq reset. > > > > Thanks > > Device reset i

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Michael S. Tsirkin
; > > Cc: Si-Wei Liu ; Jason Wang > > > > > > ; Gavin Li ; Hemminger, > > > > > > Stephen ; davem > > > > > > ; virtualization > > > > > foundation.org>; Virtio-Dev ; > > > > > > jesse.brandeb...@intel.com; alexander.h.du.

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-10 Thread Jason Wang
t; > > > > ; virtualization > > > > foundation.org>; Virtio-Dev ; > > > > > jesse.brandeb...@intel.com; alexander.h.du...@intel.com; > > > > > kubak...@wp.pl; sridhar.samudr...@intel.com; losewe...@gmail.com; Gavi > > > > > Teitz

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
brandeb...@intel.com; alexander.h.du...@intel.com; > > > > kubak...@wp.pl; sridhar.samudr...@intel.com; losewe...@gmail.com; Gavi > > > > Teitz > > > > Subject: Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer > > > > length for > >

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
gt; > ; Gavin Li ; Hemminger, > > > Stephen ; davem > > > ; virtualization > > foundation.org>; Virtio-Dev ; > > > jesse.brandeb...@intel.com; alexander.h.du...@intel.com; > > > kubak...@wp.pl; sridhar.samudr...@intel.com; losewe...@gmail.com; Gavi > &

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
在 2022/8/10 06:54, Si-Wei Liu 写道: On 8/9/2022 3:37 PM, Michael S. Tsirkin wrote: On Tue, Aug 09, 2022 at 03:32:26PM -0700, Si-Wei Liu wrote: On 8/9/2022 2:37 PM, Michael S. Tsirkin wrote: On Tue, Aug 09, 2022 at 07:18:30PM +, Parav Pandit wrote: From: Si-Wei Liu Sent: Tuesday, August

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
在 2022/8/10 02:38, Si-Wei Liu 写道: On 8/9/2022 12:44 AM, Jason Wang wrote: On Tue, Aug 9, 2022 at 3:07 PM Gavin Li wrote: On 8/9/2022 7:56 AM, Si-Wei Liu wrote: External email: Use caution opening links or attachments On 8/8/2022 12:31 AM, Gavin Li wrote: On 8/6/2022 6:11 AM, Si-Wei Li

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Si-Wei Liu
...@wp.pl; sridhar.samudr...@intel.com; losewe...@gmail.com; Gavi Teitz Subject: Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets On Tue, Aug 09, 2022 at 09:49:03PM +, Parav Pandit wrote: From: Michael S. Tsirkin Sent: Tuesday, August 9, 2022 5:38 PM [..] I think

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 10:49:48PM +, Parav Pandit wrote: > > > When user prefers to override the device RO field, device is in the dark > > > and > > things work on best effort basis. > > > > Dropping packets is best effort. Getting stuck forever isn't, that's a > > quality of > > implement

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 03:54:57PM -0700, Si-Wei Liu wrote: > > > On 8/9/2022 3:37 PM, Michael S. Tsirkin wrote: > > On Tue, Aug 09, 2022 at 03:32:26PM -0700, Si-Wei Liu wrote: > > > > > > On 8/9/2022 2:37 PM, Michael S. Tsirkin wrote: > > > > On Tue, Aug 09, 2022 at 07:18:30PM +, Parav Pand

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
tualization > foundation.org>; Virtio-Dev ; > > jesse.brandeb...@intel.com; alexander.h.du...@intel.com; > > kubak...@wp.pl; sridhar.samudr...@intel.com; losewe...@gmail.com; Gavi > > Teitz > > Subject: Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length > >

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Si-Wei Liu
On 8/9/2022 3:37 PM, Michael S. Tsirkin wrote: On Tue, Aug 09, 2022 at 03:32:26PM -0700, Si-Wei Liu wrote: On 8/9/2022 2:37 PM, Michael S. Tsirkin wrote: On Tue, Aug 09, 2022 at 07:18:30PM +, Parav Pandit wrote: From: Si-Wei Liu Sent: Tuesday, August 9, 2022 3:09 PM From: Si-Wei Liu

RE: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Parav Pandit via Virtualization
intel.com; > kubak...@wp.pl; sridhar.samudr...@intel.com; losewe...@gmail.com; Gavi > Teitz > Subject: Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length > for > big packets > > On Tue, Aug 09, 2022 at 09:49:03PM +, Parav Pandit wrote: > > > From: Michae

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 03:32:26PM -0700, Si-Wei Liu wrote: > > > On 8/9/2022 2:37 PM, Michael S. Tsirkin wrote: > > On Tue, Aug 09, 2022 at 07:18:30PM +, Parav Pandit wrote: > > > > From: Si-Wei Liu > > > > Sent: Tuesday, August 9, 2022 3:09 PM > > > > > > From: Si-Wei Liu > > > > > > Sent

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Si-Wei Liu
On 8/9/2022 2:37 PM, Michael S. Tsirkin wrote: On Tue, Aug 09, 2022 at 07:18:30PM +, Parav Pandit wrote: From: Si-Wei Liu Sent: Tuesday, August 9, 2022 3:09 PM From: Si-Wei Liu Sent: Tuesday, August 9, 2022 2:39 PM Currently it is not. Not a single patch nor this patch, but the context

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 02:39:49PM -0700, Si-Wei Liu wrote: > > > On 8/9/2022 2:34 PM, Michael S. Tsirkin wrote: > > On Tue, Aug 09, 2022 at 11:38:52AM -0700, Si-Wei Liu wrote: > > > > > > On 8/9/2022 12:44 AM, Jason Wang wrote: > > > > On Tue, Aug 9, 2022 at 3:07 PM Gavin Li wrote: > > > > > O

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 09:49:03PM +, Parav Pandit wrote: > > From: Michael S. Tsirkin > > Sent: Tuesday, August 9, 2022 5:38 PM > > [..] > > > > I think virtio-net driver doesn't differentiate MTU and MRU, in > > > > which case the receive buffer will be reduced to fit the 1500B > > > > payl

RE: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Parav Pandit via Virtualization
> From: Michael S. Tsirkin > Sent: Tuesday, August 9, 2022 5:38 PM [..] > > > I think virtio-net driver doesn't differentiate MTU and MRU, in > > > which case the receive buffer will be reduced to fit the 1500B > > > payload size when mtu is lowered down to 1500 from 9000. > > How? Driver reduced

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Si-Wei Liu
On 8/9/2022 2:34 PM, Michael S. Tsirkin wrote: On Tue, Aug 09, 2022 at 11:38:52AM -0700, Si-Wei Liu wrote: On 8/9/2022 12:44 AM, Jason Wang wrote: On Tue, Aug 9, 2022 at 3:07 PM Gavin Li wrote: On 8/9/2022 7:56 AM, Si-Wei Liu wrote: External email: Use caution opening links or attachment

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 07:18:30PM +, Parav Pandit wrote: > > From: Si-Wei Liu > > Sent: Tuesday, August 9, 2022 3:09 PM > > > >> From: Si-Wei Liu > > >> Sent: Tuesday, August 9, 2022 2:39 PM Currently it is not. Not a > > >> single patch nor this patch, but the context for the eventual goal

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 11:38:52AM -0700, Si-Wei Liu wrote: > > > On 8/9/2022 12:44 AM, Jason Wang wrote: > > On Tue, Aug 9, 2022 at 3:07 PM Gavin Li wrote: > > > > > > On 8/9/2022 7:56 AM, Si-Wei Liu wrote: > > > > > > External email: Use caution opening links or attachments > > > > > > > >

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 09:13:42PM +, Parav Pandit wrote: > > From: Si-Wei Liu > > Sent: Tuesday, August 9, 2022 4:33 PM > > > > On 8/9/2022 12:18 PM, Parav Pandit wrote: > > >> From: Si-Wei Liu > > >> Sent: Tuesday, August 9, 2022 3:09 PM > > From: Si-Wei Liu > > Sent: Tuesday, A

RE: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Parav Pandit via Virtualization
> From: Si-Wei Liu > Sent: Tuesday, August 9, 2022 4:33 PM > > On 8/9/2022 12:18 PM, Parav Pandit wrote: > >> From: Si-Wei Liu > >> Sent: Tuesday, August 9, 2022 3:09 PM > From: Si-Wei Liu > Sent: Tuesday, August 9, 2022 2:39 PM Currently it is not. Not a > single patch nor this

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Si-Wei Liu
On 8/9/2022 12:18 PM, Parav Pandit wrote: From: Si-Wei Liu Sent: Tuesday, August 9, 2022 3:09 PM From: Si-Wei Liu Sent: Tuesday, August 9, 2022 2:39 PM Currently it is not. Not a single patch nor this patch, but the context for the eventual goal is to allow XDP on a MTU=9000 link when guest

RE: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Parav Pandit via Virtualization
> From: Si-Wei Liu > Sent: Tuesday, August 9, 2022 3:09 PM > >> From: Si-Wei Liu > >> Sent: Tuesday, August 9, 2022 2:39 PM Currently it is not. Not a > >> single patch nor this patch, but the context for the eventual goal is > >> to allow XDP on a MTU=9000 link when guest users intentionally lo

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Si-Wei Liu
On 8/9/2022 11:42 AM, Parav Pandit wrote: From: Si-Wei Liu Sent: Tuesday, August 9, 2022 2:39 PM Currently it is not. Not a single patch nor this patch, but the context for the eventual goal is to allow XDP on a MTU=9000 link when guest users intentionally lower down MTU to 1500. Which appli

RE: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Parav Pandit via Virtualization
> From: Si-Wei Liu > Sent: Tuesday, August 9, 2022 2:39 PM > Currently it is not. Not a single patch nor this patch, but the context for > the > eventual goal is to allow XDP on a MTU=9000 link when guest users > intentionally lower down MTU to 1500. Which application benefit by having asymmetr

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Si-Wei Liu
On 8/9/2022 12:44 AM, Jason Wang wrote: On Tue, Aug 9, 2022 at 3:07 PM Gavin Li wrote: On 8/9/2022 7:56 AM, Si-Wei Liu wrote: External email: Use caution opening links or attachments On 8/8/2022 12:31 AM, Gavin Li wrote: On 8/6/2022 6:11 AM, Si-Wei Liu wrote: External email: Use cauti

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Si-Wei Liu
On 8/9/2022 12:06 AM, Gavin Li wrote: On 8/9/2022 7:56 AM, Si-Wei Liu wrote: External email: Use caution opening links or attachments On 8/8/2022 12:31 AM, Gavin Li wrote: On 8/6/2022 6:11 AM, Si-Wei Liu wrote: External email: Use caution opening links or attachments On 8/1/2022 9:45

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
On Tue, Aug 9, 2022 at 5:25 PM Michael S. Tsirkin wrote: > > On Tue, Aug 09, 2022 at 03:44:22PM +0800, Jason Wang wrote: > > > + unsigned int mtu = vi->dev->mtu; > > BTW should this not be max_mtu? Yes. > Otherwise if user configures mtu that > is too small we'll add buffers that are

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
On Tue, Aug 9, 2022 at 5:22 PM Michael S. Tsirkin wrote: > > On Tue, Aug 09, 2022 at 03:44:22PM +0800, Jason Wang wrote: > > > @@ -3571,8 +3581,10 @@ static int virtnet_probe(struct virtio_device > > > *vdev) > > > if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || > > > virt

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 03:44:22PM +0800, Jason Wang wrote: > > + unsigned int mtu = vi->dev->mtu; BTW should this not be max_mtu? Otherwise if user configures mtu that is too small we'll add buffers that are too small. some backends simply lock up if this happens (I think vhost does

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Michael S. Tsirkin
On Tue, Aug 09, 2022 at 03:44:22PM +0800, Jason Wang wrote: > > @@ -3571,8 +3581,10 @@ static int virtnet_probe(struct virtio_device > > *vdev) > > if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || > > virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) || > > virtio_

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-09 Thread Jason Wang
On Tue, Aug 9, 2022 at 3:07 PM Gavin Li wrote: > > > On 8/9/2022 7:56 AM, Si-Wei Liu wrote: > > External email: Use caution opening links or attachments > > > On 8/8/2022 12:31 AM, Gavin Li wrote: > > > On 8/6/2022 6:11 AM, Si-Wei Liu wrote: > > External email: Use caution opening links or attachm

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-08 Thread Si-Wei Liu
On 8/8/2022 12:31 AM, Gavin Li wrote: On 8/6/2022 6:11 AM, Si-Wei Liu wrote: External email: Use caution opening links or attachments On 8/1/2022 9:45 PM, Gavin Li wrote: Currently add_recvbuf_big() allocates MAX_SKB_FRAGS segments for big packets even when GUEST_* offloads are not present

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-05 Thread Si-Wei Liu
On 8/5/2022 3:11 PM, Si-Wei Liu wrote: On 8/1/2022 9:45 PM, Gavin Li wrote: Currently add_recvbuf_big() allocates MAX_SKB_FRAGS segments for big packets even when GUEST_* offloads are not present on the device. However, if GSO is not supported, GUEST GSO (virtio term), or GRO HW (netdev core

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-05 Thread Si-Wei Liu
On 8/1/2022 9:45 PM, Gavin Li wrote: Currently add_recvbuf_big() allocates MAX_SKB_FRAGS segments for big packets even when GUEST_* offloads are not present on the device. However, if GSO is not supported, GUEST GSO (virtio term), or GRO HW (netdev core term) it should have been be called.

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-04 Thread Jason Wang
On Thu, Aug 4, 2022 at 3:23 PM Jason Wang wrote: > > On Thu, Aug 4, 2022 at 3:10 PM Michael S. Tsirkin wrote: > > > > On Thu, Aug 04, 2022 at 01:00:46PM +0800, Jason Wang wrote: > > > On Tue, Aug 2, 2022 at 12:47 PM Gavin Li wrote: > > > > > > > > Currently add_recvbuf_big() allocates MAX_SKB_FR

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-04 Thread Jason Wang
On Thu, Aug 4, 2022 at 3:10 PM Michael S. Tsirkin wrote: > > On Thu, Aug 04, 2022 at 01:00:46PM +0800, Jason Wang wrote: > > On Tue, Aug 2, 2022 at 12:47 PM Gavin Li wrote: > > > > > > Currently add_recvbuf_big() allocates MAX_SKB_FRAGS segments for big > > > packets even when GUEST_* offloads ar

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-04 Thread Michael S. Tsirkin
On Thu, Aug 04, 2022 at 01:00:46PM +0800, Jason Wang wrote: > On Tue, Aug 2, 2022 at 12:47 PM Gavin Li wrote: > > > > Currently add_recvbuf_big() allocates MAX_SKB_FRAGS segments for big > > packets even when GUEST_* offloads are not present on the device. > > However, if GSO is not supported, it

Re: [virtio-dev] [PATCH] virtio-net: use mtu size as buffer length for big packets

2022-08-03 Thread Jason Wang
On Tue, Aug 2, 2022 at 12:47 PM Gavin Li wrote: > > Currently add_recvbuf_big() allocates MAX_SKB_FRAGS segments for big > packets even when GUEST_* offloads are not present on the device. > However, if GSO is not supported, it would be sufficient to allocate > segments to cover just up the MTU si