IB/rxe: Fix race condition between requester and completer
authorYonatan Cohen <yonatanc@mellanox.com>
Wed, 7 Sep 2016 11:04:06 +0000 (14:04 +0300)
committerDoug Ledford <dledford@redhat.com>
Fri, 16 Sep 2016 18:14:08 +0000 (14:14 -0400)
commit3050b99850247695cb07a5c15265afcc08bcf400
tree0f4fad28a660a0496540b598c08cbf713005bd94
parent908948877bbbb240f67d7eb27d3a392beb394a07
IB/rxe: Fix race condition between requester and completer

rxe_requester() is sending a pkt with rxe_xmit_packet() and
then calls rxe_update() to update the wqe and qp's psn values.
But sometimes the response is received before the requester
had time to update the wqe in which case the completer
acts on errornous wqe values.
This fix updates the wqe and qp before actually sending
the request and rolls back when xmit fails.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_req.c