From patchwork Sat Oct 28 09:32:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxian Huang X-Patchwork-Id: 159249 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp1125324vqb; Sat, 28 Oct 2023 02:36:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9bENO+Fz/Nj2dg5Tcnc5UCZADPmfnyGy7mxkvPvgMK4Mnwx4JyH23imW6ZIk86FcRBi9x X-Received: by 2002:a05:6a20:4924:b0:17b:2c56:70b8 with SMTP id ft36-20020a056a20492400b0017b2c5670b8mr4883465pzb.22.1698485774902; Sat, 28 Oct 2023 02:36:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698485774; cv=none; d=google.com; s=arc-20160816; b=fo63A2STZzLeKjYo1WFLExIYYnCgNmux0F4niuRfzafVvPe3yiYv4sfsWeFKlV5rdC 0ogsALxIlgITrTyGoHY/TAh2CA7MR1qIJISSDUPeDav3X7CsOoMk4pxsRCNCpbZ4rh3e SaeyJnTjuEKV8avh0Oa/rqpfh9lROs01kmHklgSf7xtXR3+xvpYCBKcSJzbBBZbMH3KY XoVcc7lHFhR+0fApzO3Hs3dROBS/Rnj9665M82SBZTg2xrIx7E4O6PuUv4/8b0O7NHkz /+fSF5Slb5B/Qoz7aqiahSojCSVT7V13uwlXHq5O1woeaqxOnE9shLmkOSLegQrOGF+N yaHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MHf1PsWtN8DJzKcRMrIB5xKN8Gv5vjxeg/Eij1SOIdM=; fh=KWvyQxL3Ff+3WPSMjlYu+P4255AmcMULAsFol6M1vNI=; b=nVakEloE9GTuGVIZD2eHoiVg8bJXLB/pvH1resJpINcHhROaUGDvxDKtlbOoCZQlRQ QPWo0/MAoF76i4JVcVmrzQFH/RoXtq1EaQo5XxeVoLdSoiufPAILn1Y3rMIPcr05qpj3 xE+mVsqXfaFoHiMWBTlMAarbq9HvqOmyljb89yVvrFBcgSbC92nNdGHkOUNXQ3FwRasP UCbCJ5pna7u1+WBS5ZAhjCaJ3GEJ8xKcNOjwI4AxKhOEYKmo7u3p4xSILcUqANNHFeoo CHorWUz//sqUYOLadbotuDMXlTtHE0NAEH0gcynZ+5mphdAhgotLCEIfhLkasN4+AKG9 PG1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m12-20020a633f0c000000b0056357813fc2si2213894pga.183.2023.10.28.02.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 02:36:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EFCAC818ABD2; Sat, 28 Oct 2023 02:36:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbjJ1JgI (ORCPT + 28 others); Sat, 28 Oct 2023 05:36:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjJ1JgH (ORCPT ); Sat, 28 Oct 2023 05:36:07 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7869E; Sat, 28 Oct 2023 02:36:02 -0700 (PDT) Received: from kwepemi500006.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SHZ783TpRzVlXF; Sat, 28 Oct 2023 17:32:04 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500006.china.huawei.com (7.221.188.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sat, 28 Oct 2023 17:35:59 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH for-next] RDMA/hns: Fix unnecessary err return when using invalid congest control algorithm Date: Sat, 28 Oct 2023 17:32:42 +0800 Message-ID: <20231028093242.670325-1-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500006.china.huawei.com (7.221.188.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 28 Oct 2023 02:36:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780991420174061297 X-GMAIL-MSGID: 1780991420174061297 Add a default congest control algorithm so that driver won't return an error when the configured algorithm is invalid. Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW") Signed-off-by: Junxian Huang --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 0cd2612a4987..2bca9560f32d 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -4760,10 +4760,15 @@ static int check_cong_type(struct ib_qp *ibqp, cong_alg->wnd_mode_sel = WND_LIMIT; break; default: - ibdev_err(&hr_dev->ib_dev, - "error type(%u) for congestion selection.\n", - hr_dev->caps.cong_type); - return -EINVAL; + ibdev_warn(&hr_dev->ib_dev, + "invalid type(%u) for congestion selection.\n", + hr_dev->caps.cong_type); + hr_dev->caps.cong_type = CONG_TYPE_DCQCN; + cong_alg->alg_sel = CONG_DCQCN; + cong_alg->alg_sub_sel = UNSUPPORT_CONG_LEVEL; + cong_alg->dip_vld = DIP_INVALID; + cong_alg->wnd_mode_sel = WND_LIMIT; + break; } return 0;