RDMA/cma: Simplify DEVICE_REMOVAL for internal_id
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 23 Jul 2020 07:07:04 +0000 (10:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Sep 2020 12:22:12 +0000 (14:22 +0200)
commit5a0c4cbd099b82576dfb5aea6aab3d27517c91a2
tree839de3903d9ed7a6e6a9c314b3f9fb795c9bdaff
parent87d8175e9c3de7b12584ec80baa5d4cc436b66da
RDMA/cma: Simplify DEVICE_REMOVAL for internal_id

[ Upstream commit d54f23c09ec62670901f1a2a4712a5218522ca2b ]

cma_process_remove() triggers an unconditional rdma_destroy_id() for
internal_id's and skips the event deliver and transition through
RDMA_CM_DEVICE_REMOVAL.

This is confusing and unnecessary. internal_id always has
cma_listen_handler() as the handler, have it catch the
RDMA_CM_DEVICE_REMOVAL event and directly consume it and signal removal.

This way the FSM sequence never skips the DEVICE_REMOVAL case and the
logic in this hard to test area is simplified.

Link: https://lore.kernel.org/r/20200723070707.1771101-2-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/core/cma.c