net/mlx5: Convert mkey_table to XArray
authorMatthew Wilcox <willy@infradead.org>
Thu, 20 Jun 2019 07:03:47 +0000 (07:03 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 24 Jun 2019 23:44:40 +0000 (16:44 -0700)
commit792c4e9d0bbb53b34bf1c07c2ef25609d746c57d
tree9b634d93c26bbc9124dc45271e1fe021008d2ec1
parent82b11f071936a11094e1c44730030cd3d894e0b4
net/mlx5: Convert mkey_table to XArray

The lock protecting the data structure does not need to be an rwlock.  The
only read access to the lock is in an error path, and if that's limiting
your scalability, you have bigger performance problems.

Eliminate mlx5_mkey_table in favour of using the xarray directly.
reg_mr_callback must use GFP_ATOMIC for allocating XArray nodes as it may
be called in interrupt context.

This also fixes a minor bug where SRCU locking was being used on the radix
tree read side, when RCU was needed too.

Signed-off-by: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/infiniband/hw/mlx5/cq.c
drivers/infiniband/hw/mlx5/devx.c
drivers/infiniband/hw/mlx5/mr.c
drivers/infiniband/hw/mlx5/odp.c
drivers/net/ethernet/mellanox/mlx5/core/mr.c
include/linux/mlx5/driver.h
include/linux/mlx5/qp.h