Skip to content

Commit

Permalink
Enter network epoch in domain callouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
glebius committed Oct 9, 2019
1 parent 7f9cc42 commit 7299f8c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sys/kern/uipc_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>

#include <net/vnet.h>
#include <net/if.h> /* XXXGL: net_epoch should move out there */
#include <net/if_var.h> /* XXXGL: net_epoch should move out there */

/*
* System initialization
Expand Down Expand Up @@ -499,25 +501,31 @@ pfctlinput2(int cmd, struct sockaddr *sa, void *ctlparam)
static void
pfslowtimo(void *arg)
{
struct epoch_tracker et;
struct domain *dp;
struct protosw *pr;

NET_EPOCH_ENTER(et);
for (dp = domains; dp; dp = dp->dom_next)
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_slowtimo)
(*pr->pr_slowtimo)();
NET_EPOCH_EXIT(et);
callout_reset(&pfslow_callout, hz/2, pfslowtimo, NULL);
}

static void
pffasttimo(void *arg)
{
struct epoch_tracker et;
struct domain *dp;
struct protosw *pr;

NET_EPOCH_ENTER(et);
for (dp = domains; dp; dp = dp->dom_next)
for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
if (pr->pr_fasttimo)
(*pr->pr_fasttimo)();
NET_EPOCH_EXIT(et);
callout_reset(&pffast_callout, hz/5, pffasttimo, NULL);
}

0 comments on commit 7299f8c

Please sign in to comment.