From patchwork Wed Jul 4 21:52:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10507705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8712B603D7 for ; Wed, 4 Jul 2018 21:53:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D3E828DA2 for ; Wed, 4 Jul 2018 21:53:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 719B128DAB; Wed, 4 Jul 2018 21:53:14 +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 1C29328DA2 for ; Wed, 4 Jul 2018 21:53:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752976AbeGDVxL (ORCPT ); Wed, 4 Jul 2018 17:53:11 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34971 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752881AbeGDVxI (ORCPT ); Wed, 4 Jul 2018 17:53:08 -0400 Received: by mail-wm0-f68.google.com with SMTP id v3-v6so4372990wmh.0 for ; Wed, 04 Jul 2018 14:53:08 -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=2/pWg5f9MMJkgEjzwqJEAHSNa6fcvwmrrITneW63NaM=; b=Z1yxAknGEhSg9iKs/gEKBp7v3DaR25VEdD8dmFNXSX92OQd2WcuEerfw53pC/Cjtue hu2u2eJkJJYagp47nAOsUG08jBydGcZlDt1onWQLTg+1RQhGN/DJ423jHlke2vGiqAoh CtIGNa3Ay63PryVUYeAxPWITSTTNSkWgihaH1c1ncdfhIKsLksJ2KwiuQE7ilikSBXYm gUkRZF8BNCIK7NquTpYE2H23IgTJCxrZMuV/JxB3LM0fPzcKPDqqePEpS4ZcWM0RiETm +Mt/FCYM/GrUCmBX3RL9OznqHAJtLbQMyxgpUHIHt9wfsdZ1HngBsMcimz2S/AwQBocZ 90XA== 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=2/pWg5f9MMJkgEjzwqJEAHSNa6fcvwmrrITneW63NaM=; b=NGVzzZTQ8N8mJQVBsDWIhe1c2RQMgCyBs8w0NH9Py3ss7geO4xrkc3lMS+15pvRPLt DhfrkHRUmBy5UjbyXuQbCcA8E29WqMwgnifw0of9oJcr73SFT53rDthj8GwPrBv+QLSC 4LMH9NtzfZMc5Fg+Nn431fKVnp+ZQUYoHNwUGw4aR+wmyKkD5y6L8wHj/HjBSrk12VAf 8Jrc7h/u/hgq8bI6RPTuWSoEGOWqTlpywlPgYuOZZVZeCZ2YBom/CK40iegRrku6khWZ lPyFpc6t3y5J1+UirLcBnTCa2jtr6MaAlk2ip0Hyz3SRAHHN7YUKdQvTWfdcl1XJMKkZ oT4w== X-Gm-Message-State: APt69E1OXbzUdyIXm9W47Cm+v5V6sqKOlhxQ4rxVzf7YI7Sp7/H2q27N pMrHoXD3G3Mv+OZXhU5LNnKmcQ== X-Google-Smtp-Source: AAOMgpc4UirfUfSMyhPSZWlY4jvRDnsgFAP2Z5+8X8HJ6EW427ct2g6KIq4ps8xnPAB1H8Bp2WRbJA== X-Received: by 2002:a1c:9bd0:: with SMTP id d199-v6mr2548078wme.16.1530741187570; Wed, 04 Jul 2018 14:53:07 -0700 (PDT) Received: from localhost.localdomain (bzq-79-179-11-238.red.bezeqint.net. [79.179.11.238]) by smtp.gmail.com with ESMTPSA id d102-v6sm9005353wma.10.2018.07.04.14.53.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Jul 2018 14:53:07 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe , Leon Romanovsky Cc: linux-rdma@vger.kernel.org, Kamal Heib Subject: [PATCH rdma-next V2 3/5] RDMA/ipoib: Fix verifying return codes Date: Thu, 5 Jul 2018 00:52:49 +0300 Message-Id: <20180704215251.10698-4-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180704215251.10698-1-kamalheib1@gmail.com> References: <20180704215251.10698-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() and rdma_set_cq_moderation() in case that they aren't supported. Signed-off-by: Kamal Heib --- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 2 +- drivers/infiniband/ulp/ipoib/ipoib_ethtool.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 7eb38775f948..f16ecd799ab0 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -1564,7 +1564,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; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c index 2706bf26cbac..83429925dfc6 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ethtool.c @@ -102,7 +102,7 @@ static int ipoib_set_coalesce(struct net_device *dev, ret = rdma_set_cq_moderation(priv->recv_cq, coal->rx_max_coalesced_frames, coal->rx_coalesce_usecs); - if (ret && ret != -ENOSYS) { + if (ret && ret != -EOPNOTSUPP) { ipoib_warn(priv, "failed modifying CQ (%d)\n", ret); return ret; }