svn commit: r341529 - head/sys/ofed/drivers/infiniband/core
Slava Shwartsman
slavash at FreeBSD.org
Wed Dec 5 13:22:44 UTC 2018
Author: slavash
Date: Wed Dec 5 13:22:43 2018
New Revision: 341529
URL: https://svnweb.freebsd.org/changeset/base/341529
Log:
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
Modified:
head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
Modified: head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Wed Dec 5 13:22:07 2018 (r341528)
+++ head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Wed Dec 5 13:22:43 2018 (r341529)
@@ -167,6 +167,7 @@ roce_gid_update_addr_callback(struct ib_device *device
#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
/* 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
}
#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) {
More information about the svn-src-all
mailing list