summaryrefslogtreecommitdiff
path: root/drivers/vdpa/mlx5/core/resources.c
diff options
context:
space:
mode:
authorEli Cohen <elic@nvidia.com>2021-08-23 08:21:23 +0300
committerMichael S. Tsirkin <mst@redhat.com>2021-09-05 23:23:08 +0300
commit52893733f2c5886fc74be6c386d12b59a3f581df (patch)
tree079b22e165ce88ed480d58070c3f2315da0fd86a /drivers/vdpa/mlx5/core/resources.c
parent5262912ef3cfc5e518892c3d67fb36412cb813e2 (diff)
downloadlinux-52893733f2c5886fc74be6c386d12b59a3f581df.tar.xz
vdpa/mlx5: Add multiqueue support
Multiqueue support requires additional virtio_net_q objects to be added or removed per the configured number of queue pairs. In addition the RQ tables needs to be modified to match the number of configured receive queues so the packets are dispatched to the right virtqueue according to the hash result. Note: qemu v6.0.0 is broken when the device requests more than two data queues; no net device will be created for the vdpa device. To avoid this, one should specify mq=off to qemu. In this case it will end up with a single queue. Signed-off-by: Eli Cohen <elic@nvidia.com> Link: https://lore.kernel.org/r/20210823052123.14909-7-elic@nvidia.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vdpa/mlx5/core/resources.c')
-rw-r--r--drivers/vdpa/mlx5/core/resources.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/vdpa/mlx5/core/resources.c b/drivers/vdpa/mlx5/core/resources.c
index b3c08dfa98e8..15e266d0e27a 100644
--- a/drivers/vdpa/mlx5/core/resources.c
+++ b/drivers/vdpa/mlx5/core/resources.c
@@ -129,6 +129,16 @@ int mlx5_vdpa_create_rqt(struct mlx5_vdpa_dev *mvdev, void *in, int inlen, u32 *
return err;
}
+int mlx5_vdpa_modify_rqt(struct mlx5_vdpa_dev *mvdev, void *in, int inlen, u32 rqtn)
+{
+ u32 out[MLX5_ST_SZ_DW(create_rqt_out)] = {};
+
+ MLX5_SET(modify_rqt_in, in, uid, mvdev->res.uid);
+ MLX5_SET(modify_rqt_in, in, rqtn, rqtn);
+ MLX5_SET(modify_rqt_in, in, opcode, MLX5_CMD_OP_MODIFY_RQT);
+ return mlx5_cmd_exec(mvdev->mdev, in, inlen, out, sizeof(out));
+}
+
void mlx5_vdpa_destroy_rqt(struct mlx5_vdpa_dev *mvdev, u32 rqtn)
{
u32 in[MLX5_ST_SZ_DW(destroy_rqt_in)] = {};