From owner-svn-src-stable@FreeBSD.ORG Fri Aug 28 19:08:57 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50D731065670; Fri, 28 Aug 2009 19:08:57 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E2E38FC14; Fri, 28 Aug 2009 19:08:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7SJ8vZ2033494; Fri, 28 Aug 2009 19:08:57 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7SJ8uW7033493; Fri, 28 Aug 2009 19:08:56 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <200908281908.n7SJ8uW7033493@svn.freebsd.org> From: Marko Zec Date: Fri, 28 Aug 2009 19:08:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196620 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2009 19:08:57 -0000 Author: zec Date: Fri Aug 28 19:08:56 2009 New Revision: 196620 URL: http://svn.freebsd.org/changeset/base/196620 Log: MFC r196501: When registering a protocol to an existing protocol domain via pf_proto_register(), iterate over all existing vnets to call protosw_init() and thus the appropriate .pr_init() handler in the context of each vnet. NB in the future we probably want to separate pr_init() handlers into two, i.e. per-vnet and global, functions. This change has no impact on nooptions VIMAGE builds. Approved by: re (rwatson), julian (mentor) Approved by: re (rwatson) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/kern/uipc_domain.c Modified: stable/8/sys/kern/uipc_domain.c ============================================================================== --- stable/8/sys/kern/uipc_domain.c Fri Aug 28 18:01:37 2009 (r196619) +++ stable/8/sys/kern/uipc_domain.c Fri Aug 28 19:08:56 2009 (r196620) @@ -336,6 +336,7 @@ found: int pf_proto_register(int family, struct protosw *npr) { + VNET_ITERATOR_DECL(vnet_iter); struct domain *dp; struct protosw *pr, *fpr; @@ -391,7 +392,13 @@ found: mtx_unlock(&dom_mtx); /* Initialize and activate the protocol. */ - protosw_init(fpr); + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET_QUIET(vnet_iter); + protosw_init(fpr); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); return (0); }