* [PATCH] IB/ipoib: Fix undefined symbol (priv->cm) if ipoib_cm disabled
@ 2008-01-16 13:44 Hoang-Nam Nguyen
2008-01-16 21:22 ` [ofa-general] " Roland Dreier
0 siblings, 1 reply; 2+ messages in thread
From: Hoang-Nam Nguyen @ 2008-01-16 13:44 UTC (permalink / raw)
To: Roland Dreier, linux-kernel, general; +Cc: Christoph Raisch
Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
---
drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index e499626..0a58ac4 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -181,6 +181,7 @@ static int ipoib_change_mtu(struct net_device *dev, int new_mtu)
{
struct ipoib_dev_priv *priv = netdev_priv(dev);
+#ifdef CONFIG_INFINIBAND_IPOIB_CM
/* dev->mtu > 2K ==> connected mode */
if (ipoib_cm_admin_enabled(dev)) {
if (new_mtu > priv->cm.max_cm_mtu)
@@ -193,6 +194,7 @@ static int ipoib_change_mtu(struct net_device *dev, int new_mtu)
dev->mtu = new_mtu;
return 0;
}
+#endif
if (new_mtu > IPOIB_PACKET_SIZE - IPOIB_ENCAP_LEN)
return -EINVAL;
--
1.5.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [ofa-general] [PATCH] IB/ipoib: Fix undefined symbol (priv->cm) if ipoib_cm disabled
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
0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2008-01-16 21:22 UTC (permalink / raw)
To: Hoang-Nam Nguyen; +Cc: linux-kernel, general, Christoph Raisch
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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-16 21:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [ofa-general] " Roland Dreier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).