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
This commit is contained in:
Slava Shwartsman 2018-12-05 13:22:43 +00:00
parent af60974508
commit f3cf3b7e84

View File

@ -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) {