Allocate epoch for networking at startup

Additionally add CK to include paths for modules

Approved by:	sbruno@
This commit is contained in:
Matt Macy 2018-05-10 19:13:00 +00:00
parent 329d20de97
commit 7bf272a612
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333469
3 changed files with 6 additions and 1 deletions

View File

@ -122,7 +122,7 @@ CFLAGS+= -DHAVE_KERNEL_OPTION_HEADERS -include ${KERNBUILDDIR}/opt_global.h
# Add -I paths for system headers. Individual module makefiles don't
# need any -I paths for this. Similar defaults for .PATH can't be
# set because there are no standard paths for non-headers.
CFLAGS+= -I. -I${SYSDIR}
CFLAGS+= -I. -I${SYSDIR} -I${SYSDIR}/contrib/ck/include
CFLAGS.gcc+= -finline-limit=${INLINE_LIMIT}
CFLAGS.gcc+= -fms-extensions

View File

@ -104,6 +104,7 @@
_Static_assert(sizeof(((struct ifreq *)0)->ifr_name) ==
offsetof(struct ifreq, ifr_ifru), "gap between ifr_name and ifr_ifru");
epoch_t net_epoch;
#ifdef COMPAT_FREEBSD32
#include <sys/mount.h>
#include <compat/freebsd32/freebsd32.h>
@ -903,6 +904,7 @@ if_attachdomain(void *dummy)
{
struct ifnet *ifp;
net_epoch = epoch_alloc();
TAILQ_FOREACH(ifp, &V_ifnet, if_link)
if_attachdomain1(ifp);
}

View File

@ -76,6 +76,8 @@ struct netdump_methods;
#include <sys/mbuf.h> /* ifqueue only? */
#include <sys/buf_ring.h>
#include <net/vnet.h>
#include <ck_queue.h>
#include <sys/epoch.h>
#endif /* _KERNEL */
#include <sys/counter.h>
#include <sys/lock.h> /* XXX */
@ -104,6 +106,7 @@ VNET_DECLARE(struct hhook_head *, ipsec_hhh_in[HHOOK_IPSEC_COUNT]);
VNET_DECLARE(struct hhook_head *, ipsec_hhh_out[HHOOK_IPSEC_COUNT]);
#define V_ipsec_hhh_in VNET(ipsec_hhh_in)
#define V_ipsec_hhh_out VNET(ipsec_hhh_out)
extern epoch_t net_epoch;
#endif /* _KERNEL */
typedef enum {