aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Shwartsman <slavash@FreeBSD.org>2018-12-05 13:22:43 +0000
committerSlava Shwartsman <slavash@FreeBSD.org>2018-12-05 13:22:43 +0000
commitf3cf3b7e8420c638516ee236e09d19b6427653fa (patch)
tree7983ef8f1fd95ca8e5069e52d310c075c9b5c05e
parentaf6097450891e8b42e3a1efc88c81ce5ec6271a8 (diff)
downloadsrc-f3cf3b7e8420c638516ee236e09d19b6427653fa.tar.gz
src-f3cf3b7e8420c638516ee236e09d19b6427653fa.zip
ibcore: Make sure all VNETs are scanned for VLAN interfaces.
The master network interface and the VLANs may reside in different VNETs. Make sure that all VNETs are searched when scanning for GID entries. Submitted by: netapp Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=341529
-rw-r--r--sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c15
1 files changed, 10 insertions, 5 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 1dae52bac08a..8bdd7aed1ea3 100644
--- a/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
+++ b/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
@@ -167,6 +167,7 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
#if defined(INET) || defined(INET6)
struct ifaddr *ifa;
#endif
+ VNET_ITERATOR_DECL(vnet_iter);
struct ib_gid_attr gid_attr;
union ib_gid gid;
int default_gids;
@@ -180,9 +181,11 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
/* make sure default GIDs are in */
default_gids = roce_gid_enum_netdev_default(device, port, ndev);
- CURVNET_SET(ndev->if_vnet);
- IFNET_RLOCK();
- CK_STAILQ_FOREACH(idev, &V_ifnet, if_link) {
+ VNET_LIST_RLOCK();
+ VNET_FOREACH(vnet_iter) {
+ CURVNET_SET(vnet_iter);
+ IFNET_RLOCK();
+ CK_STAILQ_FOREACH(idev, &V_ifnet, if_link) {
if (idev != ndev) {
if (idev->if_type != IFT_L2VLAN)
continue;
@@ -230,9 +233,11 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
}
#endif
IF_ADDR_RUNLOCK(idev);
+ }
+ IFNET_RUNLOCK();
+ CURVNET_RESTORE();
}
- IFNET_RUNLOCK();
- CURVNET_RESTORE();
+ VNET_LIST_RUNLOCK();
/* add missing GIDs, if any */
STAILQ_FOREACH(entry, &ipx_head, entry) {