RDMA/cm: Fix missing RDMA_CM_EVENT_REJECTED event after receiving REJ message
authorLeon Romanovsky <leonro@mellanox.com>
Mon, 6 Apr 2020 17:32:42 +0000 (20:32 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 14 Apr 2020 18:50:49 +0000 (15:50 -0300)
commit0c6949c3d1b284d90473834f2fb865368a12f30a
tree8832291f2edf5e06610f85a35965bbe753407af9
parentf70968f05de4e7c24d839ca0d3e40f17c8024498
RDMA/cm: Fix missing RDMA_CM_EVENT_REJECTED event after receiving REJ message

The cm_reset_to_idle() call before formatting event changed the CM_ID
state from IB_CM_REQ_RCVD to be IB_CM_IDLE. It caused to wrong value of
CM_REJ_MESSAGE_REJECTED field.

The result of that was that rdma_reject() calls in the passive side didn't
generate RDMA_CM_EVENT_REJECTED event in the active side.

Fixes: 81ddb41f876d ("RDMA/cm: Allow ib_send_cm_rej() to be done under lock")
Link: https://lore.kernel.org/r/20200406173242.1465911-1-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/cm.c