aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib/ipoib_cm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_cm.c')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 47d588ba2a7f..181b1f32325f 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1394,8 +1394,8 @@ void ipoib_cm_skb_too_long(struct net_device *dev, struct sk_buff *skb,
1394 struct ipoib_dev_priv *priv = netdev_priv(dev); 1394 struct ipoib_dev_priv *priv = netdev_priv(dev);
1395 int e = skb_queue_empty(&priv->cm.skb_queue); 1395 int e = skb_queue_empty(&priv->cm.skb_queue);
1396 1396
1397 if (skb->dst) 1397 if (skb_dst(skb))
1398 skb->dst->ops->update_pmtu(skb->dst, mtu); 1398 skb_dst(skb)->ops->update_pmtu(skb_dst(skb), mtu);
1399 1399
1400 skb_queue_tail(&priv->cm.skb_queue, skb); 1400 skb_queue_tail(&priv->cm.skb_queue, skb);
1401 if (e) 1401 if (e)
@@ -1455,13 +1455,15 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
1455 struct net_device *dev = to_net_dev(d); 1455 struct net_device *dev = to_net_dev(d);
1456 struct ipoib_dev_priv *priv = netdev_priv(dev); 1456 struct ipoib_dev_priv *priv = netdev_priv(dev);
1457 1457
1458 if (!rtnl_trylock())
1459 return restart_syscall();
1460
1458 /* flush paths if we switch modes so that connections are restarted */ 1461 /* flush paths if we switch modes so that connections are restarted */
1459 if (IPOIB_CM_SUPPORTED(dev->dev_addr) && !strcmp(buf, "connected\n")) { 1462 if (IPOIB_CM_SUPPORTED(dev->dev_addr) && !strcmp(buf, "connected\n")) {
1460 set_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); 1463 set_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags);
1461 ipoib_warn(priv, "enabling connected mode " 1464 ipoib_warn(priv, "enabling connected mode "
1462 "will cause multicast packet drops\n"); 1465 "will cause multicast packet drops\n");
1463 1466
1464 rtnl_lock();
1465 dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO); 1467 dev->features &= ~(NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO);
1466 rtnl_unlock(); 1468 rtnl_unlock();
1467 priv->tx_wr.send_flags &= ~IB_SEND_IP_CSUM; 1469 priv->tx_wr.send_flags &= ~IB_SEND_IP_CSUM;
@@ -1473,7 +1475,6 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
1473 if (!strcmp(buf, "datagram\n")) { 1475 if (!strcmp(buf, "datagram\n")) {
1474 clear_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); 1476 clear_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags);
1475 1477
1476 rtnl_lock();
1477 if (test_bit(IPOIB_FLAG_CSUM, &priv->flags)) { 1478 if (test_bit(IPOIB_FLAG_CSUM, &priv->flags)) {
1478 dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; 1479 dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
1479 if (priv->hca_caps & IB_DEVICE_UD_TSO) 1480 if (priv->hca_caps & IB_DEVICE_UD_TSO)
@@ -1485,6 +1486,7 @@ static ssize_t set_mode(struct device *d, struct device_attribute *attr,
1485 1486
1486 return count; 1487 return count;
1487 } 1488 }
1489 rtnl_unlock();
1488 1490
1489 return -EINVAL; 1491 return -EINVAL;
1490} 1492}