]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx5: Use direct mkey destroy command upon UMR unreg failure
authorYishai Hadas <yishaih@mellanox.com>
Tue, 23 Jul 2019 06:57:26 +0000 (09:57 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 24 Jul 2019 19:43:19 +0000 (16:43 -0300)
commitf9355f73705fe817384a39c17e52dc56b32ecdc7
tree9baef0d81c4da918402fb3807b4d81f1c8670e46
parent95700ba4a0ea1d7acda3739eb7615bff7fb8f661
IB/mlx5: Use direct mkey destroy command upon UMR unreg failure

Use a direct firmware command to destroy the mkey in case the unreg UMR
operation has failed.

This prevents a case that a mkey will leak out from the cache post a
failure to be destroyed by a UMR WR.

In case the MR cache limit didn't reach a call to add another entry to the
cache instead of the destroyed one is issued.

In addition, replaced a warn message to WARN_ON() as this flow is fatal
and can't happen unless some bug around.

Link: https://lore.kernel.org/r/20190723065733.4899-4-leon@kernel.org
Cc: <stable@vger.kernel.org> # 4.10
Fixes: a2808f2f342b ("IB/mlx5: Expose MR cache for mlx5_ib")
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/mr.c