Garbage collect vnet module registrations that have neither constructors
nor destructors, as there's no actual work to do. In most cases, the constructors weren't needed because of the existing protocol initialization functions run by net_init_domain() as part of VNET_MOD_NET, or they were eliminated when support for static initialization of virtualized globals was added. Garbage collect dependency references to modules without constructors or destructors, notably VNET_MOD_INET and VNET_MOD_INET6. Reviewed by: bz Approved by: re (vimage blanket)
This commit is contained in:
parent
331f685743
commit
0a4747d4d0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=195782
@ -180,7 +180,6 @@ static int flowtable_idetach(const void *);
|
||||
static const vnet_modinfo_t flowtable_modinfo = {
|
||||
.vmi_id = VNET_MOD_FLOWTABLE,
|
||||
.vmi_name = "flowtable",
|
||||
.vmi_dependson = VNET_MOD_INET,
|
||||
.vmi_iattach = flowtable_iattach,
|
||||
.vmi_idetach = flowtable_idetach
|
||||
};
|
||||
|
@ -224,7 +224,10 @@ static VNET_DEFINE(int, current_state_timers_running); /* IGMPv1/v2 host
|
||||
#define V_current_state_timers_running VNET(current_state_timers_running)
|
||||
|
||||
static VNET_DEFINE(LIST_HEAD(, igmp_ifinfo), igi_head);
|
||||
static VNET_DEFINE(struct igmpstat, igmpstat);
|
||||
static VNET_DEFINE(struct igmpstat, igmpstat) = {
|
||||
.igps_version = IGPS_VERSION_3,
|
||||
.igps_len = sizeof(struct igmpstat),
|
||||
};
|
||||
static VNET_DEFINE(struct timeval, igmp_gsrdelay) = {10, 0};
|
||||
|
||||
#define V_igi_head VNET(igi_head)
|
||||
@ -3615,12 +3618,6 @@ vnet_igmp_iattach(const void *unused __unused)
|
||||
|
||||
LIST_INIT(&V_igi_head);
|
||||
|
||||
/*
|
||||
* Initialize sysctls to default values.
|
||||
*/
|
||||
V_igmpstat.igps_version = IGPS_VERSION_3;
|
||||
V_igmpstat.igps_len = sizeof(struct igmpstat);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -3640,7 +3637,6 @@ vnet_igmp_idetach(const void *unused __unused)
|
||||
static vnet_modinfo_t vnet_igmp_modinfo = {
|
||||
.vmi_id = VNET_MOD_IGMP,
|
||||
.vmi_name = "igmp",
|
||||
.vmi_dependson = VNET_MOD_INET,
|
||||
.vmi_iattach = vnet_igmp_iattach,
|
||||
.vmi_idetach = vnet_igmp_idetach
|
||||
};
|
||||
|
@ -236,24 +236,6 @@ VNET_DEFINE(int, fw_one_pass) = 1;
|
||||
|
||||
static void ip_freef(struct ipqhead *, struct ipq *);
|
||||
|
||||
#ifdef VIMAGE
|
||||
/* XXX only has to stay for .vmi_dependson elsewhere. */
|
||||
static void vnet_inet_register(void);
|
||||
|
||||
static const vnet_modinfo_t vnet_inet_modinfo = {
|
||||
.vmi_id = VNET_MOD_INET,
|
||||
.vmi_name = "inet",
|
||||
};
|
||||
|
||||
static void vnet_inet_register()
|
||||
{
|
||||
|
||||
vnet_mod_register(&vnet_inet_modinfo);
|
||||
}
|
||||
|
||||
SYSINIT(inet, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, vnet_inet_register, 0);
|
||||
#endif
|
||||
|
||||
static int
|
||||
sysctl_netinet_intr_queue_maxlen(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
@ -302,8 +284,6 @@ ip_init(void)
|
||||
struct protosw *pr;
|
||||
int i;
|
||||
|
||||
V_ip_id = time_second & 0xffff;
|
||||
|
||||
TAILQ_INIT(&V_in_ifaddrhead);
|
||||
V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask);
|
||||
|
||||
@ -362,6 +342,7 @@ ip_init(void)
|
||||
NULL, EVENTHANDLER_PRI_ANY);
|
||||
|
||||
/* Initialize various other remaining things. */
|
||||
V_ip_id = time_second & 0xffff;
|
||||
IPQ_LOCK_INIT();
|
||||
netisr_register(&ip_nh);
|
||||
}
|
||||
|
@ -162,26 +162,6 @@ static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *);
|
||||
static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int);
|
||||
#endif
|
||||
|
||||
#ifdef VIMAGE
|
||||
/* XXX only has to stay for .vmi_dependson elsewhere. */
|
||||
static void vnet_inet6_register(void);
|
||||
|
||||
static const vnet_modinfo_t vnet_inet6_modinfo = {
|
||||
.vmi_id = VNET_MOD_INET6,
|
||||
.vmi_name = "inet6",
|
||||
.vmi_dependson = VNET_MOD_INET /* XXX revisit - TCP/UDP needs this? */
|
||||
};
|
||||
|
||||
static void
|
||||
vnet_inet6_register(void)
|
||||
{
|
||||
|
||||
vnet_mod_register(&vnet_inet6_modinfo);
|
||||
}
|
||||
|
||||
SYSINIT(inet6, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, vnet_inet6_register, 0);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IP6 initialization: fill in IP6 protocol switch table.
|
||||
* All protocols not implemented in kernel go to raw IP6 protocol handler.
|
||||
|
@ -3253,7 +3253,6 @@ vnet_mld_idetach(const void *unused __unused)
|
||||
static vnet_modinfo_t vnet_mld_modinfo = {
|
||||
.vmi_id = VNET_MOD_MLD,
|
||||
.vmi_name = "mld",
|
||||
.vmi_dependson = VNET_MOD_INET6,
|
||||
.vmi_iattach = vnet_mld_iattach,
|
||||
.vmi_idetach = vnet_mld_idetach
|
||||
};
|
||||
|
@ -245,7 +245,6 @@ static int ipsec_iattach(const void *);
|
||||
static const vnet_modinfo_t vnet_ipsec_modinfo = {
|
||||
.vmi_id = VNET_MOD_IPSEC,
|
||||
.vmi_name = "ipsec",
|
||||
.vmi_dependson = VNET_MOD_INET, /* XXX revisit - INET6 ? */
|
||||
.vmi_iattach = ipsec_iattach,
|
||||
};
|
||||
#endif
|
||||
|
@ -81,14 +81,6 @@ SYSCTL_VNET_STRUCT(_net_inet_ipcomp, IPSECCTL_STATS,
|
||||
static int ipcomp_input_cb(struct cryptop *crp);
|
||||
static int ipcomp_output_cb(struct cryptop *crp);
|
||||
|
||||
#ifdef VIMAGE
|
||||
static const vnet_modinfo_t vnet_ipcomp_modinfo = {
|
||||
.vmi_id = VNET_MOD_IPCOMP,
|
||||
.vmi_name = "ipsec_ipcomp",
|
||||
.vmi_dependson = VNET_MOD_IPSEC,
|
||||
};
|
||||
#endif
|
||||
|
||||
struct comp_algo *
|
||||
ipcomp_algorithm_lookup(int alg)
|
||||
{
|
||||
@ -604,9 +596,6 @@ ipcomp_attach(void)
|
||||
{
|
||||
|
||||
xform_register(&ipcomp_xformsw);
|
||||
#ifdef VIMAGE
|
||||
vnet_mod_register(&vnet_ipcomp_modinfo);
|
||||
#endif
|
||||
}
|
||||
|
||||
SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipcomp_attach, NULL);
|
||||
|
@ -105,14 +105,6 @@ SYSCTL_VNET_STRUCT(_net_inet_ipip, IPSECCTL_STATS,
|
||||
|
||||
static void _ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp);
|
||||
|
||||
#ifdef VIMAGE
|
||||
static const vnet_modinfo_t vnet_ipip_modinfo = {
|
||||
.vmi_id = VNET_MOD_IPIP,
|
||||
.vmi_name = "ipsec_ipip",
|
||||
.vmi_dependson = VNET_MOD_IPSEC,
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef INET6
|
||||
/*
|
||||
* Really only a wrapper for ipip_input(), for use with IPv6.
|
||||
@ -710,9 +702,6 @@ ipe4_attach(void)
|
||||
(void) encap_attach_func(AF_INET6, -1,
|
||||
ipe4_encapcheck, (struct protosw *)&ipe6_protosw, NULL);
|
||||
#endif
|
||||
#ifdef VIMAGE
|
||||
vnet_mod_register(&vnet_ipip_modinfo);
|
||||
#endif
|
||||
}
|
||||
SYSINIT(ipe4_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipe4_attach, NULL);
|
||||
#endif /* IPSEC */
|
||||
|
Loading…
Reference in New Issue
Block a user