driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I87LCF
--------------------------------------------------------------------------
HNS_ROCE_UCTX_RSP_DCA_FLAGS is set only if HNS_ROCE_UCTX_CONFIG_DCA is configured.
Signed-off-by: Chengchang Tang tangchengchang@huawei.com --- drivers/infiniband/hw/hns/hns_roce_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 2f0a5b2bbc50..7a4662a8718f 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -541,7 +541,8 @@ static int hns_roce_alloc_ucontext(struct ib_ucontext *uctx,
if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_DCA_MODE) { context->config |= ucmd.config & HNS_ROCE_UCTX_CONFIG_DCA; - resp.config |= HNS_ROCE_UCTX_RSP_DCA_FLAGS; + if (context->config & HNS_ROCE_UCTX_CONFIG_DCA) + resp.config |= HNS_ROCE_UCTX_RSP_DCA_FLAGS; }
ret = hns_roce_uar_alloc(hr_dev, &context->uar);