Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Oct 2019 12:53:37 +0000
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        "Hans Petter Selasky" <hselasky@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r353302 - head/sys/net
Message-ID:  <68CDD3DA-3E39-401C-8402-C54D37AFADBC@lists.zabbadoz.net>
In-Reply-To: <201910081106.x98B6OBB013578@repo.freebsd.org>
References:  <201910081106.x98B6OBB013578@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?68CDD3DA-3E39-401C-8402-C54D37AFADBC>