Skip to content

Commit ad9758f

Browse files
dtatuleamstsirkin
authored andcommitted
vdpa/mlx5: Set an initial size on the VQ
The virtqueue size is a pre-requisite for setting up any virtqueue resources. For the upcoming optimization of creating virtqueues at device add, the virtqueue size has to be configured. The queue size check in setup_vq() will always be false. So remove it. Signed-off-by: Dragos Tatulea <[email protected]> Reviewed-by: Cosmin Ratiu <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent cdc3c7e commit ad9758f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/vdpa/mlx5/net/mlx5_vnet.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ MODULE_LICENSE("Dual BSD/GPL");
5858
*/
5959
#define MLX5V_DEFAULT_VQ_COUNT 2
6060

61+
#define MLX5V_DEFAULT_VQ_SIZE 256
62+
6163
struct mlx5_vdpa_cq_buf {
6264
struct mlx5_frag_buf_ctrl fbc;
6365
struct mlx5_frag_buf frag_buf;
@@ -1445,9 +1447,6 @@ static int setup_vq(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue *mvq)
14451447
u16 idx = mvq->index;
14461448
int err;
14471449

1448-
if (!mvq->num_ent)
1449-
return 0;
1450-
14511450
if (mvq->initialized)
14521451
return 0;
14531452

@@ -3523,6 +3522,7 @@ static void mvqs_set_defaults(struct mlx5_vdpa_net *ndev)
35233522
mvq->ndev = ndev;
35243523
mvq->fwqp.fw = true;
35253524
mvq->fw_state = MLX5_VIRTIO_NET_Q_OBJECT_NONE;
3525+
mvq->num_ent = MLX5V_DEFAULT_VQ_SIZE;
35263526
}
35273527
}
35283528

0 commit comments

Comments
 (0)