net/mlx5_vdpa: Offer VIRTIO_NET_F_MTU when setting MTU
authorEli Cohen <elic@nvidia.com>
Wed, 24 Nov 2021 17:09:49 +0000 (19:09 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 14 Jan 2022 23:50:52 +0000 (18:50 -0500)
Make sure to offer VIRTIO_NET_F_MTU since we configure the MTU based on
what was queried from the device.

This allows the virtio driver to allocate large enough buffers based on
the reported MTU.

Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20211124170949.51725-1-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c

index 63813fb..d8e6934 100644 (file)
@@ -1895,6 +1895,7 @@ static u64 mlx5_vdpa_get_features(struct vdpa_device *vdev)
        ndev->mvdev.mlx_features |= BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR);
        ndev->mvdev.mlx_features |= BIT_ULL(VIRTIO_NET_F_MQ);
        ndev->mvdev.mlx_features |= BIT_ULL(VIRTIO_NET_F_STATUS);
+       ndev->mvdev.mlx_features |= BIT_ULL(VIRTIO_NET_F_MTU);
 
        print_features(mvdev, ndev->mvdev.mlx_features, false);
        return ndev->mvdev.mlx_features;