Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108570311
D33541.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D33541.id.diff
View Options
diff --git a/sys/dev/hyperv/hvsock/hv_sock.c b/sys/dev/hyperv/hvsock/hv_sock.c
--- a/sys/dev/hyperv/hvsock/hv_sock.c
+++ b/sys/dev/hyperv/hvsock/hv_sock.c
@@ -130,7 +130,7 @@
.dom_protoswNPROTOSW = &hv_socket_protosw[nitems(hv_socket_protosw)]
};
-VNET_DOMAIN_SET(hv_socket_);
+DOMAIN_SET(hv_socket_);
#define MAX_PORT ((uint32_t)0xFFFFFFFF)
#define MIN_PORT ((uint32_t)0x0)
diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c
--- a/sys/kern/uipc_domain.c
+++ b/sys/kern/uipc_domain.c
@@ -183,29 +183,21 @@
struct protosw *pr;
int flags;
+ MPASS(IS_DEFAULT_VNET(curvnet));
+
flags = atomic_load_acq_int(&dp->dom_flags);
if ((flags & DOMF_SUPPORTED) == 0)
return;
- KASSERT((flags & DOMF_INITED) == 0 || !IS_DEFAULT_VNET(curvnet),
- ("Premature initialization of domain in non-default vnet"));
+ MPASS((flags & DOMF_INITED) == 0);
+
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) {
- /*
- * Note that with VIMAGE enabled, domain_init() will be
- * re-invoked for each new vnet that's created. The below lists
- * are intended to be system-wide, so avoid altering global
- * state for non-default vnets.
- */
- if (IS_DEFAULT_VNET(curvnet)) {
- pr_usrreqs_init(pr);
- rm_wlock(&pftimo_lock);
- if (pr->pr_fasttimo != NULL)
- LIST_INSERT_HEAD(&pffast_list, pr,
- pr_fasttimos);
- if (pr->pr_slowtimo != NULL)
- LIST_INSERT_HEAD(&pfslow_list, pr,
- pr_slowtimos);
- rm_wunlock(&pftimo_lock);
- }
+ pr_usrreqs_init(pr);
+ rm_wlock(&pftimo_lock);
+ if (pr->pr_fasttimo != NULL)
+ LIST_INSERT_HEAD(&pffast_list, pr, pr_fasttimos);
+ if (pr->pr_slowtimo != NULL)
+ LIST_INSERT_HEAD(&pfslow_list, pr, pr_slowtimos);
+ rm_wunlock(&pftimo_lock);
}
/*
@@ -215,29 +207,9 @@
max_datalen = MHLEN - max_hdr;
if (max_datalen < 1)
panic("%s: max_datalen < 1", __func__);
- if (IS_DEFAULT_VNET(curvnet))
- atomic_set_rel_int(&dp->dom_flags, DOMF_INITED);
-}
-
-#ifdef VIMAGE
-void
-vnet_domain_init(void *arg)
-{
-
- /* Virtualized case is no different -- call init functions. */
- domain_init(arg);
+ atomic_set_rel_int(&dp->dom_flags, DOMF_INITED);
}
-void
-vnet_domain_uninit(void *arg)
-{
- struct domain *dp = arg;
-
- if ((atomic_load_acq_int(&dp->dom_flags) & DOMF_SUPPORTED) == 0)
- return;
-}
-#endif
-
/*
* Add a new protocol domain to the list of supported domains
* Note: you cant unload it again because a socket may be using it.
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -2702,4 +2702,4 @@
.dom_protoswNPROTOSW = &routesw[nitems(routesw)]
};
-VNET_DOMAIN_SET(route);
+DOMAIN_SET(route);
diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket.c b/sys/netgraph/bluetooth/socket/ng_btsocket.c
--- a/sys/netgraph/bluetooth/socket/ng_btsocket.c
+++ b/sys/netgraph/bluetooth/socket/ng_btsocket.c
@@ -287,4 +287,4 @@
return (error);
} /* ng_btsocket_modevent */
-VNET_DOMAIN_SET(ng_btsocket_);
+DOMAIN_SET(ng_btsocket_);
diff --git a/sys/netgraph/ng_socket.c b/sys/netgraph/ng_socket.c
--- a/sys/netgraph/ng_socket.c
+++ b/sys/netgraph/ng_socket.c
@@ -1223,7 +1223,7 @@
return (error);
}
-VNET_DOMAIN_SET(ng);
+DOMAIN_SET(ng);
SYSCTL_INT(_net_graph, OID_AUTO, family, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, AF_NETGRAPH, "");
static SYSCTL_NODE(_net_graph, OID_AUTO, data, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c
--- a/sys/netinet/in_proto.c
+++ b/sys/netinet/in_proto.c
@@ -302,7 +302,7 @@
.dom_ifdetach = in_domifdetach
};
-VNET_DOMAIN_SET(inet);
+DOMAIN_SET(inet);
#endif /* INET */
SYSCTL_NODE(_net, PF_INET, inet, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -345,7 +345,7 @@
.dom_ifmtu = in6_domifmtu
};
-VNET_DOMAIN_SET(inet6);
+DOMAIN_SET(inet6);
/*
* Internet configuration info
diff --git a/sys/sys/domain.h b/sys/sys/domain.h
--- a/sys/sys/domain.h
+++ b/sys/sys/domain.h
@@ -87,19 +87,6 @@
SI_ORDER_FIRST, domain_add, & name ## domain); \
SYSINIT(domain_init_ ## name, SI_SUB_PROTO_DOMAIN, \
SI_ORDER_SECOND, domain_init, & name ## domain);
-#ifdef VIMAGE
-#define VNET_DOMAIN_SET(name) \
- SYSINIT(domain_add_ ## name, SI_SUB_PROTO_DOMAIN, \
- SI_ORDER_FIRST, domain_add, & name ## domain); \
- VNET_SYSINIT(vnet_domain_init_ ## name, SI_SUB_PROTO_DOMAIN, \
- SI_ORDER_SECOND, vnet_domain_init, & name ## domain); \
- VNET_SYSUNINIT(vnet_domain_uninit_ ## name, \
- SI_SUB_PROTO_DOMAIN, SI_ORDER_SECOND, vnet_domain_uninit, \
- & name ## domain)
-#else /* !VIMAGE */
-#define VNET_DOMAIN_SET(name) DOMAIN_SET(name)
-#endif /* VIMAGE */
-
#endif /* _KERNEL */
#endif /* !_SYS_DOMAIN_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 11:37 AM (3 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16195159
Default Alt Text
D33541.id.diff (4 KB)
Attached To
Mode
D33541: domains: make domain_init() initialize only global state
Attached
Detach File
Event Timeline
Log In to Comment