frag6: use callout(9) directly instead of pr_slowtimo

Reviewed by:		melifaro
Differential revision:	https://reviews.freebsd.org/D36162
This commit is contained in:
Gleb Smirnoff 2022-08-17 11:50:31 -07:00
parent b730de8bad
commit a0d7d2476f
3 changed files with 17 additions and 5 deletions

View File

@ -883,8 +883,9 @@ frag6_input(struct mbuf **mp, int *offp, int proto)
* IPv6 reassembling timer processing;
* if a timer expires on a reassembly queue, discard it.
*/
void
frag6_slowtimo(void)
static struct callout frag6_callout;
static void
frag6_slowtimo(void *arg __unused)
{
VNET_ITERATOR_DECL(vnet_iter);
struct ip6qhead *head;
@ -892,7 +893,7 @@ frag6_slowtimo(void)
uint32_t bucket;
if (atomic_load_int(&frag6_nfrags) == 0)
return;
goto done;
VNET_LIST_RLOCK_NOSLEEP();
VNET_FOREACH(vnet_iter) {
@ -949,8 +950,21 @@ frag6_slowtimo(void)
CURVNET_RESTORE();
}
VNET_LIST_RUNLOCK_NOSLEEP();
done:
callout_reset_sbt(&frag6_callout, SBT_1MS * 500, SBT_1MS * 10,
frag6_slowtimo, NULL, 0);
}
static void
frag6_slowtimo_init(void *arg __unused)
{
callout_init(&frag6_callout, 1);
callout_reset_sbt(&frag6_callout, SBT_1MS * 500, SBT_1MS * 10,
frag6_slowtimo, NULL, 0);
}
SYSINIT(frag6, SI_SUB_VNET_DONE, SI_ORDER_ANY, frag6_slowtimo_init, NULL);
/*
* Eventhandler to adjust limits in case nmbclusters change.
*/

View File

@ -146,7 +146,6 @@ struct protosw inet6sw[] = {
.pr_domain = &inet6domain,
.pr_protocol = IPPROTO_IPV6,
.pr_flags = PR_CAPATTACH,
.pr_slowtimo = frag6_slowtimo,
.pr_drain = frag6_drain,
.pr_usrreqs = &nousrreqs,
},

View File

@ -391,7 +391,6 @@ int route6_input(struct mbuf **, int *, int);
void frag6_init(void);
void frag6_destroy(void);
int frag6_input(struct mbuf **, int *, int);
void frag6_slowtimo(void);
void frag6_drain(void);
void rip6_init(void);