From patchwork Mon Jul 30 18:56:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10549589 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D551415E2 for ; Mon, 30 Jul 2018 18:57:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5CA22842A for ; Mon, 30 Jul 2018 18:57:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA0EB286EC; Mon, 30 Jul 2018 18:57:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65CB22842A for ; Mon, 30 Jul 2018 18:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731016AbeG3Udd (ORCPT ); Mon, 30 Jul 2018 16:33:33 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41941 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730400AbeG3Udd (ORCPT ); Mon, 30 Jul 2018 16:33:33 -0400 Received: by mail-wr1-f68.google.com with SMTP id j5-v6so14015846wrr.8 for ; Mon, 30 Jul 2018 11:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eIjS7wDt3QkiAayWuaBAtkAHkXHrRI+LRydmDb9NU1M=; b=SbWKIMtJfIcYCgxY9HM9aGXVQkwzmYEhEAOlHe3JAOG3/bGXczIn/wWNuCdQsmFOEO s5S02E4iIdlZzw3xS3iLjfwa9VAN0ZI9qo0v3ehkC1HKfIs6Y6LEAGzD2A5LDPYY8/z/ 4aUCJ1R4ZRFlJJp5GgD4oW4qykx7NShvIu31HEpAGH3hBP32SRYIkTZ/DJj42SNDEDFw glmHmob6svk9Bf3F4ocUenpUhVaKsw9HITnwmPcfgInZTK4bsAE/3NnOJU3Zj4R9t1wo m2C+Ptbr+5ZSz3vgMywVn1aYzi3ZOx5Rg5NdUU1nIRwKLMvO6bOUsgXi79xK9QIwS0SE 7JyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eIjS7wDt3QkiAayWuaBAtkAHkXHrRI+LRydmDb9NU1M=; b=rOsXC2Hfyx5Is2d1Iws2hPKqw0WY30xRIfTlPHD1ct95O9T86Oq6CmeGUHp53jJVOv c20w6XwZ7kF/uW7YPSBLfgsX5wR+Mt2bv3UoZba6CrmtK1YDi1aUU9Ee2GUnA0+L+yEO 33QYrnP9N2PWlDvaOzYbE+PwRhzWY3Lze6CpcGjyVC2t7ROhaJZrjZSx60uhuOE9kn2k HZffidmG9++Z7kPdsv66dxZJNiLleDk6eJ52gNHcSbUQQdNncOSRJ8im6OWrlxIGbwH0 tITLWZOKW0IL/Ml53fX147gi//qoLFEJkJrFviCGpphFXanUPzkuYLZK4S6E0v+noWeO ZKrA== X-Gm-Message-State: AOUpUlG1aIqVSZQatzEZWfDmG6MlcK8a7rcLxWLtoIYyW1sE9Rr8azDL 41+xG8NVna52bxGgmfYPCfI= X-Google-Smtp-Source: AAOMgpfsqVnFpxr8503BWcez/yxVkb+k5ip26ebw8/iS3QGFAYC4j0ub6X7jWWe8Kc6AZ3KiDh2LeA== X-Received: by 2002:adf:9d81:: with SMTP id p1-v6mr19202223wre.12.1532977030682; Mon, 30 Jul 2018 11:57:10 -0700 (PDT) Received: from localhost.localdomain ([2.53.153.184]) by smtp.gmail.com with ESMTPSA id z14-v6sm343295wma.18.2018.07.30.11.57.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jul 2018 11:57:10 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, Kamal Heib Subject: [PATCH rdma-next 1/2] RDMA/providers: Fix return value from create_srq callbacks Date: Mon, 30 Jul 2018 21:56:43 +0300 Message-Id: <20180730185644.14702-2-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180730185644.14702-1-kamalheib1@gmail.com> References: <20180730185644.14702-1-kamalheib1@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The proper return code is "-EOPNOTSUPP" when the create_srq() callback is not supported. Signed-off-by: Kamal Heib --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 +- drivers/infiniband/hw/mthca/mthca_provider.c | 2 +- drivers/infiniband/sw/rdmavt/srq.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index dd800d153aa2..6a90ca441b09 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -1397,7 +1397,7 @@ struct ib_srq *bnxt_re_create_srq(struct ib_pd *ib_pd, } if (srq_init_attr->srq_type != IB_SRQT_BASIC) { - rc = -ENOTSUPP; + rc = -EOPNOTSUPP; goto exit; } diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index 20febafc1fdd..0d3473b4596e 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -449,7 +449,7 @@ static struct ib_srq *mthca_create_srq(struct ib_pd *pd, int err; if (init_attr->srq_type != IB_SRQT_BASIC) - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); srq = kmalloc(sizeof *srq, GFP_KERNEL); if (!srq) diff --git a/drivers/infiniband/sw/rdmavt/srq.c b/drivers/infiniband/sw/rdmavt/srq.c index 3707952b4364..78e06fc456c5 100644 --- a/drivers/infiniband/sw/rdmavt/srq.c +++ b/drivers/infiniband/sw/rdmavt/srq.c @@ -82,7 +82,7 @@ struct ib_srq *rvt_create_srq(struct ib_pd *ibpd, struct ib_srq *ret; if (srq_init_attr->srq_type != IB_SRQT_BASIC) - return ERR_PTR(-ENOSYS); + return ERR_PTR(-EOPNOTSUPP); if (srq_init_attr->attr.max_sge == 0 || srq_init_attr->attr.max_sge > dev->dparms.props.max_srq_sge || From patchwork Mon Jul 30 18:56:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10549591 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEF4115E2 for ; Mon, 30 Jul 2018 18:57:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F9C92842A for ; Mon, 30 Jul 2018 18:57:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93D2A286EC; Mon, 30 Jul 2018 18:57:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46E5A2842A for ; Mon, 30 Jul 2018 18:57:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730513AbeG3Udf (ORCPT ); Mon, 30 Jul 2018 16:33:35 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38531 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730400AbeG3Udf (ORCPT ); Mon, 30 Jul 2018 16:33:35 -0400 Received: by mail-wm0-f68.google.com with SMTP id t25-v6so482520wmi.3 for ; Mon, 30 Jul 2018 11:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DyMuWzwI6oEtAuKlk3haUJYfYtfZGrA9vRpjJMb69yM=; b=D5kYbkZtEDFjte5G3LQzp/wbycEqsF/GfyJ2TDOULmBpz4r7qz2RidBq7i6Ub+zcnq WSYaokpTJXJfGstrsyN9k8coOiJ8EudQnzRyDmIKF+YGblLX4uIApzb9ddwVLxcNtd+Z P5ghJxfWb5aI6sNiHSBLpwHzpeLbFq1bTEUE7jOaUt0QBaTrW0UFSp/oX7OXcjpp55WY /STN5/GH7mTCaRhZje1irbejICqczNkBVvd1H3I4Ac+uY2UzOyLJRC4eqYeIqD7btGca MTrFHHYJWPA/75GbYuUUoj0bc42l3M1jQJg4OHxZ/7D3j+Xi3JwEs0XxyNFqbGT7aWeP 2NFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DyMuWzwI6oEtAuKlk3haUJYfYtfZGrA9vRpjJMb69yM=; b=kbiL/ezts86jnxC2b8CNK75WBraZqeTbp//RB8syvAC0uJGto4MZrxld6rnhrv4rpB H+gbDnh/JeHqzDSCYDWI6thzAViMZ5v8hMqvmQG0ZZNRLPckHiyR3/nM12WiRCQnOO7k 9KxbKjhhyoGmUIPEaEtbmdLedN8uyV9CvPJFScvJ1cExj8W9193dtXnYDrjx2e01O2PA AEjvbeqxjZMbAmxOk3yIsFxsrdEBB5BG1j6JD1PUFAPbQbOvqSzCqLqJCxzuq+WniquN HRhpNtbqdj3w3pWXkxFvUSll3hwzx6Lm7HWhe4fk55yod9E35rrcLLpbsDWVsKWtrJ2i PulQ== X-Gm-Message-State: AOUpUlFqXLgalwIMbUtnwsEqW9GTnkgWYNBcDvGIRhKPRCOWceJHTtLV pGInLBpa4uNPIiU+bWHIljo= X-Google-Smtp-Source: AAOMgpfZ+uotsXPLm5Zb0aiyNcjOW6XsjViLq09i4bt6TA5ky2RVxlyEotasuLkhuX9sQwHmvIxgQQ== X-Received: by 2002:a1c:e70b:: with SMTP id e11-v6mr313897wmh.22.1532977032799; Mon, 30 Jul 2018 11:57:12 -0700 (PDT) Received: from localhost.localdomain ([2.53.153.184]) by smtp.gmail.com with ESMTPSA id z14-v6sm343295wma.18.2018.07.30.11.57.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jul 2018 11:57:12 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, Kamal Heib Subject: [PATCH rdma-next 2/2] RDMA/ipoib: Fix check for return code from ib_create_srq Date: Mon, 30 Jul 2018 21:56:44 +0300 Message-Id: <20180730185644.14702-3-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180730185644.14702-1-kamalheib1@gmail.com> References: <20180730185644.14702-1-kamalheib1@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure to check for "-EOPNOTSUPP" instead of "-ENOSYS" which is the return code from ib_create_srq() in case that it not supported. Signed-off-by: Kamal Heib --- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 8b44f33c7ae0..8ef50e46157c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -1560,7 +1560,7 @@ static void ipoib_cm_create_srq(struct net_device *dev, int max_sge) priv->cm.srq = ib_create_srq(priv->pd, &srq_init_attr); if (IS_ERR(priv->cm.srq)) { - if (PTR_ERR(priv->cm.srq) != -ENOSYS) + if (PTR_ERR(priv->cm.srq) != -EOPNOTSUPP) pr_warn("%s: failed to allocate SRQ, error %ld\n", priv->ca->name, PTR_ERR(priv->cm.srq)); priv->cm.srq = NULL;