]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commite7afe54206c5562ff4c4178d48c8d0ec68e7929c
tree0f4fad28a660a0496540b598c08cbf713005bd94
parenta9331e73ad67db282a057f72997da4ba536c62df
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: c4397c211d7d ("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