diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_cm.c | 10 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 31 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 10 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 6 |
4 files changed, 31 insertions, 26 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 | } |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index ab2c192c76bc..e319d91f60a6 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -561,7 +561,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev) | |||
561 | struct ipoib_neigh *neigh; | 561 | struct ipoib_neigh *neigh; |
562 | unsigned long flags; | 562 | unsigned long flags; |
563 | 563 | ||
564 | neigh = ipoib_neigh_alloc(skb->dst->neighbour, skb->dev); | 564 | neigh = ipoib_neigh_alloc(skb_dst(skb)->neighbour, skb->dev); |
565 | if (!neigh) { | 565 | if (!neigh) { |
566 | ++dev->stats.tx_dropped; | 566 | ++dev->stats.tx_dropped; |
567 | dev_kfree_skb_any(skb); | 567 | dev_kfree_skb_any(skb); |
@@ -570,9 +570,9 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev) | |||
570 | 570 | ||
571 | spin_lock_irqsave(&priv->lock, flags); | 571 | spin_lock_irqsave(&priv->lock, flags); |
572 | 572 | ||
573 | path = __path_find(dev, skb->dst->neighbour->ha + 4); | 573 | path = __path_find(dev, skb_dst(skb)->neighbour->ha + 4); |
574 | if (!path) { | 574 | if (!path) { |
575 | path = path_rec_create(dev, skb->dst->neighbour->ha + 4); | 575 | path = path_rec_create(dev, skb_dst(skb)->neighbour->ha + 4); |
576 | if (!path) | 576 | if (!path) |
577 | goto err_path; | 577 | goto err_path; |
578 | 578 | ||
@@ -605,7 +605,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev) | |||
605 | goto err_drop; | 605 | goto err_drop; |
606 | } | 606 | } |
607 | } else | 607 | } else |
608 | ipoib_send(dev, skb, path->ah, IPOIB_QPN(skb->dst->neighbour->ha)); | 608 | ipoib_send(dev, skb, path->ah, IPOIB_QPN(skb_dst(skb)->neighbour->ha)); |
609 | } else { | 609 | } else { |
610 | neigh->ah = NULL; | 610 | neigh->ah = NULL; |
611 | 611 | ||
@@ -635,15 +635,15 @@ static void ipoib_path_lookup(struct sk_buff *skb, struct net_device *dev) | |||
635 | struct ipoib_dev_priv *priv = netdev_priv(skb->dev); | 635 | struct ipoib_dev_priv *priv = netdev_priv(skb->dev); |
636 | 636 | ||
637 | /* Look up path record for unicasts */ | 637 | /* Look up path record for unicasts */ |
638 | if (skb->dst->neighbour->ha[4] != 0xff) { | 638 | if (skb_dst(skb)->neighbour->ha[4] != 0xff) { |
639 | neigh_add_path(skb, dev); | 639 | neigh_add_path(skb, dev); |
640 | return; | 640 | return; |
641 | } | 641 | } |
642 | 642 | ||
643 | /* Add in the P_Key for multicasts */ | 643 | /* Add in the P_Key for multicasts */ |
644 | skb->dst->neighbour->ha[8] = (priv->pkey >> 8) & 0xff; | 644 | skb_dst(skb)->neighbour->ha[8] = (priv->pkey >> 8) & 0xff; |
645 | skb->dst->neighbour->ha[9] = priv->pkey & 0xff; | 645 | skb_dst(skb)->neighbour->ha[9] = priv->pkey & 0xff; |
646 | ipoib_mcast_send(dev, skb->dst->neighbour->ha + 4, skb); | 646 | ipoib_mcast_send(dev, skb_dst(skb)->neighbour->ha + 4, skb); |
647 | } | 647 | } |
648 | 648 | ||
649 | static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, | 649 | static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, |
@@ -708,16 +708,16 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
708 | struct ipoib_neigh *neigh; | 708 | struct ipoib_neigh *neigh; |
709 | unsigned long flags; | 709 | unsigned long flags; |
710 | 710 | ||
711 | if (likely(skb->dst && skb->dst->neighbour)) { | 711 | if (likely(skb_dst(skb) && skb_dst(skb)->neighbour)) { |
712 | if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) { | 712 | if (unlikely(!*to_ipoib_neigh(skb_dst(skb)->neighbour))) { |
713 | ipoib_path_lookup(skb, dev); | 713 | ipoib_path_lookup(skb, dev); |
714 | return NETDEV_TX_OK; | 714 | return NETDEV_TX_OK; |
715 | } | 715 | } |
716 | 716 | ||
717 | neigh = *to_ipoib_neigh(skb->dst->neighbour); | 717 | neigh = *to_ipoib_neigh(skb_dst(skb)->neighbour); |
718 | 718 | ||
719 | if (unlikely((memcmp(&neigh->dgid.raw, | 719 | if (unlikely((memcmp(&neigh->dgid.raw, |
720 | skb->dst->neighbour->ha + 4, | 720 | skb_dst(skb)->neighbour->ha + 4, |
721 | sizeof(union ib_gid))) || | 721 | sizeof(union ib_gid))) || |
722 | (neigh->dev != dev))) { | 722 | (neigh->dev != dev))) { |
723 | spin_lock_irqsave(&priv->lock, flags); | 723 | spin_lock_irqsave(&priv->lock, flags); |
@@ -743,7 +743,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
743 | return NETDEV_TX_OK; | 743 | return NETDEV_TX_OK; |
744 | } | 744 | } |
745 | } else if (neigh->ah) { | 745 | } else if (neigh->ah) { |
746 | ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(skb->dst->neighbour->ha)); | 746 | ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(skb_dst(skb)->neighbour->ha)); |
747 | return NETDEV_TX_OK; | 747 | return NETDEV_TX_OK; |
748 | } | 748 | } |
749 | 749 | ||
@@ -772,7 +772,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
772 | if ((be16_to_cpup((__be16 *) skb->data) != ETH_P_ARP) && | 772 | if ((be16_to_cpup((__be16 *) skb->data) != ETH_P_ARP) && |
773 | (be16_to_cpup((__be16 *) skb->data) != ETH_P_RARP)) { | 773 | (be16_to_cpup((__be16 *) skb->data) != ETH_P_RARP)) { |
774 | ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n", | 774 | ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n", |
775 | skb->dst ? "neigh" : "dst", | 775 | skb_dst(skb) ? "neigh" : "dst", |
776 | be16_to_cpup((__be16 *) skb->data), | 776 | be16_to_cpup((__be16 *) skb->data), |
777 | IPOIB_QPN(phdr->hwaddr), | 777 | IPOIB_QPN(phdr->hwaddr), |
778 | phdr->hwaddr + 4); | 778 | phdr->hwaddr + 4); |
@@ -817,7 +817,7 @@ static int ipoib_hard_header(struct sk_buff *skb, | |||
817 | * destination address onto the front of the skb so we can | 817 | * destination address onto the front of the skb so we can |
818 | * figure out where to send the packet later. | 818 | * figure out where to send the packet later. |
819 | */ | 819 | */ |
820 | if ((!skb->dst || !skb->dst->neighbour) && daddr) { | 820 | if ((!skb_dst(skb) || !skb_dst(skb)->neighbour) && daddr) { |
821 | struct ipoib_pseudoheader *phdr = | 821 | struct ipoib_pseudoheader *phdr = |
822 | (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr); | 822 | (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr); |
823 | memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN); | 823 | memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN); |
@@ -1053,6 +1053,7 @@ static void ipoib_setup(struct net_device *dev) | |||
1053 | dev->tx_queue_len = ipoib_sendq_size * 2; | 1053 | dev->tx_queue_len = ipoib_sendq_size * 2; |
1054 | dev->features = (NETIF_F_VLAN_CHALLENGED | | 1054 | dev->features = (NETIF_F_VLAN_CHALLENGED | |
1055 | NETIF_F_HIGHDMA); | 1055 | NETIF_F_HIGHDMA); |
1056 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | ||
1056 | 1057 | ||
1057 | memcpy(dev->broadcast, ipv4_bcast_addr, INFINIBAND_ALEN); | 1058 | memcpy(dev->broadcast, ipv4_bcast_addr, INFINIBAND_ALEN); |
1058 | 1059 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 425e31112ed7..a0e97532e714 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -261,7 +261,7 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast, | |||
261 | 261 | ||
262 | skb->dev = dev; | 262 | skb->dev = dev; |
263 | 263 | ||
264 | if (!skb->dst || !skb->dst->neighbour) { | 264 | if (!skb_dst(skb) || !skb_dst(skb)->neighbour) { |
265 | /* put pseudoheader back on for next time */ | 265 | /* put pseudoheader back on for next time */ |
266 | skb_push(skb, sizeof (struct ipoib_pseudoheader)); | 266 | skb_push(skb, sizeof (struct ipoib_pseudoheader)); |
267 | } | 267 | } |
@@ -707,10 +707,10 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb) | |||
707 | 707 | ||
708 | out: | 708 | out: |
709 | if (mcast && mcast->ah) { | 709 | if (mcast && mcast->ah) { |
710 | if (skb->dst && | 710 | if (skb_dst(skb) && |
711 | skb->dst->neighbour && | 711 | skb_dst(skb)->neighbour && |
712 | !*to_ipoib_neigh(skb->dst->neighbour)) { | 712 | !*to_ipoib_neigh(skb_dst(skb)->neighbour)) { |
713 | struct ipoib_neigh *neigh = ipoib_neigh_alloc(skb->dst->neighbour, | 713 | struct ipoib_neigh *neigh = ipoib_neigh_alloc(skb_dst(skb)->neighbour, |
714 | skb->dev); | 714 | skb->dev); |
715 | 715 | ||
716 | if (neigh) { | 716 | if (neigh) { |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c index 4c57f329dd50..e3bf00d8cd25 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c | |||
@@ -61,7 +61,8 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) | |||
61 | 61 | ||
62 | ppriv = netdev_priv(pdev); | 62 | ppriv = netdev_priv(pdev); |
63 | 63 | ||
64 | rtnl_lock(); | 64 | if (!rtnl_trylock()) |
65 | return restart_syscall(); | ||
65 | mutex_lock(&ppriv->vlan_mutex); | 66 | mutex_lock(&ppriv->vlan_mutex); |
66 | 67 | ||
67 | /* | 68 | /* |
@@ -167,7 +168,8 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) | |||
167 | 168 | ||
168 | ppriv = netdev_priv(pdev); | 169 | ppriv = netdev_priv(pdev); |
169 | 170 | ||
170 | rtnl_lock(); | 171 | if (!rtnl_trylock()) |
172 | return restart_syscall(); | ||
171 | mutex_lock(&ppriv->vlan_mutex); | 173 | mutex_lock(&ppriv->vlan_mutex); |
172 | list_for_each_entry_safe(priv, tpriv, &ppriv->child_intfs, list) { | 174 | list_for_each_entry_safe(priv, tpriv, &ppriv->child_intfs, list) { |
173 | if (priv->pkey == pkey) { | 175 | if (priv->pkey == pkey) { |