summaryrefslogtreecommitdiff
path: root/drivers/vdpa/mlx5/core/mlx5_vdpa.h
diff options
context:
space:
mode:
authorEli Cohen <elic@nvidia.com>2021-08-23 08:21:21 +0300
committerMichael S. Tsirkin <mst@redhat.com>2021-09-05 23:23:07 +0300
commite4fc66508c884b87422a98259cdfe135edae130f (patch)
treebbf28d6e3548b90ebda439f57795f45a606cc8a2 /drivers/vdpa/mlx5/core/mlx5_vdpa.h
parentdb296d252dfb977885391e47d3fb6ac5a1f9601c (diff)
downloadlinux-e4fc66508c884b87422a98259cdfe135edae130f.tar.xz
vdpa/mlx5: Ensure valid indices are provided
Following patches add control virtuqeue and multiqueue support. We want to verify that the index value to callbacks referencing a virtqueue is valid. The logic defining valid indices is as follows: CVQ clear: 0 and 1. CVQ set, MQ clear: 0, 1 and 2 CVQ set, MQ set: 0..nvq where nvq is whatever provided to _vdpa_register_device() Signed-off-by: Eli Cohen <elic@nvidia.com> Link: https://lore.kernel.org/r/20210823052123.14909-5-elic@nvidia.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vdpa/mlx5/core/mlx5_vdpa.h')
-rw-r--r--drivers/vdpa/mlx5/core/mlx5_vdpa.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/vdpa/mlx5/core/mlx5_vdpa.h b/drivers/vdpa/mlx5/core/mlx5_vdpa.h
index 8d0a6f2cb3f0..41b20855ed31 100644
--- a/drivers/vdpa/mlx5/core/mlx5_vdpa.h
+++ b/drivers/vdpa/mlx5/core/mlx5_vdpa.h
@@ -56,6 +56,7 @@ struct mlx5_vdpa_dev {
u64 actual_features;
u8 status;
u32 max_vqs;
+ u16 max_idx;
u32 generation;
struct mlx5_vdpa_mr mr;