From: Jason Wang <jasowang@redhat.com>
To: Si-Wei Liu <si-wei.liu@oracle.com>, mst@redhat.com, elic@nvidia.com
Cc: linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org,
netdev@vger.kernel.org
Subject: Re: [PATCH 2/3] mlx5_vdpa: fix feature negotiation across device reset
Date: Mon, 8 Feb 2021 12:37:24 +0800 [thread overview]
Message-ID: <4d6b8fc7-e697-d027-7763-8e56e0669a31@redhat.com> (raw)
In-Reply-To: <1612614564-4220-2-git-send-email-si-wei.liu@oracle.com>
On 2021/2/6 下午8:29, Si-Wei Liu wrote:
> The mlx_features denotes the capability for which
> set of virtio features is supported by device. In
> principle, this field needs not be cleared during
> virtio device reset, as this capability is static
> and does not change across reset.
>
> In fact, the current code may have the assumption
> that mlx_features can be reloaded from firmware
> via the .get_features ops after device is reset
> (via the .set_status ops), which is unfortunately
> not true. The userspace VMM might save a copy
> of backend capable features and won't call into
> kernel again to get it on reset.
This is not the behavior of Qemu but it's valid.
> This causes all
> virtio features getting disabled on newly created
> virtqs after device reset, while guest would hold
> mismatched view of available features. For e.g.,
> the guest may still assume tx checksum offload
> is available after reset and feature negotiation,
> causing frames with bogus (incomplete) checksum
> transmitted on the wire.
>
> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
> ---
> drivers/vdpa/mlx5/net/mlx5_vnet.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index b8416c4..aa6f8cd 100644
> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> @@ -1788,7 +1788,6 @@ static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status)
> clear_virtqueues(ndev);
> mlx5_vdpa_destroy_mr(&ndev->mvdev);
> ndev->mvdev.status = 0;
> - ndev->mvdev.mlx_features = 0;
> ++mvdev->generation;
> return;
> }
next prev parent reply other threads:[~2021-02-08 4:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-06 12:29 [PATCH 1/3] mlx5_vdpa: should exclude header length and fcs from mtu Si-Wei Liu
2021-02-06 12:29 ` [PATCH 2/3] mlx5_vdpa: fix feature negotiation across device reset Si-Wei Liu
2021-02-08 4:37 ` Jason Wang [this message]
2021-02-08 5:35 ` Eli Cohen
2021-02-09 1:20 ` Si-Wei Liu
2021-02-10 12:28 ` Michael S. Tsirkin
2021-02-06 12:29 ` [PATCH 3/3] mlx5_vdpa: defer clear_virtqueues to until DRIVER_OK Si-Wei Liu
2021-02-08 4:38 ` Jason Wang
2021-02-08 5:48 ` Eli Cohen
2021-02-09 1:40 ` Si-Wei Liu
2021-02-09 3:37 ` Jason Wang
2021-02-10 0:26 ` Si-Wei Liu
2021-02-10 4:00 ` Jason Wang
2021-02-08 4:38 ` [PATCH 1/3] mlx5_vdpa: should exclude header length and fcs from mtu Jason Wang
2021-02-08 5:35 ` 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=4d6b8fc7-e697-d027-7763-8e56e0669a31@redhat.com \
--to=jasowang@redhat.com \
--cc=elic@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=si-wei.liu@oracle.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®