]> git.baikalelectronics.ru Git - kernel.git/commit
vdpa/mlx5: Ensure valid indices are provided
authorEli Cohen <elic@nvidia.com>
Mon, 23 Aug 2021 05:21:21 +0000 (08:21 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 5 Sep 2021 20:23:07 +0000 (16:23 -0400)
commit9107334e52c642d2943b97482c88bb3c9dd788dc
treebbf28d6e3548b90ebda439f57795f45a606cc8a2
parent8a3adf85efd3e55cfb1431804fb31a23aa46fe83
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>
drivers/vdpa/mlx5/core/mlx5_vdpa.h
drivers/vdpa/mlx5/net/mlx5_vnet.c