From owner-svn-src-all@freebsd.org Wed May 18 15:50:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 307A8B410C1; Wed, 18 May 2016 15:50:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB1F71DCC; Wed, 18 May 2016 15:50:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IForHu030985; Wed, 18 May 2016 15:50:53 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4IFoqRb030983; Wed, 18 May 2016 15:50:52 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201605181550.u4IFoqRb030983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 18 May 2016 15:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300155 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 15:50:54 -0000 Author: bz Date: Wed May 18 15:50:52 2016 New Revision: 300155 URL: https://svnweb.freebsd.org/changeset/base/300155 Log: Add a "vnet_state" field to struct vnet. This is set to the SI_SUB_* value before executing any VNET_SYSINIT or VNET_SYSUNINT. While good for debugging especially VNET teardown problems having a chance to know at which level during teardown we are, it will also be used to identify to detcted a "stable state" (as in fully up and running) later on. Obtained from: projects/vnet Sponsored by: The FreeBSD Foundation Modified: head/sys/net/vnet.c head/sys/net/vnet.h Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Wed May 18 15:45:12 2016 (r300154) +++ head/sys/net/vnet.c Wed May 18 15:50:52 2016 (r300155) @@ -233,6 +233,7 @@ vnet_alloc(void) SDT_PROBE1(vnet, functions, vnet_alloc, entry, __LINE__); vnet = malloc(sizeof(struct vnet), M_VNET, M_WAITOK | M_ZERO); vnet->vnet_magic_n = VNET_MAGIC_N; + vnet->vnet_state = 0; SDT_PROBE2(vnet, functions, vnet_alloc, alloc, __LINE__, vnet); /* @@ -581,6 +582,7 @@ vnet_sysinit(void) VNET_SYSINIT_RLOCK(); TAILQ_FOREACH(vs, &vnet_constructors, link) { + curvnet->vnet_state = vs->subsystem; vs->func(vs->arg); } VNET_SYSINIT_RUNLOCK(); @@ -599,6 +601,7 @@ vnet_sysuninit(void) VNET_SYSINIT_RLOCK(); TAILQ_FOREACH_REVERSE(vs, &vnet_destructors, vnet_sysuninit_head, link) { + curvnet->vnet_state = vs->subsystem; vs->func(vs->arg); } VNET_SYSINIT_RUNLOCK(); @@ -714,6 +717,7 @@ db_vnet_print(struct vnet *vnet) db_printf(" vnet_data_mem = %p\n", vnet->vnet_data_mem); db_printf(" vnet_data_base = %#jx\n", (uintmax_t)vnet->vnet_data_base); + db_printf(" vnet_state = %#08x\n", vnet->vnet_state); db_printf("\n"); } Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Wed May 18 15:45:12 2016 (r300154) +++ head/sys/net/vnet.h Wed May 18 15:50:52 2016 (r300155) @@ -70,6 +70,7 @@ struct vnet { u_int vnet_magic_n; u_int vnet_ifcnt; u_int vnet_sockcnt; + u_int vnet_state; /* SI_SUB_* */ void *vnet_data_mem; uintptr_t vnet_data_base; };