aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2018-03-05 12:39:34 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2018-03-05 12:39:34 +0000
commit57b6d9f6efc01f422d18531ce7c2ba4b655256c1 (patch)
tree8515fa3fb9ee3b5f1b79ff6bfe582d44193d7b68 /sys/ofed
parent891538abb58f737bd005594425bb97ae8693e0e7 (diff)
downloadsrc-57b6d9f6efc01f422d18531ce7c2ba4b655256c1.tar.gz
src-57b6d9f6efc01f422d18531ce7c2ba4b655256c1.zip
Make sure to register the VLAN GIDs using the VLAN network interface
and not the parent one in ibcore. Else looking up the VLAN GIDs will fail for VLAN IPs. MFC after: 1 week Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=330501
Diffstat (limited to 'sys/ofed')
-rw-r--r--sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c b/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
index 2e35ffa33d8e..97e3e00712e9 100644
--- a/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
+++ b/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
@@ -169,12 +169,14 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
struct sockaddr_in v4;
struct sockaddr_in6 v6;
} ipx_addr;
+ struct net_device *ndev;
};
struct ipx_entry *entry;
struct net_device *idev;
#if defined(INET) || defined(INET6)
struct ifaddr *ifa;
#endif
+ struct ib_gid_attr gid_attr;
union ib_gid gid;
int default_gids;
u16 index_num;
@@ -211,6 +213,7 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
continue;
}
entry->ipx_addr.v4 = *((struct sockaddr_in *)ifa->ifa_addr);
+ entry->ndev = idev;
STAILQ_INSERT_TAIL(&ipx_head, entry, entry);
}
#endif
@@ -226,6 +229,7 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
continue;
}
entry->ipx_addr.v6 = *((struct sockaddr_in6 *)ifa->ifa_addr);
+ entry->ndev = idev;
/* trash IPv6 scope ID */
sa6_recoverscope(&entry->ipx_addr.v6);
@@ -251,19 +255,25 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
continue;
/* check if entry found */
if (ib_find_cached_gid_by_port(device, &gid, i,
- port, ndev, &index_num) == 0)
+ port, entry->ndev, &index_num) == 0)
break;
}
if (i != IB_GID_TYPE_SIZE)
continue;
/* add new GID */
- update_gid(GID_ADD, device, port, &gid, ndev);
+ update_gid(GID_ADD, device, port, &gid, entry->ndev);
}
/* remove stale GIDs, if any */
- for (i = default_gids; ib_get_cached_gid(device, port, i, &gid, NULL) == 0; i++) {
+ for (i = default_gids; ib_get_cached_gid(device, port, i, &gid, &gid_attr) == 0; i++) {
union ipx_addr ipx;
+ /* check for valid network device pointer */
+ ndev = gid_attr.ndev;
+ if (ndev == NULL)
+ continue;
+ dev_put(ndev);
+
/* don't delete empty entries */
if (memcmp(&gid, &zgid, sizeof(zgid)) == 0)
continue;
@@ -274,7 +284,8 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
rdma_gid2ip(&ipx.sa[0], &gid);
STAILQ_FOREACH(entry, &ipx_head, entry) {
- if (memcmp(&entry->ipx_addr, &ipx, sizeof(ipx)) == 0)
+ if (entry->ndev == ndev &&
+ memcmp(&entry->ipx_addr, &ipx, sizeof(ipx)) == 0)
break;
}
/* check if entry found */