]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
RDMA/hns: Add a check for current state before modifying QP
authorLang Cheng <chenglang@huawei.com>
Tue, 25 Aug 2020 11:07:54 +0000 (19:07 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:48:54 +0000 (14:48 +0100)
commit2aa3ae3060ffebe57636ae8b41f4f468551f1b29
tree1d12ea0a051f69928b530b1c7a1ad4be623661c7
parent169b14eec37b1542dbe4112d5b38f7d337cb847d
RDMA/hns: Add a check for current state before modifying QP

BugLink: https://bugs.launchpad.net/bugs/1902115
[ Upstream commit e0ef0f68c4c0d85b1eb63f38d5d10324361280e8 ]

It should be considered an illegal operation if the ULP attempts to modify
a QP from another state to the current hardware state. Otherwise, the ULP
can modify some fields of QPC at any time. For example, for a QP in state
of RTS, modify it from RTR to RTS can change the PSN, which is always not
as expected.

Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver")
Link: https://lore.kernel.org/r/1598353674-24270-1-git-send-email-liweihang@huawei.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
drivers/infiniband/hw/hns/hns_roce_qp.c