On 8 Oct 2019, at 11:06, Hans Petter Selasky wrote:

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.

Which basically means that the boolean suggestion I suggested to you in the end isn’t right either as now some parts of the shutdown run without shutdown being set and checking state boundaries was the right thing. Now to know whether it is a startup or a shutdown you probably need both together?


  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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to