IB/core: Fix to avoid deleting IPv6 look alike default GIDs
authorParav Pandit <parav@mellanox.com>
Mon, 23 Apr 2018 13:58:18 +0000 (16:58 +0300)
committerDoug Ledford <dledford@redhat.com>
Mon, 23 Apr 2018 21:28:18 +0000 (17:28 -0400)
commit22c01ee4b8a8c000c490dfc479e175404e64167b
treec1401a2ef285d8b70381b81bf4a187057e7bc3a8
parenta66ed149b0da5b97fa7486ee2bcd00f3f9df5442
IB/core: Fix to avoid deleting IPv6 look alike default GIDs

When IPv6 link local address is removed, if it matches with the default
GID, default GID(s)s gets removed which may not be a desired behavior.
This behavior is introduced by refactor work in Fixes tag.

When IPv6 link address is removed, removing its equivalent RoCEv2 GID
which exactly matches with default RoCEv2 GID, is right thing to do.
However achieving it correctly requires lot more changes, likely in
roce_gid_mgmt.c and core/cache.c. This should be done as independent
patch.

Therefore, this patch preserves behavior of not deleteing default GIDs.
This is done by providing explicit hint to consider default GID property
using mask and default_gid; similar to add_gid().

Fixes: 598ff6bae68 ("IB/core: Refactor GID modify code for RoCE")
Signed-off-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cache.c