Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2018 10:54:42 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r341872 - stable/11/sys/ofed/drivers/infiniband/core
Message-ID:  <201812121054.wBCAsgLD029540@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Dec 12 10:54:41 2018
New Revision: 341872
URL: https://svnweb.freebsd.org/changeset/base/341872

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.
  
  Submitted by:   netapp
  Sponsored by:   Mellanox Technologies

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

Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c
==============================================================================
--- stable/11/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c	Wed Dec 12 10:49:41 2018	(r341871)
+++ stable/11/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c	Wed Dec 12 10:54:41 2018	(r341872)
@@ -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();
-	TAILQ_FOREACH(idev, &V_ifnet, if_link) {
+	VNET_LIST_RLOCK();
+	VNET_FOREACH(vnet_iter) {
+	    CURVNET_SET(vnet_iter);
+	    IFNET_RLOCK();
+	    TAILQ_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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812121054.wBCAsgLD029540>