From: Juan Zhou zhoujuan51@h-partners.com
Luoyouming (2): RDMA/hns: Fix the inconsistency between the rq inline bit and the community RDMA/hns: Fix the compatibility flag problem
drivers/infiniband/hw/hns/hns_roce_device.h | 4 +--- drivers/infiniband/hw/hns/hns_roce_main.c | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-)
From: Luoyouming luoyouming@huawei.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6ZBLL
---------------------------------------------------------------
In the community version, the rq inline bit is set to 2. This patch is used for synchronization.
Fixes: d67087cc08760 ("RDMA/hns: Remove enable rq inline in kernel and add compatibility handling") Signed-off-by: Luoyouming luoyouming@huawei.com --- drivers/infiniband/hw/hns/hns_roce_device.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h index 9ca81b3c3f12..49b9b43402f3 100644 --- a/drivers/infiniband/hw/hns/hns_roce_device.h +++ b/drivers/infiniband/hw/hns/hns_roce_device.h @@ -143,8 +143,7 @@ enum hns_roce_qp_create_flags { enum { HNS_ROCE_CAP_FLAG_REREG_MR = BIT(0), HNS_ROCE_CAP_FLAG_ROCE_V1_V2 = BIT(1), - /* discard this bit, reserved for compatibility */ - HNS_ROCE_CAP_FLAG_DISCARD = BIT(2), + HNS_ROCE_CAP_FLAG_RQ_INLINE = BIT(2), HNS_ROCE_CAP_FLAG_CQ_RECORD_DB = BIT(3), HNS_ROCE_CAP_FLAG_QP_RECORD_DB = BIT(4), HNS_ROCE_CAP_FLAG_SRQ = BIT(5), @@ -159,7 +158,6 @@ enum { HNS_ROCE_CAP_FLAG_DCA_MODE = BIT(15), HNS_ROCE_CAP_FLAG_STASH = BIT(17), HNS_ROCE_CAP_FLAG_CQE_INLINE = BIT(19), - HNS_ROCE_CAP_FLAG_RQ_INLINE = BIT(20), HNS_ROCE_CAP_FLAG_BOND = BIT(21), };
From: Luoyouming luoyouming@huawei.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6ZBLL
---------------------------------------------------------------
When the compatibility flag is interacted, the kernel space does not confirm whether the user space has issued the flag but responds directly, which will cause the flag to be received in any scenario in the user space, and the current patch adds this judgment.
Fixes: b3b7a525b076 ("RDMA/hns: Support cqe inline in user space") Fixes: d67087cc0876 ("RDMA/hns: Remove enable rq inline in kernel and add compatibility handling") Signed-off-by: Luoyouming luoyouming@huawei.com --- drivers/infiniband/hw/hns/hns_roce_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 101614aed9c7..d41387d0a411 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -527,12 +527,14 @@ static int hns_roce_alloc_ucontext(struct ib_ucontext *uctx,
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RQ_INLINE) { context->config |= ucmd.config & HNS_ROCE_RQ_INLINE_FLAGS; - resp.config |= HNS_ROCE_RSP_RQ_INLINE_FLAGS; + if (context->config & HNS_ROCE_RQ_INLINE_FLAGS) + resp.config |= HNS_ROCE_RSP_RQ_INLINE_FLAGS; }
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_CQE_INLINE) { context->config |= ucmd.config & HNS_ROCE_CQE_INLINE_FLAGS; - resp.config |= HNS_ROCE_RSP_CQE_INLINE_FLAGS; + if (context->config & HNS_ROCE_CQE_INLINE_FLAGS) + resp.config |= HNS_ROCE_RSP_CQE_INLINE_FLAGS; }
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_DCA_MODE) {