diff options
author | Eli Cohen <elic@nvidia.com> | 2021-06-02 11:58:54 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-07-03 11:51:17 +0300 |
commit | 6f5312f801836e6af9bcbb0bdb44dc423e129206 (patch) | |
tree | c59c1fa97ff134de829d1d68744075d5c83e084a /drivers/vdpa/mlx5/core/mlx5_vdpa.h | |
parent | 7d23dcdf213c2e5f097eb7eec3148c26eb01d59f (diff) | |
download | linux-6f5312f801836e6af9bcbb0bdb44dc423e129206.tar.xz |
vdpa/mlx5: Add support for running with virtio_vdpa
In order to support running vdpa using vritio_vdpa driver, we need to
create a different kind of MR, one that has 1:1 mapping, since the
addresses referring to virtqueues are dma addresses.
We create the 1:1 MR in mlx5_vdpa_dev_add() only in case firmware
supports the general capability umem_uid_0. The reason for that is that
1:1 MRs must be created with uid == 0 while virtqueue objects can be
created with uid == 0 only when the firmware capability is on.
If the set_map() callback is called with new translations provided
through iotlb, the driver will destroy the 1:1 MR and create a regular
one.
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20210602085854.62690-1-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'drivers/vdpa/mlx5/core/mlx5_vdpa.h')
-rw-r--r-- | drivers/vdpa/mlx5/core/mlx5_vdpa.h | 1 |
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 b6cc53ba980c..09a16a3d1b2a 100644 --- a/drivers/vdpa/mlx5/core/mlx5_vdpa.h +++ b/drivers/vdpa/mlx5/core/mlx5_vdpa.h @@ -35,6 +35,7 @@ struct mlx5_vdpa_mr { /* serialize mkey creation and destruction */ struct mutex mkey_mtx; + bool user_mr; }; struct mlx5_vdpa_resources { |