linux/drivers/vdpa
Dragos Tatulea a06bd11b18 vdpa/mlx5: Introduce reference counting to mrs
Deleting the old mr during mr update (.set_map) and then modifying the
vqs with the new mr is not a good flow for firmware. The firmware
expects that mkeys are deleted after there are no more vqs referencing
them.

Introduce reference counting for mrs to fix this. It is the only way to
make sure that mkeys are not in use by vqs.

An mr reference is taken when the mr is associated to the mr asid table
and when the mr is linked to the vq on create/modify. The reference is
released when the mkey is unlinked from the vq (trough modify/destroy)
and from the mr asid table.

To make things consistent, get rid of mlx5_vdpa_destroy_mr and use
get/put semantics everywhere.

Reviewed-by: Gal Pressman <gal@nvidia.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Message-Id: <20231225151203.152687-8-dtatulea@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2024-01-10 13:01:38 -05:00
..
alibaba vdpa: Fix an error handling path in eni_vdpa_probe() 2023-12-25 09:32:12 -05:00
ifcvf vDPA/ifcvf: implement new accessors for vq_state 2023-07-03 12:15:12 -04:00
mlx5 vdpa/mlx5: Introduce reference counting to mrs 2024-01-10 13:01:38 -05:00
pds pds_vdpa: set features order 2023-12-01 09:55:01 -05:00
solidrun vdpa/snet: implement the resume vDPA callback 2023-06-27 10:47:08 -04:00
vdpa_sim vdpa_sim_blk: allocate the buffer zeroed 2023-11-01 09:31:16 -04:00
vdpa_user vduse: make vduse_class constant 2023-11-01 09:19:59 -04:00
virtio_pci vp_vdpa: fix the crash in hot unplug with vp_vdpa 2023-03-10 03:48:27 -05:00
Kconfig pds_vdpa: pds_vdps.rst and Kconfig 2023-06-27 10:47:09 -04:00
Makefile pds_vdpa: Add new vDPA driver for AMD/Pensando DSC 2023-06-27 10:47:08 -04:00
vdpa.c vdpa: Remove usage of the deprecated ida_simple_xx() API 2023-12-27 16:10:38 -05:00