svn commit: r196620 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern

Marko Zec zec at FreeBSD.org
Fri Aug 28 19:08:57 UTC 2009


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);
 }


More information about the svn-src-stable mailing list