summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2014-08-21 14:28:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-05 14:52:22 -0700
commitcb264bf0c428cb776a364a7f75122a6d40cbb7bd (patch)
treea85c65ec519f4b9912f9f058fe85cb5094c66bfa /drivers
parent3554cf91ce37c3d6e6ac3ad5f89a65a41c3852af (diff)
downloadlinux-stable-cb264bf0c428cb776a364a7f75122a6d40cbb7bd.tar.gz
linux-stable-cb264bf0c428cb776a364a7f75122a6d40cbb7bd.tar.bz2
linux-stable-cb264bf0c428cb776a364a7f75122a6d40cbb7bd.zip
IB/mlx4: Don't duplicate the default RoCE GID
commit f5c4834d9328c4ed9fe5dcbec6128d6da16db69a upstream. When reading the IPv6 addresses from the net-device, make sure to avoid adding a duplicate entry to the GID table because of equality between the default GID we generate and the default IPv6 link-local address of the device. Fixes: acc4fccf4eff ("IB/mlx4: Make sure GID index 0 is always occupied") Signed-off-by: Moni Shoua <monis@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/mlx4/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 22226a2354de..11f0606792bb 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1622,6 +1622,7 @@ static void mlx4_ib_get_dev_addr(struct net_device *dev,
struct inet6_dev *in6_dev;
union ib_gid *pgid;
struct inet6_ifaddr *ifp;
+ union ib_gid default_gid;
#endif
union ib_gid gid;
@@ -1642,12 +1643,15 @@ static void mlx4_ib_get_dev_addr(struct net_device *dev,
in_dev_put(in_dev);
}
#if IS_ENABLED(CONFIG_IPV6)
+ mlx4_make_default_gid(dev, &default_gid);
/* IPv6 gids */
in6_dev = in6_dev_get(dev);
if (in6_dev) {
read_lock_bh(&in6_dev->lock);
list_for_each_entry(ifp, &in6_dev->addr_list, if_list) {
pgid = (union ib_gid *)&ifp->addr;
+ if (!memcmp(pgid, &default_gid, sizeof(*pgid)))
+ continue;
update_gid_table(ibdev, port, pgid, 0, 0);
}
read_unlock_bh(&in6_dev->lock);