]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/hns: Fix incorrect post-send with direct wqe of wr-list
authorJunxian Huang <huangjunxian6@hisilicon.com>
Fri, 4 Aug 2023 01:27:09 +0000 (09:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:29 +0000 (09:48 +0200)
commitbf6f879fde4906fe88158aba3e15693fd2515347
tree709ed55caa82bff42fb0cd2f892226e89ebdf69d
parentca0d8f408a455c13d0fa2df93b16dd88f878ebf1
RDMA/hns: Fix incorrect post-send with direct wqe of wr-list

[ Upstream commit 706efac4477cdb8be857f6322457de524acc02ff ]

Currently, direct wqe is not supported for wr-list. RoCE driver excludes
direct wqe for wr-list by judging whether the number of wr is 1.

For a wr-list where the second wr is a length-error atomic wr, the
post-send driver handles the first wr and adds 1 to the wr number counter
firstly. While handling the second wr, the driver finds out a length error
and terminates the wr handle process, remaining the counter at 1. This
causes the driver mistakenly judges there is only 1 wr and thus enters
the direct wqe process, carrying the current length-error atomic wqe.

This patch fixes the error by adding a judgement whether the current wr
is a bad wr. If so, use the normal doorbell process but not direct wqe
despite the wr number is 1.

Fixes: 01584a5edcc4 ("RDMA/hns: Add support of direct wqe")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://lore.kernel.org/r/20230804012711.808069-3-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hns/hns_roce_hw_v2.c