aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 24fa87fe0952..6c77df34869d 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2175,14 +2175,14 @@ static struct net_device *ipoib_add_port(const char *format,
2175 priv->dev->dev_id = port - 1; 2175 priv->dev->dev_id = port - 1;
2176 2176
2177 result = ib_query_port(hca, port, &attr); 2177 result = ib_query_port(hca, port, &attr);
2178 if (!result) 2178 if (result) {
2179 priv->max_ib_mtu = ib_mtu_enum_to_int(attr.max_mtu);
2180 else {
2181 printk(KERN_WARNING "%s: ib_query_port %d failed\n", 2179 printk(KERN_WARNING "%s: ib_query_port %d failed\n",
2182 hca->name, port); 2180 hca->name, port);
2183 goto device_init_failed; 2181 goto device_init_failed;
2184 } 2182 }
2185 2183
2184 priv->max_ib_mtu = ib_mtu_enum_to_int(attr.max_mtu);
2185
2186 /* MTU will be reset when mcast join happens */ 2186 /* MTU will be reset when mcast join happens */
2187 priv->dev->mtu = IPOIB_UD_MTU(priv->max_ib_mtu); 2187 priv->dev->mtu = IPOIB_UD_MTU(priv->max_ib_mtu);
2188 priv->mcast_mtu = priv->admin_mtu = priv->dev->mtu; 2188 priv->mcast_mtu = priv->admin_mtu = priv->dev->mtu;
@@ -2213,12 +2213,14 @@ static struct net_device *ipoib_add_port(const char *format,
2213 printk(KERN_WARNING "%s: ib_query_gid port %d failed (ret = %d)\n", 2213 printk(KERN_WARNING "%s: ib_query_gid port %d failed (ret = %d)\n",
2214 hca->name, port, result); 2214 hca->name, port, result);
2215 goto device_init_failed; 2215 goto device_init_failed;
2216 } else 2216 }
2217 memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw, sizeof (union ib_gid)); 2217
2218 memcpy(priv->dev->dev_addr + 4, priv->local_gid.raw,
2219 sizeof(union ib_gid));
2218 set_bit(IPOIB_FLAG_DEV_ADDR_SET, &priv->flags); 2220 set_bit(IPOIB_FLAG_DEV_ADDR_SET, &priv->flags);
2219 2221
2220 result = ipoib_dev_init(priv->dev, hca, port); 2222 result = ipoib_dev_init(priv->dev, hca, port);
2221 if (result < 0) { 2223 if (result) {
2222 printk(KERN_WARNING "%s: failed to initialize port %d (ret = %d)\n", 2224 printk(KERN_WARNING "%s: failed to initialize port %d (ret = %d)\n",
2223 hca->name, port, result); 2225 hca->name, port, result);
2224 goto device_init_failed; 2226 goto device_init_failed;