From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: netdev@vger.kernel.org, Eli Cohen <elic@nvidia.com>,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH net] virtio-net: enable big mode correctly
Date: Thu, 25 Nov 2021 02:00:26 -0500 [thread overview]
Message-ID: <20211125015532-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20211125060547.11961-1-jasowang@redhat.com>
On Thu, Nov 25, 2021 at 02:05:47PM +0800, Jason Wang wrote:
> When VIRTIO_NET_F_MTU feature is not negotiated, we assume a very
> large max_mtu. In this case, using small packet mode is not correct
> since it may breaks the networking when MTU is grater than
> ETH_DATA_LEN.
>
> To have a quick fix, simply enable the big packet mode when
> VIRTIO_NET_F_MTU is not negotiated.
This will slow down dpdk hosts which disable mergeable buffers
and send standard MTU sized packets.
> We can do optimization on top.
I don't think it works like this, increasing mtu
from guest >4k never worked, we can't regress everyone's
performance with a promise to maybe sometime bring it back.
> Reported-by: Eli Cohen <elic@nvidia.com>
> Cc: Eli Cohen <elic@nvidia.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
>
> ---
> drivers/net/virtio_net.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 7c43bfc1ce44..83ae3ef5eb11 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -3200,11 +3200,12 @@ static int virtnet_probe(struct virtio_device *vdev)
> dev->mtu = mtu;
> dev->max_mtu = mtu;
>
> - /* TODO: size buffers correctly in this case. */
> - if (dev->mtu > ETH_DATA_LEN)
> - vi->big_packets = true;
> }
>
> + /* TODO: size buffers correctly in this case. */
> + if (dev->max_mtu > ETH_DATA_LEN)
> + vi->big_packets = true;
> +
> if (vi->any_header_sg)
> dev->needed_headroom = vi->hdr_len;
>
> --
> 2.25.1
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Eli Cohen <elic@nvidia.com>
Subject: Re: [PATCH net] virtio-net: enable big mode correctly
Date: Thu, 25 Nov 2021 02:00:26 -0500 [thread overview]
Message-ID: <20211125015532-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20211125060547.11961-1-jasowang@redhat.com>
On Thu, Nov 25, 2021 at 02:05:47PM +0800, Jason Wang wrote:
> When VIRTIO_NET_F_MTU feature is not negotiated, we assume a very
> large max_mtu. In this case, using small packet mode is not correct
> since it may breaks the networking when MTU is grater than
> ETH_DATA_LEN.
>
> To have a quick fix, simply enable the big packet mode when
> VIRTIO_NET_F_MTU is not negotiated.
This will slow down dpdk hosts which disable mergeable buffers
and send standard MTU sized packets.
> We can do optimization on top.
I don't think it works like this, increasing mtu
from guest >4k never worked, we can't regress everyone's
performance with a promise to maybe sometime bring it back.
> Reported-by: Eli Cohen <elic@nvidia.com>
> Cc: Eli Cohen <elic@nvidia.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
>
> ---
> drivers/net/virtio_net.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 7c43bfc1ce44..83ae3ef5eb11 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -3200,11 +3200,12 @@ static int virtnet_probe(struct virtio_device *vdev)
> dev->mtu = mtu;
> dev->max_mtu = mtu;
>
> - /* TODO: size buffers correctly in this case. */
> - if (dev->mtu > ETH_DATA_LEN)
> - vi->big_packets = true;
> }
>
> + /* TODO: size buffers correctly in this case. */
> + if (dev->max_mtu > ETH_DATA_LEN)
> + vi->big_packets = true;
> +
> if (vi->any_header_sg)
> dev->needed_headroom = vi->hdr_len;
>
> --
> 2.25.1
next prev parent reply other threads:[~2021-11-25 7:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 6:05 [PATCH net] virtio-net: enable big mode correctly Jason Wang
2021-11-25 6:05 ` Jason Wang
2021-11-25 7:00 ` Michael S. Tsirkin [this message]
2021-11-25 7:00 ` Michael S. Tsirkin
2021-11-25 7:11 ` Jason Wang
2021-11-25 7:11 ` Jason Wang
2021-11-25 7:14 ` Michael S. Tsirkin
2021-11-25 7:14 ` Michael S. Tsirkin
2021-11-25 7:20 ` Jason Wang
2021-11-25 7:20 ` Jason Wang
2021-11-25 7:26 ` Michael S. Tsirkin
2021-11-25 7:26 ` Michael S. Tsirkin
2021-11-25 7:28 ` Jason Wang
2021-11-25 7:28 ` Jason Wang
2021-11-25 8:13 ` Michael S. Tsirkin
2021-11-25 8:13 ` Michael S. Tsirkin
2021-11-25 7:09 ` Eli Cohen
2021-11-25 7:15 ` Jason Wang
2021-11-25 7:15 ` Jason Wang
2021-11-25 7:20 ` Eli Cohen
2021-11-25 7:26 ` Jason Wang
2021-11-25 7:26 ` Jason Wang
2021-11-25 7:31 ` Michael S. Tsirkin
2021-11-25 7:31 ` Michael S. Tsirkin
2021-11-25 7:41 ` Eli Cohen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211125015532-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=elic@nvidia.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.