Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1672090rdh; Sat, 28 Oct 2023 02:36:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEB/sxMdJzFs+Glo66ruHaRxW0vvoBYScuypAQULhlObZuqviUCINzofmwobX77FELCxmAx X-Received: by 2002:a17:902:fa07:b0:1c9:c6f4:e0c3 with SMTP id la7-20020a170902fa0700b001c9c6f4e0c3mr4844349plb.62.1698485772309; Sat, 28 Oct 2023 02:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698485772; cv=none; d=google.com; s=arc-20160816; b=CYUqe92GR6ednkPiS7tRdk2sgM+hbtYC9OigMOBZjY6JeXgtS+Qd4vTkkPi1VjpYAT ImR+1RSZxtQCyhXlJjdToXx1DGfSwgflyNtDiWbY7mo6ncnIjFpe3zSspVKzhjAa7hpz H4euOgvHoOKCM3OWUFi91EvZ4vXVBVD6H3gBFvGkiX8mt7OWXyvgHOPFYouqNXUMzumt Nb48qD1GczmL1LRRiZoWOW+GCSTCtbqq3ubOsmziRrEyBFRi/Vtprp44ryu6Ve5HcpjN h1jrpg+DPfyHvecMJoXJQfQIShVB6fM2bIMyHYHDIjF2vG+lewk+57JHWWoF41aGr8rK H0WA== 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 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f20-20020a170903105400b001c9c8e0cbafsi2294044plc.202.2023.10.28.02.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 02:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 3717380775B8; Sat, 28 Oct 2023 02:36:11 -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 S229579AbjJ1JgI (ORCPT + 99 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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:11 -0700 (PDT) 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; -- 2.30.0