Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Oct 2019 11:06:24 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353302 - head/sys/net
Message-ID:  <201910081106.x98B6OBB013578@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Oct  8 11:06:24 2019
New Revision: 353302
URL: https://svnweb.freebsd.org/changeset/base/353302

Log:
  Fix regression issue after r353274:
  
  Make sure the vnet_shutdown field is not set until after all
  VNET_SYSUNINIT()'s in the SI_SUB_VNET_DONE subsystem have been
  executed. Especially the vnet_if_return() functions requires that
  if_move() is still operational.
  
  Reported by:	lwhsu@
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/net/vnet.c

Modified: head/sys/net/vnet.c
==============================================================================
--- head/sys/net/vnet.c	Tue Oct  8 10:50:16 2019	(r353301)
+++ head/sys/net/vnet.c	Tue Oct  8 11:06:24 2019	(r353302)
@@ -279,9 +279,6 @@ vnet_destroy(struct vnet *vnet)
 	LIST_REMOVE(vnet, vnet_le);
 	VNET_LIST_WUNLOCK();
 
-	/* Signal that VNET is being shutdown. */
-	vnet->vnet_shutdown = 1;
-
 	CURVNET_SET_QUIET(vnet);
 	vnet_sysuninit();
 	CURVNET_RESTORE();
@@ -353,15 +350,15 @@ vnet_data_startup(void *dummy __unused)
 }
 SYSINIT(vnet_data, SI_SUB_KLD, SI_ORDER_FIRST, vnet_data_startup, NULL);
 
-/* Dummy VNET_SYSINIT to make sure we always reach the final end state. */
 static void
-vnet_sysinit_done(void *unused __unused)
+vnet_sysuninit_shutdown(void *unused __unused)
 {
 
-	return;
+	/* Signal that VNET is being shutdown. */
+	curvnet->vnet_shutdown = 1;
 }
-VNET_SYSINIT(vnet_sysinit_done, SI_SUB_VNET_DONE, SI_ORDER_ANY,
-    vnet_sysinit_done, NULL);
+VNET_SYSUNINIT(vnet_sysuninit_shutdown, SI_SUB_VNET_DONE, SI_ORDER_FIRST,
+    vnet_sysuninit_shutdown, NULL);
 
 /*
  * When a module is loaded and requires storage for a virtualized global



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