ip_reass: separate ipreass_init() into global and VIMAGE parts
Should have been done in 89128ff3e4
.
This commit is contained in:
parent
a6b982e265
commit
aea0cd0432
@ -101,6 +101,7 @@ CTASSERT(sizeof(struct ip) == 20);
|
||||
|
||||
/* IP reassembly functions are defined in ip_reass.c. */
|
||||
extern void ipreass_init(void);
|
||||
extern void ipreass_vnet_init(void);
|
||||
#ifdef VIMAGE
|
||||
extern void ipreass_destroy(void);
|
||||
#endif
|
||||
@ -315,7 +316,7 @@ ip_vnet_init(void *arg __unused)
|
||||
V_in_ifaddrhashtbl = hashinit(INADDR_NHASH, M_IFADDR, &V_in_ifaddrhmask);
|
||||
|
||||
/* Initialize IP reassembly queue. */
|
||||
ipreass_init();
|
||||
ipreass_vnet_init();
|
||||
|
||||
/* Initialize packet filter hooks. */
|
||||
args.pa_version = PFIL_VERSION;
|
||||
@ -349,6 +350,8 @@ static void
|
||||
ip_init(const void *unused __unused)
|
||||
{
|
||||
|
||||
ipreass_init();
|
||||
|
||||
/*
|
||||
* Register statically compiled protocols, that are unlikely to
|
||||
* ever become dynamic.
|
||||
|
@ -92,6 +92,7 @@ VNET_DEFINE_STATIC(int, ipreass_maxbucketsize);
|
||||
#define V_ipreass_maxbucketsize VNET(ipreass_maxbucketsize)
|
||||
|
||||
void ipreass_init(void);
|
||||
void ipreass_vnet_init(void);
|
||||
#ifdef VIMAGE
|
||||
void ipreass_destroy(void);
|
||||
#endif
|
||||
@ -625,7 +626,7 @@ ipreass_drain(void)
|
||||
* Initialize IP reassembly structures.
|
||||
*/
|
||||
void
|
||||
ipreass_init(void)
|
||||
ipreass_vnet_init(void)
|
||||
{
|
||||
int max;
|
||||
|
||||
@ -642,16 +643,19 @@ ipreass_init(void)
|
||||
max = IP_MAXFRAGPACKETS;
|
||||
max = uma_zone_set_max(V_ipq_zone, max);
|
||||
V_ipreass_maxbucketsize = imax(max / (IPREASS_NHASH / 2), 1);
|
||||
}
|
||||
|
||||
if (IS_DEFAULT_VNET(curvnet)) {
|
||||
maxfrags = IP_MAXFRAGS;
|
||||
EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change,
|
||||
NULL, EVENTHANDLER_PRI_ANY);
|
||||
EVENTHANDLER_REGISTER(vm_lowmem, ipreass_drain, NULL,
|
||||
LOWMEM_PRI_DEFAULT);
|
||||
EVENTHANDLER_REGISTER(mbuf_lowmem, ipreass_drain, NULL,
|
||||
LOWMEM_PRI_DEFAULT);
|
||||
}
|
||||
void
|
||||
ipreass_init(void)
|
||||
{
|
||||
|
||||
maxfrags = IP_MAXFRAGS;
|
||||
EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change,
|
||||
NULL, EVENTHANDLER_PRI_ANY);
|
||||
EVENTHANDLER_REGISTER(vm_lowmem, ipreass_drain, NULL,
|
||||
LOWMEM_PRI_DEFAULT);
|
||||
EVENTHANDLER_REGISTER(mbuf_lowmem, ipreass_drain, NULL,
|
||||
LOWMEM_PRI_DEFAULT);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user