IPoIB: Handle bonding failover race for connected neighbours too

Move up the code that checks for a situation where the remote GID
stored in the ipoib_neigh is different than the one present in the
neighbour (handle gratuitous ARP) or that a bonding fail over has
happened but the neighbour still has a pointer to an ipoib_neigh
created by a different device than the current slave. This will cause
the driver to apply the check also for connected mode neighbours.

Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by Or Gerlitz and committed by Roland Dreier bafff974 0d89fe2c

+7 -6
+7 -6
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 680 681 neigh = *to_ipoib_neigh(skb->dst->neighbour); 682 683 - if (ipoib_cm_get(neigh)) { 684 - if (ipoib_cm_up(neigh)) { 685 - ipoib_cm_send(dev, skb, ipoib_cm_get(neigh)); 686 - goto out; 687 - } 688 - } else if (neigh->ah) { 689 if (unlikely((memcmp(&neigh->dgid.raw, 690 skb->dst->neighbour->ha + 4, 691 sizeof(union ib_gid))) || ··· 701 goto out; 702 } 703 704 ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(skb->dst->neighbour->ha)); 705 goto out; 706 }
··· 680 681 neigh = *to_ipoib_neigh(skb->dst->neighbour); 682 683 + if (neigh->ah) 684 if (unlikely((memcmp(&neigh->dgid.raw, 685 skb->dst->neighbour->ha + 4, 686 sizeof(union ib_gid))) || ··· 706 goto out; 707 } 708 709 + if (ipoib_cm_get(neigh)) { 710 + if (ipoib_cm_up(neigh)) { 711 + ipoib_cm_send(dev, skb, ipoib_cm_get(neigh)); 712 + goto out; 713 + } 714 + } else if (neigh->ah) { 715 ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(skb->dst->neighbour->ha)); 716 goto out; 717 }