From 7bf272a6126cdae6c1a76d9cb0d12896631fe894 Mon Sep 17 00:00:00 2001 From: Matt Macy Date: Thu, 10 May 2018 19:13:00 +0000 Subject: [PATCH] Allocate epoch for networking at startup Additionally add CK to include paths for modules Approved by: sbruno@ --- sys/conf/kmod.mk | 2 +- sys/net/if.c | 2 ++ sys/net/if_var.h | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index e1d6d69549a4..ef07516eb6ba 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -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 diff --git a/sys/net/if.c b/sys/net/if.c index fb09a4f4e208..806b780185bd 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -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 #include @@ -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); } diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 782b9c706b7b..c72f637ac04f 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -76,6 +76,8 @@ struct netdump_methods; #include /* ifqueue only? */ #include #include +#include +#include #endif /* _KERNEL */ #include #include /* 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 {