]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/mlx5: Add missing synchronize_srcu() for MW cases
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 1 Oct 2019 15:38:21 +0000 (12:38 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 4 Oct 2019 18:54:22 +0000 (15:54 -0300)
commit5d9c85cfde5e0e2d88c632f5ef94ede536151d0d
tree4e44c18ea147f7f17066d93d5279146c2c8cf907
parente7e1dee47f5f9df64d837ddbd78acd63e438c4dd
RDMA/mlx5: Add missing synchronize_srcu() for MW cases

While MR uses live as the SRCU 'update', the MW case uses the xarray
directly, xa_erase() causes the MW to become inaccessible to the pagefault
thread.

Thus whenever a MW is removed from the xarray we must synchronize_srcu()
before freeing it.

This must be done before freeing the mkey as re-use of the mkey while the
pagefault thread is using the stale mkey is undesirable.

Add the missing synchronizes to MW and DEVX indirect mkey and delete the
bogus protection against double destroy in mlx5_core_destroy_mkey()

Fixes: 048e16809ad6 ("IB/mlx5: Manage indirection mkey upon DEVX flow for ODP")
Fixes: 44d3cef22afa ("IB/mlx5: Page faults handling infrastructure")
Link: https://lore.kernel.org/r/20191001153821.23621-7-jgg@ziepe.ca
Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/devx.c
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/mr.c
drivers/net/ethernet/mellanox/mlx5/core/mr.c