From patchwork Wed Oct 3 04:33:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 1540241 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5FB3FDF283 for ; Wed, 3 Oct 2012 04:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750940Ab2JCEdK (ORCPT ); Wed, 3 Oct 2012 00:33:10 -0400 Received: from na3sys010aog107.obsmtp.com ([74.125.245.82]:58932 "HELO na3sys010aog107.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750905Ab2JCEdI (ORCPT ); Wed, 3 Oct 2012 00:33:08 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]) (using TLSv1) by na3sys010aob107.postini.com ([74.125.244.12]) with SMTP ID DSNKUGvAAqr0wIFZ0Oi8XZErNzQot8YQF7i1@postini.com; Tue, 02 Oct 2012 21:33:07 PDT Received: by padhz1 with SMTP id hz1so5921233pad.19 for ; Tue, 02 Oct 2012 21:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=llEBwQqUFOZSkpuuZZ3ZCF0qA4q3F2gH4wA2QGOgfKE=; b=kkUMn0X1+2zhzp0dcZ4LgHiaUH9CrauqE5b2B0hhsvuuHcaJC+XS3tEHOdrB4Zg4iN rBXRgv/IjmeF8akjf3+4sfHecc+hikcYpiTHza3U5oo1wuQIGTjCqgAwGO1IKOCELEq8 nB2NqYTiVico47yEv7KrOmj1aIGe2BU/YIVT8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=llEBwQqUFOZSkpuuZZ3ZCF0qA4q3F2gH4wA2QGOgfKE=; b=bIzw8bU/Rb0lAHe0lH5nfbZlxIuLN39cvEinPoz5X7LwUEJOSaAZcgqLeHuudECZ3g g+xFLE8orqLSv6KGkYltdeQxWr/opNRZP149/Ye2g6JUReAT1o2hP3HzzDY14c2pOJq3 eRQNcR4QM0BxyQ1FR1f+kw2JAx5g81fHO9cpqwzBishMgUu1yvIATNXVVaStlzDuzWbQ wyQ96giHQmoyxVqN3SNV1QoP5VEAShp+5cXcHRLp3ZXIjuc0xnEX303hU1c33ghLRjLA OUAESC6LtatyEVZELAxr78Evr1hbZhj6oa87y392BX9qfi6ArJGx+ZrxJJWW7sx+cR/R 5SAg== Received: by 10.68.212.131 with SMTP id nk3mr9834544pbc.109.1349238786451; Tue, 02 Oct 2012 21:33:06 -0700 (PDT) Received: from roland-t410s.home.digitalvampire.org (c-69-181-166-205.hsd1.ca.comcast.net. [69.181.166.205]) by mx.google.com with ESMTPS id l6sm1817345pav.12.2012.10.02.21.33.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 02 Oct 2012 21:33:05 -0700 (PDT) From: Roland Dreier To: linux-rdma@vger.kernel.org Cc: Stephen Rothwell , Randy Dunlap , Or Gerlitz , "David S. Miller" Subject: Re: linux-next: Tree for Oct 2 (ipoib_netlink.c) Date: Tue, 2 Oct 2012 21:33:00 -0700 Message-Id: <1349238780-27850-1-git-send-email-roland@kernel.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <10635.1349221831@neuling.org> References: <10635.1349221831@neuling.org> X-Gm-Message-State: ALoCoQnJPzWAK8DD4jXDsfZNzgOJtTVRfg2bU8NHAhLFRDsV7vMCOE+DZIGelNb0/C23uw9WRCp/ Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Roland Dreier I'll be sending the following to Linus shortly: [PATCH] IPoIB: Fix build with CONFIG_INFINIBAND_IPOIB_CM=n With the new netlink support in commit 862096a8bbf8 ("IB/ipoib: Add more rtnl_link_ops callbacks") we need ipoib_set_mode() to be available even if connected mode isn't built. Move the function from ipoib_cm.c to ipoib_main.c (and make a few CM-related macros available unconditonally). This fixes the build error drivers/built-in.o: In function 'ipoib_changelink': ipoib_netlink.c:(.text+0x6a5fc9): undefined reference to 'ipoib_set_mode' ipoib_netlink.c:(.text+0x6a5fe3): undefined reference to 'ipoib_set_mode' when CONFIG_INFINIBAND_IPOIB_CM isn't set. Reported-by: Randy Dunlap Reported-by: Stephen Rothwell Signed-off-by: Roland Dreier --- drivers/infiniband/ulp/ipoib/ipoib.h | 4 ++-- drivers/infiniband/ulp/ipoib/ipoib_cm.c | 31 ----------------------------- drivers/infiniband/ulp/ipoib/ipoib_main.c | 31 +++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 196eb52..07ca6fd 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h @@ -535,14 +535,14 @@ void ipoib_drain_cq(struct net_device *dev); void ipoib_set_ethtool_ops(struct net_device *dev); int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca); -#ifdef CONFIG_INFINIBAND_IPOIB_CM - #define IPOIB_FLAGS_RC 0x80 #define IPOIB_FLAGS_UC 0x40 /* We don't support UC connections at the moment */ #define IPOIB_CM_SUPPORTED(ha) (ha[0] & (IPOIB_FLAGS_RC)) +#ifdef CONFIG_INFINIBAND_IPOIB_CM + extern int ipoib_max_conn_qp; static inline int ipoib_cm_admin_enabled(struct net_device *dev) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 175581c..72ae63f 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c @@ -1448,37 +1448,6 @@ static ssize_t show_mode(struct device *d, struct device_attribute *attr, return sprintf(buf, "datagram\n"); } -int ipoib_set_mode(struct net_device *dev, const char *buf) -{ - struct ipoib_dev_priv *priv = netdev_priv(dev); - - /* flush paths if we switch modes so that connections are restarted */ - if (IPOIB_CM_SUPPORTED(dev->dev_addr) && !strcmp(buf, "connected\n")) { - set_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); - ipoib_warn(priv, "enabling connected mode " - "will cause multicast packet drops\n"); - netdev_update_features(dev); - rtnl_unlock(); - priv->tx_wr.send_flags &= ~IB_SEND_IP_CSUM; - - ipoib_flush_paths(dev); - rtnl_lock(); - return 0; - } - - if (!strcmp(buf, "datagram\n")) { - clear_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); - netdev_update_features(dev); - dev_set_mtu(dev, min(priv->mcast_mtu, dev->mtu)); - rtnl_unlock(); - ipoib_flush_paths(dev); - rtnl_lock(); - return 0; - } - - return -EINVAL; -} - static ssize_t set_mode(struct device *d, struct device_attribute *attr, const char *buf, size_t count) { diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index d576c7a..6fdc9e7 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -215,6 +215,37 @@ static int ipoib_change_mtu(struct net_device *dev, int new_mtu) return 0; } +int ipoib_set_mode(struct net_device *dev, const char *buf) +{ + struct ipoib_dev_priv *priv = netdev_priv(dev); + + /* flush paths if we switch modes so that connections are restarted */ + if (IPOIB_CM_SUPPORTED(dev->dev_addr) && !strcmp(buf, "connected\n")) { + set_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); + ipoib_warn(priv, "enabling connected mode " + "will cause multicast packet drops\n"); + netdev_update_features(dev); + rtnl_unlock(); + priv->tx_wr.send_flags &= ~IB_SEND_IP_CSUM; + + ipoib_flush_paths(dev); + rtnl_lock(); + return 0; + } + + if (!strcmp(buf, "datagram\n")) { + clear_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); + netdev_update_features(dev); + dev_set_mtu(dev, min(priv->mcast_mtu, dev->mtu)); + rtnl_unlock(); + ipoib_flush_paths(dev); + rtnl_lock(); + return 0; + } + + return -EINVAL; +} + static struct ipoib_path *__path_find(struct net_device *dev, void *gid) { struct ipoib_dev_priv *priv = netdev_priv(dev);