From patchwork Wed Jul 4 18:46: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: 10507501 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 C833C6028F for ; Wed, 4 Jul 2018 18:47:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AD1E28744 for ; Wed, 4 Jul 2018 18:47:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DEAD28949; Wed, 4 Jul 2018 18:47: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 36B9228744 for ; Wed, 4 Jul 2018 18:47:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752571AbeGDSrL (ORCPT ); Wed, 4 Jul 2018 14:47:11 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43271 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752251AbeGDSrL (ORCPT ); Wed, 4 Jul 2018 14:47:11 -0400 Received: by mail-wr1-f66.google.com with SMTP id b15-v6so6042wrv.10 for ; Wed, 04 Jul 2018 11:47:10 -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=os8mWV1EoPGsE1kLv8yVTCfOhJsPfk/RSs/bS9/5fsk=; b=JavPeG8wYFWytWWBwbAEegqf0npysU3NxalyenZdf0C7ccJ3wmHNDabAr+bBZFnV8p +S+GlogsuHbiZiS3U8705VA6AOLmd2b/bAdDPP7CTz22MDgAkIRbHGoKVNuzus5w8vdz wIFY+L5+LX5Dpi4y9tYiBlvQXfI132QC0ASKXDDZXSpOiXTd1xYe0MyCeMAFubJs6gxJ ruTrZK708p/HKyqx7eyQ8jsp8jeIZdSAR4zfUxmtxNUQhBdgKl7kQ40Oyt4kxyU7rUzk MUZMiM4ziDRDlt2NxxWb0TP+Z5jSjSvkoumw6t1vjjKCiHshnI9UweJhsDqLL+PRWfeG abpQ== 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=os8mWV1EoPGsE1kLv8yVTCfOhJsPfk/RSs/bS9/5fsk=; b=kVW/ExLB0x0wq7zkgav03KUIAikRav1dn6XXaMDhhNXalZEnbHdN+HESLom6CIOdc3 Y+52hWXC+YlXTxM0LLGNVrbZCNGFyWsHHNWOppknTStEh9GVGJPicZtWBNN/ioeBVL6D 6drp0zkST0iOxPymCk/m/+nsQfoFkLgMyMjpJ+A0RUmRA9RUpTD7O6PhoDiKb4jji7PB BJ6/1QVuoJCVORM4EouQLyKQ6Tusds5K3+hWpsLKhxaQWAR5moZoYP5wT4holy3XtTkN zv78IM8lqUSaMGYCznlEZW3GAjzoSswcryZcLxGiDVc27EE9tJf67O5C1hu2TFlo3xuN Irew== X-Gm-Message-State: APt69E3+jnN0A2Dc2i4xJ7v17vvuISSny4Qc+z9Bj19wD6aJ0SbmDr9F ln/usndcn0MumhA4wW0mwNs= X-Google-Smtp-Source: AAOMgpdEMX5AVqjfiW38M5QmZ2didFd+JWd9aHVmNMyaN72RlhTGjRTTeW+C3rGh+Obs6POFP49WMw== X-Received: by 2002:a5d:438d:: with SMTP id i13-v6mr2535137wrq.156.1530730029841; Wed, 04 Jul 2018 11:47:09 -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 s12-v6sm262953wmc.2.2018.07.04.11.47.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Jul 2018 11:47:09 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, Kamal Heib Subject: [PATCH rdma-next 3/5] RDMA/ipoib: Fix verifying return codes Date: Wed, 4 Jul 2018 21:46:49 +0300 Message-Id: <20180704184651.26728-4-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180704184651.26728-1-kamalheib1@gmail.com> References: <20180704184651.26728-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 7daae5ba033d..8ec6765da531 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; }