From patchwork Tue Nov 14 12:34:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxian Huang X-Patchwork-Id: 164881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1827182vqg; Tue, 14 Nov 2023 04:38:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3mqq81mUxZQjFUnzp60VtlsoNwuSDuHJOO3mCjm7jmAFE8B55aNPgiVOVdfzS44JyEb8U X-Received: by 2002:a05:6a20:6a0f:b0:187:1f49:b3b7 with SMTP id p15-20020a056a206a0f00b001871f49b3b7mr1013207pzk.43.1699965509467; Tue, 14 Nov 2023 04:38:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699965509; cv=none; d=google.com; s=arc-20160816; b=C89jvENBu9NOYyvaAO2Vb8BMovC5w3l2I8/EI9dsYgm6+q/tL+Q41GQdmvDZiuiSY8 Tsi92tE5U8wZnawo4bnUQd3bH+MWUe7Ct5vwR9lmbObUG85TLeTCsNM7AF9LXngJ9CqI 2c0Iw2VzpimIZoVDxpS7eiN/EO43AGGgsqgHfTRbtCeGQkylp4DekP5q1zwubKdBeyyq +k2IlNzDmHO1+1mQ4M6x3eZeNnNxpgyoKB8TDhvCZZWF9UoO1JAniegGISp+bX+db2XI qhGhisNBuK6dqOIaLrZY3/vfGXoT0nZmMT9414N9isY4GZc8HQxBETc5udXutQle0X5C aZCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Rz7LqdJ9ITxGGkvW0JOOJAoQg2aam0EFRUISlCv/gXg=; fh=KWvyQxL3Ff+3WPSMjlYu+P4255AmcMULAsFol6M1vNI=; b=fcc5NWk2V3aE7VMu/1rm8CsJwEWjA2SCd/EK4aMYwZi+owurh2sgAVpxZac8IlDi7p TUp+O5cCAKQg8rk5NmjqpfdC7uTc66ZnfA1/khRbZhQS02b9W8j8XqY9mYZ+pYam1++1 fV4Jbk704HoYQqOK66CawS/udAMc8nmvl/uQZEV6T5uX3fadjRaF69lasR3kLZ+3DgqW rSq5cU04MeY710jeq2m59AmypADeXthklSXv7v6cGqiJS3KMHUVuCdG/llTwsuHQPs1m 8AbTPSXL+90v2iWladvZhw/IsY8+rpHLh9wWSNanV6xBaX0+JkSSOWMGmv1GeYC/SKM+ zILw== 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 Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id l192-20020a6391c9000000b005bde2c3e4dfsi7974992pge.385.2023.11.14.04.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 04:38:29 -0800 (PST) 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 9016880D6E50; Tue, 14 Nov 2023 04:38:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233061AbjKNMiY (ORCPT + 29 others); Tue, 14 Nov 2023 07:38:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjKNMiV (ORCPT ); Tue, 14 Nov 2023 07:38:21 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7875D1; Tue, 14 Nov 2023 04:38:17 -0800 (PST) Received: from kwepemi500006.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SV5Rk1DlwzWhN2; Tue, 14 Nov 2023 20:37:54 +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; Tue, 14 Nov 2023 20:38:15 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH for-next 1/3] RDMA/hns: Fix inappropriate err code for unsupported operations Date: Tue, 14 Nov 2023 20:34:47 +0800 Message-ID: <20231114123449.1106162-2-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231114123449.1106162-1-huangjunxian6@hisilicon.com> References: <20231114123449.1106162-1-huangjunxian6@hisilicon.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemi500006.china.huawei.com (7.221.188.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Tue, 14 Nov 2023 04:38:28 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782543033711931630 X-GMAIL-MSGID: 1782543033711931630 EOPNOTSUPP is more situable than EINVAL for allocating XRCD while XRC is not supported and unsupported resizing SRQ. Fixes: 32548870d438 ("RDMA/hns: Add support for XRC on HIP09") Fixes: 221109e64316 ("RDMA/hns: Add interception for resizing SRQs") Signed-off-by: Junxian Huang --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- drivers/infiniband/hw/hns/hns_roce_pd.c | 2 +- 2 files changed, 2 insertions(+), 2 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..c01307be06ab 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -5666,7 +5666,7 @@ static int hns_roce_v2_modify_srq(struct ib_srq *ibsrq, /* Resizing SRQs is not supported yet */ if (srq_attr_mask & IB_SRQ_MAX_WR) - return -EINVAL; + return -EOPNOTSUPP; if (srq_attr_mask & IB_SRQ_LIMIT) { if (srq_attr->srq_limit > srq->wqe_cnt) diff --git a/drivers/infiniband/hw/hns/hns_roce_pd.c b/drivers/infiniband/hw/hns/hns_roce_pd.c index 783e71852c50..bd1fe89ca205 100644 --- a/drivers/infiniband/hw/hns/hns_roce_pd.c +++ b/drivers/infiniband/hw/hns/hns_roce_pd.c @@ -150,7 +150,7 @@ int hns_roce_alloc_xrcd(struct ib_xrcd *ib_xrcd, struct ib_udata *udata) int ret; if (!(hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_XRC)) - return -EINVAL; + return -EOPNOTSUPP; ret = hns_roce_xrcd_alloc(hr_dev, &xrcd->xrcdn); if (ret)