]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/bnxt_re: Fix the handling of control path response data
authorSelvin Xavier <selvin.xavier@broadcom.com>
Wed, 20 Sep 2023 08:41:19 +0000 (01:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 20:03:05 +0000 (22:03 +0200)
commit56c479ba38d826b6efb5e63d1e1e4e921d357a87
treeb4b3e8ec7413d963b209aaa40fb09c729aff808e
parent13ac926cd4b8618fdf8ae7aa56581dc0e3c3191f
RDMA/bnxt_re: Fix the handling of control path response data

commit 9fc5f9a92fe6897dbed7b9295b234cb7e3cc9d11 upstream.

Flag that indicate control path command completion should be cleared
only after copying the command response data. As soon as the is_in_used
flag is clear, the waiting thread can proceed with wrong response
data.  This wrong data is causing multiple issues like wrong lkey
used in data traffic and wrong AH Id etc.

Use a memory barrier to ensure that the response data
is copied and visible to the process waiting on a different
cpu core before clearing the is_in_used flag.

Clear the is_in_used after copying the command response.

Fixes: bcfee4ce3e01 ("RDMA/bnxt_re: remove redundant cmdq_bitmap")
Signed-off-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://lore.kernel.org/r/1695199280-13520-2-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c