]> git.baikalelectronics.ru Git - kernel.git/commit
vdpa/mlx5: Restore the hardware used index after change map
authorEli Cohen <elic@nvidia.com>
Thu, 4 Feb 2021 07:36:18 +0000 (09:36 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 5 Feb 2021 15:28:04 +0000 (10:28 -0500)
commitdf5f83becaa120f69f152ea662f293dcc98a8202
tree6cea9e86b2cebdcb67da495060d9223532840f9e
parentde0ca0b130f59f5ae7f44a8e51a40d88e5ca1c15
vdpa/mlx5: Restore the hardware used index after change map

When a change of memory map occurs, the hardware resources are destroyed
and then re-created again with the new memory map. In such case, we need
to restore the hardware available and used indices. The driver failed to
restore the used index which is added here.

Also, since the driver also fails to reset the available and used
indices upon device reset, fix this here to avoid regression caused by
the fact that used index may not be zero upon device reset.

Fixes: 707e0f8d9b65 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices")
Signed-off-by: Eli Cohen <elic@nvidia.com>
Link: https://lore.kernel.org/r/20210204073618.36336-1-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c