From patchwork Thu Jul 29 15:17:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Kushwaha X-Patchwork-Id: 12408951 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C921C4320E for ; Thu, 29 Jul 2021 15:17:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 143D760F46 for ; Thu, 29 Jul 2021 15:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237389AbhG2PR5 (ORCPT ); Thu, 29 Jul 2021 11:17:57 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:20008 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237737AbhG2PRz (ORCPT ); Thu, 29 Jul 2021 11:17:55 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16TFBEIf028979; Thu, 29 Jul 2021 08:17:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0220; bh=G+5f3YGPuu875ZaazSePfw3ajXiXY/s6jlXSfrHYBZs=; b=GTJt2+LuHfbQe9Kx27kKSN8ZHwJ+qeFv2iNjPeFiYKENerGI5N/QnDRxfxR63WTtuJfD urs8qBKvDZYjNkrlfdsryGlmI99vtHKFWrOM6lGFCf8aCZhcxdfxaSasPKEQoYNoprAa QbQKTLi1y6EaAAEo4C5uXApA7CNEER5enYs9MrgQKIF6DlLfQWBnX2qaWRbwNHytt/Yx VU37qcZcj9BSvGr2CMC4nidNYUFzv436w2rEXwr91V9+sSuOHqGWrfQB32VK/UVkoHZq 7vBp6aR0RKm6tjm+wPM6Na7vQfF3j4YgkZQG2m1Md0ygUq2H+5oYB+xJesBDobKHxRUd 5g== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 3a35pr5ft9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 29 Jul 2021 08:17:42 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 29 Jul 2021 08:17:40 -0700 Received: from lbtlvb-pcie154.il.qlogic.org (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 29 Jul 2021 08:17:37 -0700 From: Prabhakar Kushwaha To: , , , CC: , , , , , , Subject: [PATCH 1/2] qed: Use accurate error num in qed_cxt_dynamic_ilt_alloc Date: Thu, 29 Jul 2021 18:17:31 +0300 Message-ID: <20210729151732.30995-1-pkushwaha@marvell.com> X-Mailer: git-send-email 2.16.6 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: YvvsA3W3xxhEzFdBA0Fj31-yNqt_QwN- X-Proofpoint-GUID: YvvsA3W3xxhEzFdBA0Fj31-yNqt_QwN- X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-29_10:2021-07-29,2021-07-29 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org To have more accurate error return type use -EOPNOTSUPP instead of -EINVAL. Signed-off-by: Shai Malin Signed-off-by: Ariel Elior Signed-off-by: Prabhakar Kushwaha --- drivers/net/ethernet/qlogic/qed/qed_cxt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c index 5a0a3cbcc1c1..cb0f2a3a1ac9 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c +++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c @@ -2226,8 +2226,8 @@ qed_cxt_dynamic_ilt_alloc(struct qed_hwfn *p_hwfn, p_blk = &p_cli->pf_blks[CDUT_SEG_BLK(QED_CXT_ROCE_TID_SEG)]; break; default: - DP_NOTICE(p_hwfn, "-EINVALID elem type = %d", elem_type); - return -EINVAL; + DP_NOTICE(p_hwfn, "-EOPNOTSUPP elem type = %d", elem_type); + return -EOPNOTSUPP; } /* Calculate line in ilt */ From patchwork Thu Jul 29 15:17:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Kushwaha X-Patchwork-Id: 12408953 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26FCDC4338F for ; Thu, 29 Jul 2021 15:17:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A86D60F46 for ; Thu, 29 Jul 2021 15:17:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237669AbhG2PSB (ORCPT ); Thu, 29 Jul 2021 11:18:01 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:34072 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237314AbhG2PSA (ORCPT ); Thu, 29 Jul 2021 11:18:00 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16TFA67X031357; Thu, 29 Jul 2021 08:17:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0220; bh=xoUI3k7MrqxXf+gXKX9bVMUlWshWVjAuU0il6mMQcDk=; b=IXe1A7J0Qk/qRgskj9IJMUNXdbMzkCKXBmJ/V55O3J2uR3V4MqgIstLGFMU5gF5CKvkz QT72HXQR9cweCMSGFBFy91242jOe9u5c1Mhn9vpmFLAZAD3PG9tfbj2KOIgpYZIrgjFB 3yxDVV37bdoQwK4MQU/xOiyxy1uFw3Nd7YzWkD+L5HmD29POj7f9/Czk4DiPj2uIgUX2 wrSdsu+9rPgSluonxvZI8e5aD135Q1QFMpGntquxW+2DTrIgBT0pctyeFKWF3BeirEyn aIp86cUVk+i4UY16+0r6x/5Q+MU/ULvp5RyaGNirbNSP+xtBKu63Bv0bGiXUXfOJpzNe FA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3a3w5krj8n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 29 Jul 2021 08:17:45 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 29 Jul 2021 08:17:44 -0700 Received: from lbtlvb-pcie154.il.qlogic.org (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 29 Jul 2021 08:17:41 -0700 From: Prabhakar Kushwaha To: , , , CC: , , , , , , Subject: [PATCH 2/2] qedr: Improve error logs for rdma_alloc_tid error return Date: Thu, 29 Jul 2021 18:17:32 +0300 Message-ID: <20210729151732.30995-2-pkushwaha@marvell.com> X-Mailer: git-send-email 2.16.6 In-Reply-To: <20210729151732.30995-1-pkushwaha@marvell.com> References: <20210729151732.30995-1-pkushwaha@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: oSgoGAnyewPlEshSsMikyWoIQuevYuFc X-Proofpoint-ORIG-GUID: oSgoGAnyewPlEshSsMikyWoIQuevYuFc X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-29_10:2021-07-29,2021-07-29 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Use -EINVAL return type to identify whether error is returned because of "Out of MR resources" or any other error types. Signed-off-by: Shai Malin Signed-off-by: Ariel Elior Signed-off-by: Prabhakar Kushwaha --- drivers/infiniband/hw/qedr/verbs.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index fdc47ef7d861..b72ef24db657 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -2996,7 +2996,11 @@ struct ib_mr *qedr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len, rc = dev->ops->rdma_alloc_tid(dev->rdma_ctx, &mr->hw_mr.itid); if (rc) { - DP_ERR(dev, "roce alloc tid returned an error %d\n", rc); + if (rc == -EINVAL) + DP_ERR(dev, "Out of MR resources\n"); + else + DP_ERR(dev, "roce alloc tid returned error %d\n", rc); + goto err1; } @@ -3091,7 +3095,11 @@ static struct qedr_mr *__qedr_alloc_mr(struct ib_pd *ibpd, rc = dev->ops->rdma_alloc_tid(dev->rdma_ctx, &mr->hw_mr.itid); if (rc) { - DP_ERR(dev, "roce alloc tid returned an error %d\n", rc); + if (rc == -EINVAL) + DP_ERR(dev, "Out of MR resources\n"); + else + DP_ERR(dev, "roce alloc tid returned error %d\n", rc); + goto err0; } @@ -3221,7 +3229,11 @@ struct ib_mr *qedr_get_dma_mr(struct ib_pd *ibpd, int acc) rc = dev->ops->rdma_alloc_tid(dev->rdma_ctx, &mr->hw_mr.itid); if (rc) { - DP_ERR(dev, "roce alloc tid returned an error %d\n", rc); + if (rc == -EINVAL) + DP_ERR(dev, "Out of MR resources\n"); + else + DP_ERR(dev, "roce alloc tid returned error %d\n", rc); + goto err1; }