aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorYossi Etigin <yosefe@Voltaire.COM>2009-01-09 17:05:11 -0500
committerRoland Dreier <rolandd@cisco.com>2009-01-09 17:05:11 -0500
commita50df398cddf6b757bdbf30f5f0875982ef5c660 (patch)
treec530f13534c55c589eae41556b119d857df42898 /drivers/infiniband/ulp
parent6a94cb73064c952255336cc57731904174b2c58f (diff)
IPoIB: Fix loss of connectivity after bonding failover on both sides
Fix bonding failover in the case both peers failover and the gratuitous ARP is lost. In that case, the sender side will create an ipoib_neigh and issue a path request with the old GID first. When skb->dst->neighbour->ha changes due to ARP refresh, this ipoib_neigh will not be added to the path->list of the path of the new GID, because the ipoib_neigh already exists. It will not have an AH either, because of sender-side failover. Therefore, it will not get an AH when the path is resolved. The solution here is to compare GIDs in ipoib_start_xmit() even if neigh->ah is invalid. Comparing with an uninitialized value of neigh->dgid should be fine, since a spurious match is harmless (and astronomically unlikely too). Signed-off-by: Moni Shoua <monis@voltaire.com> Signed-off-by: Yossi Etigin <yosefe@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 19e06bc38b39..dce0443f9d69 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -711,26 +711,26 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
711 711
712 neigh = *to_ipoib_neigh(skb->dst->neighbour); 712 neigh = *to_ipoib_neigh(skb->dst->neighbour);
713 713
714 if (neigh->ah) 714 if (unlikely((memcmp(&neigh->dgid.raw,
715 if (unlikely((memcmp(&neigh->dgid.raw, 715 skb->dst->neighbour->ha + 4,
716 skb->dst->neighbour->ha + 4, 716 sizeof(union ib_gid))) ||
717 sizeof(union ib_gid))) || 717 (neigh->dev != dev))) {
718 (neigh->dev != dev))) { 718 spin_lock_irqsave(&priv->lock, flags);
719 spin_lock_irqsave(&priv->lock, flags); 719 /*
720 /* 720 * It's safe to call ipoib_put_ah() inside
721 * It's safe to call ipoib_put_ah() inside 721 * priv->lock here, because we know that
722 * priv->lock here, because we know that 722 * path->ah will always hold one more reference,
723 * path->ah will always hold one more reference, 723 * so ipoib_put_ah() will never do more than
724 * so ipoib_put_ah() will never do more than 724 * decrement the ref count.
725 * decrement the ref count. 725 */
726 */ 726 if (neigh->ah)
727 ipoib_put_ah(neigh->ah); 727 ipoib_put_ah(neigh->ah);
728 list_del(&neigh->list); 728 list_del(&neigh->list);
729 ipoib_neigh_free(dev, neigh); 729 ipoib_neigh_free(dev, neigh);
730 spin_unlock_irqrestore(&priv->lock, flags); 730 spin_unlock_irqrestore(&priv->lock, flags);
731 ipoib_path_lookup(skb, dev); 731 ipoib_path_lookup(skb, dev);
732 return NETDEV_TX_OK; 732 return NETDEV_TX_OK;
733 } 733 }
734 734
735 if (ipoib_cm_get(neigh)) { 735 if (ipoib_cm_get(neigh)) {
736 if (ipoib_cm_up(neigh)) { 736 if (ipoib_cm_up(neigh)) {