lkml.org 
[lkml]   [2021]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 2/3] mlx5_vdpa: fix feature negotiation across device reset
    From
    Date

    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;
    > }

    \
     
     \ /
      Last update: 2021-02-08 05:40    [W:2.644 / U:0.444 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site