net: replace %p6 with %pI6
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / infiniband / ulp / ipoib / ipoib_main.c
index c0ee514396dfa7a18842d0503d2c01641661d261..b3a671895bdc52dbfa2f17cfd2ff56dc22f6b048 100644 (file)
@@ -359,9 +359,9 @@ void ipoib_mark_paths_invalid(struct net_device *dev)
        spin_lock_irq(&priv->lock);
 
        list_for_each_entry_safe(path, tp, &priv->path_list, list) {
-               ipoib_dbg(priv, "mark path LID 0x%04x GID " IPOIB_GID_FMT " invalid\n",
+               ipoib_dbg(priv, "mark path LID 0x%04x GID %pI6 invalid\n",
                        be16_to_cpu(path->pathrec.dlid),
-                       IPOIB_GID_ARG(path->pathrec.dgid));
+                       path->pathrec.dgid.raw);
                path->valid =  0;
        }
 
@@ -413,11 +413,11 @@ static void path_rec_completion(int status,
        unsigned long flags;
 
        if (!status)
-               ipoib_dbg(priv, "PathRec LID 0x%04x for GID " IPOIB_GID_FMT "\n",
-                         be16_to_cpu(pathrec->dlid), IPOIB_GID_ARG(pathrec->dgid));
+               ipoib_dbg(priv, "PathRec LID 0x%04x for GID %pI6\n",
+                         be16_to_cpu(pathrec->dlid), pathrec->dgid.raw);
        else
-               ipoib_dbg(priv, "PathRec status %d for GID " IPOIB_GID_FMT "\n",
-                         status, IPOIB_GID_ARG(path->pathrec.dgid));
+               ipoib_dbg(priv, "PathRec status %d for GID %pI6\n",
+                         status, path->pathrec.dgid.raw);
 
        skb_queue_head_init(&skqueue);
 
@@ -527,8 +527,8 @@ static int path_rec_start(struct net_device *dev,
 {
        struct ipoib_dev_priv *priv = netdev_priv(dev);
 
-       ipoib_dbg(priv, "Start path record lookup for " IPOIB_GID_FMT "\n",
-                 IPOIB_GID_ARG(path->pathrec.dgid));
+       ipoib_dbg(priv, "Start path record lookup for %pI6\n",
+                 path->pathrec.dgid.raw);
 
        init_completion(&path->done);
 
@@ -764,12 +764,11 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
                        if ((be16_to_cpup((__be16 *) skb->data) != ETH_P_ARP) &&
                            (be16_to_cpup((__be16 *) skb->data) != ETH_P_RARP)) {
-                               ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x "
-                                          IPOIB_GID_FMT "\n",
+                               ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n",
                                           skb->dst ? "neigh" : "dst",
                                           be16_to_cpup((__be16 *) skb->data),
                                           IPOIB_QPN(phdr->hwaddr),
-                                          IPOIB_GID_RAW_ARG(phdr->hwaddr + 4));
+                                          phdr->hwaddr + 4);
                                dev_kfree_skb_any(skb);
                                ++dev->stats.tx_dropped;
                                return NETDEV_TX_OK;
@@ -845,9 +844,9 @@ static void ipoib_neigh_cleanup(struct neighbour *n)
        else
                return;
        ipoib_dbg(priv,
-                 "neigh_cleanup for %06x " IPOIB_GID_FMT "\n",
+                 "neigh_cleanup for %06x %pI6\n",
                  IPOIB_QPN(n->ha),
-                 IPOIB_GID_RAW_ARG(n->ha + 4));
+                 n->ha + 4);
 
        spin_lock_irqsave(&priv->lock, flags);
 
@@ -1173,11 +1172,48 @@ int ipoib_add_pkey_attr(struct net_device *dev)
        return device_create_file(&dev->dev, &dev_attr_pkey);
 }
 
+int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca)
+{
+       struct ib_device_attr *device_attr;
+       int result = -ENOMEM;
+
+       device_attr = kmalloc(sizeof *device_attr, GFP_KERNEL);
+       if (!device_attr) {
+               printk(KERN_WARNING "%s: allocation of %zu bytes failed\n",
+                      hca->name, sizeof *device_attr);
+               return result;
+       }
+
+       result = ib_query_device(hca, device_attr);
+       if (result) {
+               printk(KERN_WARNING "%s: ib_query_device failed (ret = %d)\n",
+                      hca->name, result);
+               kfree(device_attr);
+               return result;
+       }
+       priv->hca_caps = device_attr->device_cap_flags;
+
+       kfree(device_attr);
+
+       if (priv->hca_caps & IB_DEVICE_UD_IP_CSUM) {
+               set_bit(IPOIB_FLAG_CSUM, &priv->flags);
+               priv->dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
+       }
+
+       if (lro)
+               priv->dev->features |= NETIF_F_LRO;
+
+       if (priv->dev->features & NETIF_F_SG && priv->hca_caps & IB_DEVICE_UD_TSO)
+               priv->dev->features |= NETIF_F_TSO;
+
+       return 0;
+}
+
+
 static struct net_device *ipoib_add_port(const char *format,
                                         struct ib_device *hca, u8 port)
 {
        struct ipoib_dev_priv *priv;
-       struct ib_device_attr *device_attr;
        struct ib_port_attr attr;
        int result = -ENOMEM;
 
@@ -1206,31 +1242,8 @@ static struct net_device *ipoib_add_port(const char *format,
                goto device_init_failed;
        }
 
-       device_attr = kmalloc(sizeof *device_attr, GFP_KERNEL);
-       if (!device_attr) {
-               printk(KERN_WARNING "%s: allocation of %zu bytes failed\n",
-                      hca->name, sizeof *device_attr);
+       if (ipoib_set_dev_features(priv, hca))
                goto device_init_failed;
-       }
-
-       result = ib_query_device(hca, device_attr);
-       if (result) {
-               printk(KERN_WARNING "%s: ib_query_device failed (ret = %d)\n",
-                      hca->name, result);
-               kfree(device_attr);
-               goto device_init_failed;
-       }
-       priv->hca_caps = device_attr->device_cap_flags;
-
-       kfree(device_attr);
-
-       if (priv->hca_caps & IB_DEVICE_UD_IP_CSUM) {
-               set_bit(IPOIB_FLAG_CSUM, &priv->flags);
-               priv->dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
-       }
-
-       if (lro)
-               priv->dev->features |= NETIF_F_LRO;
 
        /*
         * Set the full membership bit, so that we join the right
@@ -1266,9 +1279,6 @@ static struct net_device *ipoib_add_port(const char *format,
                goto event_failed;
        }
 
-       if (priv->dev->features & NETIF_F_SG && priv->hca_caps & IB_DEVICE_UD_TSO)
-               priv->dev->features |= NETIF_F_TSO;
-
        result = register_netdev(priv->dev);
        if (result) {
                printk(KERN_WARNING "%s: couldn't register ipoib port %d; error %d\n",