lkml.org 
[lkml]   [2008]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectRe: [ofa-general] [PATCH] IB/ipoib: Fix undefined symbol (priv->cm) if ipoib_cm disabled
    From
    Date
    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)

    \
     
     \ /
      Last update: 2008-01-16 22:25    [W:0.043 / U:33.612 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site