OSDN Git Service

RDMA/mlx5: Make mkeys always owned by the kernel's PD when not enabled
authorJason Gunthorpe <jgg@nvidia.com>
Mon, 14 Sep 2020 11:26:51 +0000 (14:26 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 18 Sep 2020 16:02:43 +0000 (13:02 -0300)
commit5eb29f0d13a66502b91954597270003c90fb66c5
tree6f0a6ae589ed11baa307b5bf349506b6c0f02c65
parent1c97ca3da0d12e0156a177f48ed3184c3f202002
RDMA/mlx5: Make mkeys always owned by the kernel's PD when not enabled

Any mkey that is not enabled and assigned to userspace should have the PD
set to a kernel owned PD.

When cache entries are created for the first time the PDN is set to 0,
which is probably a kernel PD, but be explicit.

When a MR is registered using the hybrid reg_create with UMR xlt & enable
the disabled mkey is pointing at the user PD, keep it pointing at the
kernel until a UMR enables it and sets the user PD.

Fixes: 9ec4483a3f0f ("IB/mlx5: Move MRs to a kernel PD when freeing them to the MR cache")
Link: https://lore.kernel.org/r/20200914112653.345244-4-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/mr.c