From: Roland Dreier <rdreier@cisco.com>
To: Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, general@lists.openfabrics.org,
Christoph Raisch <RAISCH@de.ibm.com>
Subject: Re: [ofa-general] [PATCH] IB/ipoib: Fix undefined symbol (priv->cm) if ipoib_cm disabled
Date: Wed, 16 Jan 2008 13:22:07 -0800 [thread overview]
Message-ID: <adair1tzcsg.fsf@cisco.com> (raw)
In-Reply-To: <200801161444.35365.hnguyen@linux.vnet.ibm.com> (Hoang-Nam Nguyen's message of "Wed, 16 Jan 2008 14:44:35 +0100")
Thanks a lot for pointing this out! I rolled the following into the
offending patch in my tree instead (I preferred avoiding #ifdefs in .c
files...)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index 545c5a3..fe250c6 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -505,6 +505,12 @@ static inline int ipoib_cm_has_srq(struct net_device *dev)
return !!priv->cm.srq;
}
+static inline unsigned int ipoib_cm_max_mtu(struct net_device *dev)
+{
+ struct ipoib_dev_priv *priv = netdev_priv(dev);
+ return priv->cm.max_cm_mtu;
+}
+
void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_tx *tx);
int ipoib_cm_dev_open(struct net_device *dev);
void ipoib_cm_dev_stop(struct net_device *dev);
@@ -554,6 +560,11 @@ static inline int ipoib_cm_has_srq(struct net_device *dev)
return 0;
}
+static inline unsigned int ipoib_cm_max_mtu(struct net_device *dev)
+{
+ return 0;
+}
+
static inline
void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_tx *tx)
{
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index e499626..d733045 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -183,7 +183,7 @@ static int ipoib_change_mtu(struct net_device *dev, int new_mtu)
/* dev->mtu > 2K ==> connected mode */
if (ipoib_cm_admin_enabled(dev)) {
- if (new_mtu > priv->cm.max_cm_mtu)
+ if (new_mtu > ipoib_cm_max_mtu(dev))
return -EINVAL;
if (new_mtu > priv->mcast_mtu)
prev parent reply other threads:[~2008-01-16 21:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-16 13:44 [PATCH] IB/ipoib: Fix undefined symbol (priv->cm) if ipoib_cm disabled Hoang-Nam Nguyen
2008-01-16 21:22 ` Roland Dreier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=adair1tzcsg.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=RAISCH@de.ibm.com \
--cc=general@lists.openfabrics.org \
--cc=hnguyen@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox