Patch "vdpa/mlx5: Allow CVQ size changes" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    vdpa/mlx5: Allow CVQ size changes

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     vdpa-mlx5-allow-cvq-size-changes.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b03fc8e5069521c734fc6e4de5a26da9883c9c5c
Author: Jonah Palmer <jonah.palmer@xxxxxxxxxx>
Date:   Fri Feb 16 09:25:02 2024 -0500

    vdpa/mlx5: Allow CVQ size changes
    
    [ Upstream commit 749a4016839270163efc36ecddddd01de491a16b ]
    
    The MLX driver was not updating its control virtqueue size at set_vq_num
    and instead always initialized to MLX5_CVQ_MAX_ENT (16) at
    setup_cvq_vring.
    
    Qemu would try to set the size to 64 by default, however, because the
    CVQ size always was initialized to 16, an error would be thrown when
    sending >16 control messages (as used-ring entry 17 is initialized to 0).
    For example, starting a guest with x-svq=on and then executing the
    following command would produce the error below:
    
     # for i in {1..20}; do ifconfig eth0 hw ether XX:xx:XX:xx:XX:XX; done
    
     qemu-system-x86_64: Insufficient written data (0)
     [  435.331223] virtio_net virtio0: Failed to set mac address by vq command.
     SIOCSIFHWADDR: Invalid argument
    
    Acked-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
    Acked-by: Eugenio Pérez <eperezma@xxxxxxxxxx>
    Signed-off-by: Jonah Palmer <jonah.palmer@xxxxxxxxxx>
    Message-Id: <20240216142502.78095-1-jonah.palmer@xxxxxxxxxx>
    Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
    Tested-by: Lei Yang <leiyang@xxxxxxxxxx>
    Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index ca972af3c89a2..b56aae3f7be37 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -144,8 +144,6 @@ static void teardown_driver(struct mlx5_vdpa_net *ndev);
 
 static bool mlx5_vdpa_debug;
 
-#define MLX5_CVQ_MAX_ENT 16
-
 #define MLX5_LOG_VIO_FLAG(_feature)                                                                \
 	do {                                                                                       \
 		if (features & BIT_ULL(_feature))                                                  \
@@ -2136,9 +2134,16 @@ static void mlx5_vdpa_set_vq_num(struct vdpa_device *vdev, u16 idx, u32 num)
 	struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
 	struct mlx5_vdpa_virtqueue *mvq;
 
-	if (!is_index_valid(mvdev, idx) || is_ctrl_vq_idx(mvdev, idx))
+	if (!is_index_valid(mvdev, idx))
 		return;
 
+        if (is_ctrl_vq_idx(mvdev, idx)) {
+                struct mlx5_control_vq *cvq = &mvdev->cvq;
+
+                cvq->vring.vring.num = num;
+                return;
+        }
+
 	mvq = &ndev->vqs[idx];
 	mvq->num_ent = num;
 }
@@ -2799,7 +2804,7 @@ static int setup_cvq_vring(struct mlx5_vdpa_dev *mvdev)
 		u16 idx = cvq->vring.last_avail_idx;
 
 		err = vringh_init_iotlb(&cvq->vring, mvdev->actual_features,
-					MLX5_CVQ_MAX_ENT, false,
+					cvq->vring.vring.num, false,
 					(struct vring_desc *)(uintptr_t)cvq->desc_addr,
 					(struct vring_avail *)(uintptr_t)cvq->driver_addr,
 					(struct vring_used *)(uintptr_t)cvq->device_addr);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux