svn commit: r341871 - stable/12/sys/ofed/drivers/infiniband/core

Hans Petter Selasky hselasky at FreeBSD.org
Wed Dec 12 10:49:42 UTC 2018


Author: hselasky
Date: Wed Dec 12 10:49:41 2018
New Revision: 341871
URL: https://svnweb.freebsd.org/changeset/base/341871

Log:
  MFC r341529:
  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.
  
  Sponsored by:   Mellanox Technologies

Modified:
  stable/12/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
==============================================================================
--- stable/12/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c	Wed Dec 12 10:34:10 2018	(r341870)
+++ stable/12/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c	Wed Dec 12 10:49:41 2018	(r341871)
@@ -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