Date: Tue, 24 Jul 2018 16:35:52 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336676 - in head/sys: contrib/ipfilter/netinet net netgraph netinet netinet/cc netinet6 netipsec netpfil/ipfw netpfil/ipfw/nptv6 netpfil/ipfw/pmod netpfil/pf Message-ID: <201807241635.w6OGZqEx034325@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Tue Jul 24 16:35:52 2018 New Revision: 336676 URL: https://svnweb.freebsd.org/changeset/base/336676 Log: Use the new VNET_DEFINE_STATIC macro when we are defining static VNET variables. Reviewed by: bz Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16147 Modified: head/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c head/sys/net/bpf.c head/sys/net/ieee8023ad_lacp.c head/sys/net/if.c head/sys/net/if_bridge.c head/sys/net/if_clone.c head/sys/net/if_disc.c head/sys/net/if_edsc.c head/sys/net/if_enc.c head/sys/net/if_epair.c head/sys/net/if_ethersubr.c head/sys/net/if_gif.c head/sys/net/if_gre.c head/sys/net/if_ipsec.c head/sys/net/if_lagg.c head/sys/net/if_llatbl.c head/sys/net/if_loop.c head/sys/net/if_me.c head/sys/net/if_vlan.c head/sys/net/netisr.c head/sys/net/route.c head/sys/net/rtsock.c head/sys/net/vnet.c head/sys/netgraph/ng_base.c head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_iface.c head/sys/netinet/cc/cc_cdg.c head/sys/netinet/cc/cc_chd.c head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/cc/cc_hd.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_newreno.c head/sys/netinet/cc/cc_vegas.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_gif.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_carp.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_gre.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_id.c head/sys/netinet/ip_input.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_options.c head/sys/netinet/ip_reass.c head/sys/netinet/tcp_fastopen.c head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/frag6.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_gif.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_gre.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/scope6.c head/sys/netinet6/send.c head/sys/netipsec/ipsec.c head/sys/netipsec/key.c head/sys/netipsec/keysock.c head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_bpf.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_pfil.c head/sys/netpfil/ipfw/ip_fw_sockopt.c head/sys/netpfil/ipfw/nptv6/nptv6.c head/sys/netpfil/ipfw/pmod/tcpmod.c head/sys/netpfil/pf/if_pflog.c head/sys/netpfil/pf/if_pfsync.c head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_if.c head/sys/netpfil/pf/pf_ioctl.c head/sys/netpfil/pf/pf_norm.c head/sys/netpfil/pf/pf_osfp.c head/sys/netpfil/pf/pf_table.c Modified: head/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c Tue Jul 24 16:35:52 2018 (r336676) @@ -80,7 +80,7 @@ static void ipf_p_rpcb_fixlen __P((fr_info_t *, in */ static frentry_t rpcbfr; /* Skeleton rule for reference by entities this proxy creates. */ -static VNET_DEFINE(int, rpcbcnt); +VNET_DEFINE_STATIC(int, rpcbcnt); #define V_rpcbcnt VNET(rpcbcnt) /* Upper bound of allocated RPCB sessions. */ /* XXX rpcbcnt still requires locking. */ Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/bpf.c Tue Jul 24 16:35:52 2018 (r336676) @@ -213,7 +213,7 @@ SYSCTL_INT(_net_bpf, OID_AUTO, zerocopy_enable, CTLFLA static SYSCTL_NODE(_net_bpf, OID_AUTO, stats, CTLFLAG_MPSAFE | CTLFLAG_RW, bpf_stats_sysctl, "bpf statistics portal"); -static VNET_DEFINE(int, bpf_optimize_writers) = 0; +VNET_DEFINE_STATIC(int, bpf_optimize_writers) = 0; #define V_bpf_optimize_writers VNET(bpf_optimize_writers) SYSCTL_INT(_net_bpf, OID_AUTO, optimize_writers, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(bpf_optimize_writers), 0, Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/ieee8023ad_lacp.c Tue Jul 24 16:35:52 2018 (r336676) @@ -194,13 +194,13 @@ static const char *lacp_format_portid(const struct lac static void lacp_dprintf(const struct lacp_port *, const char *, ...) __attribute__((__format__(__printf__, 2, 3))); -static VNET_DEFINE(int, lacp_debug); +VNET_DEFINE_STATIC(int, lacp_debug); #define V_lacp_debug VNET(lacp_debug) SYSCTL_NODE(_net_link_lagg, OID_AUTO, lacp, CTLFLAG_RD, 0, "ieee802.3ad"); SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(lacp_debug), 0, "Enable LACP debug logging (1=debug, 2=trace)"); -static VNET_DEFINE(int, lacp_default_strict_mode) = 1; +VNET_DEFINE_STATIC(int, lacp_default_strict_mode) = 1; SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, default_strict_mode, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(lacp_default_strict_mode), 0, "LACP strict protocol compliance default"); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if.c Tue Jul 24 16:35:52 2018 (r336676) @@ -293,7 +293,7 @@ int ifqmaxlen = IFQ_MAXLEN; VNET_DEFINE(struct ifnethead, ifnet); /* depend on static init XXX */ VNET_DEFINE(struct ifgrouphead, ifg_head); -static VNET_DEFINE(int, if_indexlim) = 8; +VNET_DEFINE_STATIC(int, if_indexlim) = 8; /* Table of ifnet by index. */ VNET_DEFINE(struct ifnet **, ifindex_table); Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_bridge.c Tue Jul 24 16:35:52 2018 (r336676) @@ -229,7 +229,7 @@ struct bridge_softc { u_char sc_defaddr[6]; /* Default MAC address */ }; -static VNET_DEFINE(struct mtx, bridge_list_mtx); +VNET_DEFINE_STATIC(struct mtx, bridge_list_mtx); #define V_bridge_list_mtx VNET(bridge_list_mtx) static eventhandler_tag bridge_detach_cookie; @@ -354,59 +354,59 @@ SYSCTL_DECL(_net_link); static SYSCTL_NODE(_net_link, IFT_BRIDGE, bridge, CTLFLAG_RW, 0, "Bridge"); /* only pass IP[46] packets when pfil is enabled */ -static VNET_DEFINE(int, pfil_onlyip) = 1; +VNET_DEFINE_STATIC(int, pfil_onlyip) = 1; #define V_pfil_onlyip VNET(pfil_onlyip) SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_onlyip), 0, "Only pass IP packets when pfil is enabled"); /* run pfil hooks on the bridge interface */ -static VNET_DEFINE(int, pfil_bridge) = 1; +VNET_DEFINE_STATIC(int, pfil_bridge) = 1; #define V_pfil_bridge VNET(pfil_bridge) SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_bridge), 0, "Packet filter on the bridge interface"); /* layer2 filter with ipfw */ -static VNET_DEFINE(int, pfil_ipfw); +VNET_DEFINE_STATIC(int, pfil_ipfw); #define V_pfil_ipfw VNET(pfil_ipfw) /* layer2 ARP filter with ipfw */ -static VNET_DEFINE(int, pfil_ipfw_arp); +VNET_DEFINE_STATIC(int, pfil_ipfw_arp); #define V_pfil_ipfw_arp VNET(pfil_ipfw_arp) SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_ipfw_arp), 0, "Filter ARP packets through IPFW layer2"); /* run pfil hooks on the member interface */ -static VNET_DEFINE(int, pfil_member) = 1; +VNET_DEFINE_STATIC(int, pfil_member) = 1; #define V_pfil_member VNET(pfil_member) SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_member), 0, "Packet filter on the member interface"); /* run pfil hooks on the physical interface for locally destined packets */ -static VNET_DEFINE(int, pfil_local_phys); +VNET_DEFINE_STATIC(int, pfil_local_phys); #define V_pfil_local_phys VNET(pfil_local_phys) SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(pfil_local_phys), 0, "Packet filter on the physical interface for locally destined packets"); /* log STP state changes */ -static VNET_DEFINE(int, log_stp); +VNET_DEFINE_STATIC(int, log_stp); #define V_log_stp VNET(log_stp) SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(log_stp), 0, "Log STP state changes"); /* share MAC with first bridge member */ -static VNET_DEFINE(int, bridge_inherit_mac); +VNET_DEFINE_STATIC(int, bridge_inherit_mac); #define V_bridge_inherit_mac VNET(bridge_inherit_mac) SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(bridge_inherit_mac), 0, "Inherit MAC address from the first bridge member"); -static VNET_DEFINE(int, allow_llz_overlap) = 0; +VNET_DEFINE_STATIC(int, allow_llz_overlap) = 0; #define V_allow_llz_overlap VNET(allow_llz_overlap) SYSCTL_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(allow_llz_overlap), 0, @@ -510,7 +510,7 @@ const struct bridge_control bridge_control_table[] = { }; const int bridge_control_table_size = nitems(bridge_control_table); -static VNET_DEFINE(LIST_HEAD(, bridge_softc), bridge_list); +VNET_DEFINE_STATIC(LIST_HEAD(, bridge_softc), bridge_list); #define V_bridge_list VNET(bridge_list) #define BRIDGE_LIST_LOCK_INIT(x) mtx_init(&V_bridge_list_mtx, \ "if_bridge list", NULL, MTX_DEF) @@ -518,7 +518,7 @@ static VNET_DEFINE(LIST_HEAD(, bridge_softc), bridge_l #define BRIDGE_LIST_LOCK(x) mtx_lock(&V_bridge_list_mtx) #define BRIDGE_LIST_UNLOCK(x) mtx_unlock(&V_bridge_list_mtx) -static VNET_DEFINE(struct if_clone *, bridge_cloner); +VNET_DEFINE_STATIC(struct if_clone *, bridge_cloner); #define V_bridge_cloner VNET(bridge_cloner) static const char bridge_name[] = "bridge"; Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_clone.c Tue Jul 24 16:35:52 2018 (r336676) @@ -108,7 +108,7 @@ static int ifc_simple_destroy(struct if_clone *, s static struct mtx if_cloners_mtx; MTX_SYSINIT(if_cloners_lock, &if_cloners_mtx, "if_cloners lock", MTX_DEF); -static VNET_DEFINE(int, if_cloners_count); +VNET_DEFINE_STATIC(int, if_cloners_count); VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); #define V_if_cloners_count VNET(if_cloners_count) Modified: head/sys/net/if_disc.c ============================================================================== --- head/sys/net/if_disc.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_disc.c Tue Jul 24 16:35:52 2018 (r336676) @@ -76,7 +76,7 @@ static void disc_clone_destroy(struct ifnet *); static const char discname[] = "disc"; static MALLOC_DEFINE(M_DISC, discname, "Discard interface"); -static VNET_DEFINE(struct if_clone *, disc_cloner); +VNET_DEFINE_STATIC(struct if_clone *, disc_cloner); #define V_disc_cloner VNET(disc_cloner) static int Modified: head/sys/net/if_edsc.c ============================================================================== --- head/sys/net/if_edsc.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_edsc.c Tue Jul 24 16:35:52 2018 (r336676) @@ -72,7 +72,7 @@ struct edsc_softc { /* * Attach to the interface cloning framework. */ -static VNET_DEFINE(struct if_clone *, edsc_cloner); +VNET_DEFINE_STATIC(struct if_clone *, edsc_cloner); #define V_edsc_cloner VNET(edsc_cloner) static int edsc_clone_create(struct if_clone *, int, caddr_t); static void edsc_clone_destroy(struct ifnet *); Modified: head/sys/net/if_enc.c ============================================================================== --- head/sys/net/if_enc.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_enc.c Tue Jul 24 16:35:52 2018 (r336676) @@ -86,9 +86,9 @@ struct enchdr { struct enc_softc { struct ifnet *sc_ifp; }; -static VNET_DEFINE(struct enc_softc *, enc_sc); +VNET_DEFINE_STATIC(struct enc_softc *, enc_sc); #define V_enc_sc VNET(enc_sc) -static VNET_DEFINE(struct if_clone *, enc_cloner); +VNET_DEFINE_STATIC(struct if_clone *, enc_cloner); #define V_enc_cloner VNET(enc_cloner) static int enc_ioctl(struct ifnet *, u_long, caddr_t); @@ -111,10 +111,10 @@ static const char encname[] = "enc"; * some changes to the packet, e.g. address translation. If PFIL hook * consumes mbuf, nothing will be captured. */ -static VNET_DEFINE(int, filter_mask_in) = IPSEC_ENC_BEFORE; -static VNET_DEFINE(int, bpf_mask_in) = IPSEC_ENC_BEFORE; -static VNET_DEFINE(int, filter_mask_out) = IPSEC_ENC_BEFORE; -static VNET_DEFINE(int, bpf_mask_out) = IPSEC_ENC_BEFORE | IPSEC_ENC_AFTER; +VNET_DEFINE_STATIC(int, filter_mask_in) = IPSEC_ENC_BEFORE; +VNET_DEFINE_STATIC(int, bpf_mask_in) = IPSEC_ENC_BEFORE; +VNET_DEFINE_STATIC(int, filter_mask_out) = IPSEC_ENC_BEFORE; +VNET_DEFINE_STATIC(int, bpf_mask_out) = IPSEC_ENC_BEFORE | IPSEC_ENC_AFTER; #define V_filter_mask_in VNET(filter_mask_in) #define V_bpf_mask_in VNET(bpf_mask_in) #define V_filter_mask_out VNET(filter_mask_out) Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_epair.c Tue Jul 24 16:35:52 2018 (r336676) @@ -180,7 +180,7 @@ STAILQ_HEAD(eid_list, epair_ifp_drain); static MALLOC_DEFINE(M_EPAIR, epairname, "Pair of virtual cross-over connected Ethernet-like interfaces"); -static VNET_DEFINE(struct if_clone *, epair_cloner); +VNET_DEFINE_STATIC(struct if_clone *, epair_cloner); #define V_epair_cloner VNET(epair_cloner) /* Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_ethersubr.c Tue Jul 24 16:35:52 2018 (r336676) @@ -1291,7 +1291,7 @@ static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLA static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0, "for consistency"); -static VNET_DEFINE(int, soft_pad); +VNET_DEFINE_STATIC(int, soft_pad); #define V_soft_pad VNET(soft_pad) SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(soft_pad), 0, Modified: head/sys/net/if_gif.c ============================================================================== --- head/sys/net/if_gif.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_gif.c Tue Jul 24 16:35:52 2018 (r336676) @@ -110,7 +110,7 @@ static int gif_transmit(struct ifnet *, struct mbuf *) static void gif_qflush(struct ifnet *); static int gif_clone_create(struct if_clone *, int, caddr_t); static void gif_clone_destroy(struct ifnet *); -static VNET_DEFINE(struct if_clone *, gif_cloner); +VNET_DEFINE_STATIC(struct if_clone *, gif_cloner); #define V_gif_cloner VNET(gif_cloner) SYSCTL_DECL(_net_link); @@ -127,7 +127,7 @@ static SYSCTL_NODE(_net_link, IFT_GIF, gif, CTLFLAG_RW */ #define MAX_GIF_NEST 1 #endif -static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST; +VNET_DEFINE_STATIC(int, max_gif_nesting) = MAX_GIF_NEST; #define V_max_gif_nesting VNET(max_gif_nesting) SYSCTL_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(max_gif_nesting), 0, "Max nested tunnels"); Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_gre.c Tue Jul 24 16:35:52 2018 (r336676) @@ -94,7 +94,7 @@ SX_SYSINIT(gre_ioctl_sx, &gre_ioctl_sx, "gre_ioctl"); static int gre_clone_create(struct if_clone *, int, caddr_t); static void gre_clone_destroy(struct ifnet *); -static VNET_DEFINE(struct if_clone *, gre_cloner); +VNET_DEFINE_STATIC(struct if_clone *, gre_cloner); #define V_gre_cloner VNET(gre_cloner) static void gre_qflush(struct ifnet *); @@ -119,7 +119,7 @@ static SYSCTL_NODE(_net_link, IFT_TUNNEL, gre, CTLFLAG #define MAX_GRE_NEST 1 #endif -static VNET_DEFINE(int, max_gre_nesting) = MAX_GRE_NEST; +VNET_DEFINE_STATIC(int, max_gre_nesting) = MAX_GRE_NEST; #define V_max_gre_nesting VNET(max_gre_nesting) SYSCTL_INT(_net_link_gre, OID_AUTO, max_nesting, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(max_gre_nesting), 0, "Max nested tunnels"); Modified: head/sys/net/if_ipsec.c ============================================================================== --- head/sys/net/if_ipsec.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_ipsec.c Tue Jul 24 16:35:52 2018 (r336676) @@ -120,9 +120,9 @@ RM_SYSINIT(ipsec_sc_lock, &ipsec_sc_lock, "if_ipsec so #define IPSEC_SC_WLOCK_ASSERT() rm_assert(&ipsec_sc_lock, RA_WLOCKED) LIST_HEAD(ipsec_iflist, ipsec_softc); -static VNET_DEFINE(struct ipsec_iflist, ipsec_sc_list); -static VNET_DEFINE(struct ipsec_iflist *, ipsec_sc_htbl); -static VNET_DEFINE(u_long, ipsec_sc_hmask); +VNET_DEFINE_STATIC(struct ipsec_iflist, ipsec_sc_list); +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec_sc_htbl); +VNET_DEFINE_STATIC(u_long, ipsec_sc_hmask); #define V_ipsec_sc_list VNET(ipsec_sc_list) #define V_ipsec_sc_htbl VNET(ipsec_sc_htbl) #define V_ipsec_sc_hmask VNET(ipsec_sc_hmask) @@ -162,7 +162,7 @@ static void ipsec_qflush(struct ifnet *); static int ipsec_clone_create(struct if_clone *, int, caddr_t); static void ipsec_clone_destroy(struct ifnet *); -static VNET_DEFINE(struct if_clone *, ipsec_cloner); +VNET_DEFINE_STATIC(struct if_clone *, ipsec_cloner); #define V_ipsec_cloner VNET(ipsec_cloner) static int Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_lagg.c Tue Jul 24 16:35:52 2018 (r336676) @@ -97,7 +97,7 @@ static struct { VNET_DEFINE(SLIST_HEAD(__trhead, lagg_softc), lagg_list); /* list of laggs */ #define V_lagg_list VNET(lagg_list) -static VNET_DEFINE(struct mtx, lagg_list_mtx); +VNET_DEFINE_STATIC(struct mtx, lagg_list_mtx); #define V_lagg_list_mtx VNET(lagg_list_mtx) #define LAGG_LIST_LOCK_INIT(x) mtx_init(&V_lagg_list_mtx, \ "if_lagg list", NULL, MTX_DEF) @@ -108,7 +108,7 @@ eventhandler_tag lagg_detach_cookie = NULL; static int lagg_clone_create(struct if_clone *, int, caddr_t); static void lagg_clone_destroy(struct ifnet *); -static VNET_DEFINE(struct if_clone *, lagg_cloner); +VNET_DEFINE_STATIC(struct if_clone *, lagg_cloner); #define V_lagg_cloner VNET(lagg_cloner) static const char laggname[] = "lagg"; @@ -249,21 +249,21 @@ SYSCTL_NODE(_net_link, OID_AUTO, lagg, CTLFLAG_RW, 0, "Link Aggregation"); /* Allow input on any failover links */ -static VNET_DEFINE(int, lagg_failover_rx_all); +VNET_DEFINE_STATIC(int, lagg_failover_rx_all); #define V_lagg_failover_rx_all VNET(lagg_failover_rx_all) SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(lagg_failover_rx_all), 0, "Accept input from any interface in a failover lagg"); /* Default value for using flowid */ -static VNET_DEFINE(int, def_use_flowid) = 0; +VNET_DEFINE_STATIC(int, def_use_flowid) = 0; #define V_def_use_flowid VNET(def_use_flowid) SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RWTUN, &VNET_NAME(def_use_flowid), 0, "Default setting for using flow id for load sharing"); /* Default value for flowid shift */ -static VNET_DEFINE(int, def_flowid_shift) = 16; +VNET_DEFINE_STATIC(int, def_flowid_shift) = 16; #define V_def_flowid_shift VNET(def_flowid_shift) SYSCTL_INT(_net_link_lagg, OID_AUTO, default_flowid_shift, CTLFLAG_RWTUN, &VNET_NAME(def_flowid_shift), 0, Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_llatbl.c Tue Jul 24 16:35:52 2018 (r336676) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables"); -static VNET_DEFINE(SLIST_HEAD(, lltable), lltables) = +VNET_DEFINE_STATIC(SLIST_HEAD(, lltable), lltables) = SLIST_HEAD_INITIALIZER(lltables); #define V_lltables VNET(lltables) Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_loop.c Tue Jul 24 16:35:52 2018 (r336676) @@ -99,7 +99,7 @@ static void lo_clone_destroy(struct ifnet *); VNET_DEFINE(struct ifnet *, loif); /* Used externally */ #ifdef VIMAGE -static VNET_DEFINE(struct if_clone *, lo_cloner); +VNET_DEFINE_STATIC(struct if_clone *, lo_cloner); #define V_lo_cloner VNET(lo_cloner) #endif Modified: head/sys/net/if_me.c ============================================================================== --- head/sys/net/if_me.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_me.c Tue Jul 24 16:35:52 2018 (r336676) @@ -94,7 +94,7 @@ CK_LIST_HEAD(me_list, me_softc); #ifndef ME_HASH_SIZE #define ME_HASH_SIZE (1 << 4) #endif -static VNET_DEFINE(struct me_list *, me_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct me_list *, me_hashtbl) = NULL; #define V_me_hashtbl VNET(me_hashtbl) #define ME_HASH(src, dst) (V_me_hashtbl[\ me_hashval((src), (dst)) & (ME_HASH_SIZE - 1)]) @@ -104,7 +104,7 @@ SX_SYSINIT(me_ioctl_sx, &me_ioctl_sx, "me_ioctl"); static int me_clone_create(struct if_clone *, int, caddr_t); static void me_clone_destroy(struct ifnet *); -static VNET_DEFINE(struct if_clone *, me_cloner); +VNET_DEFINE_STATIC(struct if_clone *, me_cloner); #define V_me_cloner VNET(me_cloner) static void me_qflush(struct ifnet *); @@ -124,7 +124,7 @@ static SYSCTL_NODE(_net_link, IFT_TUNNEL, me, CTLFLAG_ #define MAX_ME_NEST 1 #endif -static VNET_DEFINE(int, max_me_nesting) = MAX_ME_NEST; +VNET_DEFINE_STATIC(int, max_me_nesting) = MAX_ME_NEST; #define V_max_me_nesting VNET(max_me_nesting) SYSCTL_INT(_net_link_me, OID_AUTO, max_nesting, CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(max_me_nesting), 0, "Max nested tunnels"); Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/if_vlan.c Tue Jul 24 16:35:52 2018 (r336676) @@ -335,7 +335,7 @@ static void vlan_lladdr_fn(void *arg, int pending); static struct if_clone *vlan_cloner; #ifdef VIMAGE -static VNET_DEFINE(struct if_clone *, vlan_cloner); +VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner); #define V_vlan_cloner VNET(vlan_cloner) #endif Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/netisr.c Tue Jul 24 16:35:52 2018 (r336676) @@ -225,7 +225,7 @@ static struct netisr_proto netisr_proto[NETISR_MAXPROT * mechanism to stop netisr processing for vnet teardown. * Apart from that we expect a VNET to always be enabled. */ -static VNET_DEFINE(u_int, netisr_enable[NETISR_MAXPROT]); +VNET_DEFINE_STATIC(u_int, netisr_enable[NETISR_MAXPROT]); #define V_netisr_enable VNET(netisr_enable) #endif Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/route.c Tue Jul 24 16:35:52 2018 (r336676) @@ -137,7 +137,7 @@ VNET_DEFINE(int, rttrash); /* routes not in table but */ #define RNTORT(p) ((struct rtentry *)(p)) -static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ +VNET_DEFINE_STATIC(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) static int rtrequest1_fib_change(struct rib_head *, struct rt_addrinfo *, Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/rtsock.c Tue Jul 24 16:35:52 2018 (r336676) @@ -140,7 +140,7 @@ typedef struct { int ip6_count; /* attached w/ AF_INET6 */ int any_count; /* total attached */ } route_cb_t; -static VNET_DEFINE(route_cb_t, route_cb); +VNET_DEFINE_STATIC(route_cb_t, route_cb); #define V_route_cb VNET(route_cb) struct mtx rtsock_mtx; Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/net/vnet.c Tue Jul 24 16:35:52 2018 (r336676) @@ -178,7 +178,7 @@ static MALLOC_DEFINE(M_VNET_DATA, "vnet_data", "VNET d * Space to store virtualized global variables from loadable kernel modules, * and the free list to manage it. */ -static VNET_DEFINE(char, modspace[VNET_MODMIN]); +VNET_DEFINE_STATIC(char, modspace[VNET_MODMIN]); /* * Global lists of subsystem constructor and destructors for vnets. They are Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netgraph/ng_base.c Tue Jul 24 16:35:52 2018 (r336676) @@ -179,12 +179,12 @@ static struct rwlock ng_typelist_lock; /* Hash related definitions. */ LIST_HEAD(nodehash, ng_node); -static VNET_DEFINE(struct nodehash *, ng_ID_hash); -static VNET_DEFINE(u_long, ng_ID_hmask); -static VNET_DEFINE(u_long, ng_nodes); -static VNET_DEFINE(struct nodehash *, ng_name_hash); -static VNET_DEFINE(u_long, ng_name_hmask); -static VNET_DEFINE(u_long, ng_named_nodes); +VNET_DEFINE_STATIC(struct nodehash *, ng_ID_hash); +VNET_DEFINE_STATIC(u_long, ng_ID_hmask); +VNET_DEFINE_STATIC(u_long, ng_nodes); +VNET_DEFINE_STATIC(struct nodehash *, ng_name_hash); +VNET_DEFINE_STATIC(u_long, ng_name_hmask); +VNET_DEFINE_STATIC(u_long, ng_named_nodes); #define V_ng_ID_hash VNET(ng_ID_hash) #define V_ng_ID_hmask VNET(ng_ID_hmask) #define V_ng_nodes VNET(ng_nodes) @@ -377,7 +377,7 @@ ng_alloc_node(void) #define TRAP_ERROR() #endif -static VNET_DEFINE(ng_ID_t, nextID) = 1; +VNET_DEFINE_STATIC(ng_ID_t, nextID) = 1; #define V_nextID VNET(nextID) #ifdef INVARIANTS Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netgraph/ng_eiface.c Tue Jul 24 16:35:52 2018 (r336676) @@ -122,7 +122,7 @@ static struct ng_type typestruct = { }; NETGRAPH_INIT(eiface, &typestruct); -static VNET_DEFINE(struct unrhdr *, ng_eiface_unit); +VNET_DEFINE_STATIC(struct unrhdr *, ng_eiface_unit); #define V_ng_eiface_unit VNET(ng_eiface_unit) /************************************************************************ Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netgraph/ng_iface.c Tue Jul 24 16:35:52 2018 (r336676) @@ -199,7 +199,7 @@ static struct ng_type typestruct = { }; NETGRAPH_INIT(iface, &typestruct); -static VNET_DEFINE(struct unrhdr *, ng_iface_unit); +VNET_DEFINE_STATIC(struct unrhdr *, ng_iface_unit); #define V_ng_iface_unit VNET(ng_iface_unit) /************************************************************************ Modified: head/sys/netinet/cc/cc_cdg.c ============================================================================== --- head/sys/netinet/cc/cc_cdg.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/cc/cc_cdg.c Tue Jul 24 16:35:52 2018 (r336676) @@ -205,13 +205,13 @@ static MALLOC_DEFINE(M_CDG, "cdg data", static int ertt_id; -static VNET_DEFINE(uint32_t, cdg_alpha_inc); -static VNET_DEFINE(uint32_t, cdg_beta_delay); -static VNET_DEFINE(uint32_t, cdg_beta_loss); -static VNET_DEFINE(uint32_t, cdg_smoothing_factor); -static VNET_DEFINE(uint32_t, cdg_exp_backoff_scale); -static VNET_DEFINE(uint32_t, cdg_consec_cong); -static VNET_DEFINE(uint32_t, cdg_hold_backoff); +VNET_DEFINE_STATIC(uint32_t, cdg_alpha_inc); +VNET_DEFINE_STATIC(uint32_t, cdg_beta_delay); +VNET_DEFINE_STATIC(uint32_t, cdg_beta_loss); +VNET_DEFINE_STATIC(uint32_t, cdg_smoothing_factor); +VNET_DEFINE_STATIC(uint32_t, cdg_exp_backoff_scale); +VNET_DEFINE_STATIC(uint32_t, cdg_consec_cong); +VNET_DEFINE_STATIC(uint32_t, cdg_hold_backoff); #define V_cdg_alpha_inc VNET(cdg_alpha_inc) #define V_cdg_beta_delay VNET(cdg_beta_delay) #define V_cdg_beta_loss VNET(cdg_beta_loss) Modified: head/sys/netinet/cc/cc_chd.c ============================================================================== --- head/sys/netinet/cc/cc_chd.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/cc/cc_chd.c Tue Jul 24 16:35:52 2018 (r336676) @@ -117,11 +117,11 @@ struct chd { static int ertt_id; -static VNET_DEFINE(uint32_t, chd_qmin) = 5; -static VNET_DEFINE(uint32_t, chd_pmax) = 50; -static VNET_DEFINE(uint32_t, chd_loss_fair) = 1; -static VNET_DEFINE(uint32_t, chd_use_max) = 1; -static VNET_DEFINE(uint32_t, chd_qthresh) = 20; +VNET_DEFINE_STATIC(uint32_t, chd_qmin) = 5; +VNET_DEFINE_STATIC(uint32_t, chd_pmax) = 50; +VNET_DEFINE_STATIC(uint32_t, chd_loss_fair) = 1; +VNET_DEFINE_STATIC(uint32_t, chd_use_max) = 1; +VNET_DEFINE_STATIC(uint32_t, chd_qthresh) = 20; #define V_chd_qthresh VNET(chd_qthresh) #define V_chd_qmin VNET(chd_qmin) #define V_chd_pmax VNET(chd_pmax) Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/cc/cc_dctcp.c Tue Jul 24 16:35:52 2018 (r336676) @@ -59,11 +59,11 @@ __FBSDID("$FreeBSD$"); #define CAST_PTR_INT(X) (*((int*)(X))) #define MAX_ALPHA_VALUE 1024 -static VNET_DEFINE(uint32_t, dctcp_alpha) = 0; +VNET_DEFINE_STATIC(uint32_t, dctcp_alpha) = 0; #define V_dctcp_alpha VNET(dctcp_alpha) -static VNET_DEFINE(uint32_t, dctcp_shift_g) = 4; +VNET_DEFINE_STATIC(uint32_t, dctcp_shift_g) = 4; #define V_dctcp_shift_g VNET(dctcp_shift_g) -static VNET_DEFINE(uint32_t, dctcp_slowstart) = 0; +VNET_DEFINE_STATIC(uint32_t, dctcp_slowstart) = 0; #define V_dctcp_slowstart VNET(dctcp_slowstart) struct dctcp { Modified: head/sys/netinet/cc/cc_hd.c ============================================================================== --- head/sys/netinet/cc/cc_hd.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/cc/cc_hd.c Tue Jul 24 16:35:52 2018 (r336676) @@ -89,9 +89,9 @@ static int hd_mod_init(void); static int ertt_id; -static VNET_DEFINE(uint32_t, hd_qthresh) = 20; -static VNET_DEFINE(uint32_t, hd_qmin) = 5; -static VNET_DEFINE(uint32_t, hd_pmax) = 5; +VNET_DEFINE_STATIC(uint32_t, hd_qthresh) = 20; +VNET_DEFINE_STATIC(uint32_t, hd_qmin) = 5; +VNET_DEFINE_STATIC(uint32_t, hd_pmax) = 5; #define V_hd_qthresh VNET(hd_qthresh) #define V_hd_qmin VNET(hd_qmin) #define V_hd_pmax VNET(hd_pmax) Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/cc/cc_htcp.c Tue Jul 24 16:35:52 2018 (r336676) @@ -170,8 +170,8 @@ static int htcp_rtt_ref; static int htcp_max_diff = INT_MAX / ((1 << HTCP_ALPHA_INC_SHIFT) * 10); /* Per-netstack vars. */ -static VNET_DEFINE(u_int, htcp_adaptive_backoff) = 0; -static VNET_DEFINE(u_int, htcp_rtt_scaling) = 0; +VNET_DEFINE_STATIC(u_int, htcp_adaptive_backoff) = 0; +VNET_DEFINE_STATIC(u_int, htcp_rtt_scaling) = 0; #define V_htcp_adaptive_backoff VNET(htcp_adaptive_backoff) #define V_htcp_rtt_scaling VNET(htcp_rtt_scaling) Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/cc/cc_newreno.c Tue Jul 24 16:35:52 2018 (r336676) @@ -88,8 +88,8 @@ static void newreno_cong_signal(struct cc_var *ccv, ui static void newreno_post_recovery(struct cc_var *ccv); static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf); -static VNET_DEFINE(uint32_t, newreno_beta) = 50; -static VNET_DEFINE(uint32_t, newreno_beta_ecn) = 80; +VNET_DEFINE_STATIC(uint32_t, newreno_beta) = 50; +VNET_DEFINE_STATIC(uint32_t, newreno_beta_ecn) = 80; #define V_newreno_beta VNET(newreno_beta) #define V_newreno_beta_ecn VNET(newreno_beta_ecn) Modified: head/sys/netinet/cc/cc_vegas.c ============================================================================== --- head/sys/netinet/cc/cc_vegas.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/cc/cc_vegas.c Tue Jul 24 16:35:52 2018 (r336676) @@ -100,8 +100,8 @@ struct vegas { static int32_t ertt_id; -static VNET_DEFINE(uint32_t, vegas_alpha) = 1; -static VNET_DEFINE(uint32_t, vegas_beta) = 3; +VNET_DEFINE_STATIC(uint32_t, vegas_alpha) = 1; +VNET_DEFINE_STATIC(uint32_t, vegas_beta) = 3; #define V_vegas_alpha VNET(vegas_alpha) #define V_vegas_beta VNET(vegas_beta) Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/if_ether.c Tue Jul 24 16:35:52 2018 (r336676) @@ -94,13 +94,13 @@ static SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTL static SYSCTL_NODE(_net_link_ether, PF_ARP, arp, CTLFLAG_RW, 0, ""); /* timer values */ -static VNET_DEFINE(int, arpt_keep) = (20*60); /* once resolved, good for 20 +VNET_DEFINE_STATIC(int, arpt_keep) = (20*60); /* once resolved, good for 20 * minutes */ -static VNET_DEFINE(int, arp_maxtries) = 5; -static VNET_DEFINE(int, arp_proxyall) = 0; -static VNET_DEFINE(int, arpt_down) = 20; /* keep incomplete entries for +VNET_DEFINE_STATIC(int, arp_maxtries) = 5; +VNET_DEFINE_STATIC(int, arp_proxyall) = 0; +VNET_DEFINE_STATIC(int, arpt_down) = 20; /* keep incomplete entries for * 20 seconds */ -static VNET_DEFINE(int, arpt_rexmit) = 1; /* retransmit arp entries, sec*/ +VNET_DEFINE_STATIC(int, arpt_rexmit) = 1; /* retransmit arp entries, sec*/ VNET_PCPUSTAT_DEFINE(struct arpstat, arpstat); /* ARP statistics, see if_arp.h */ VNET_PCPUSTAT_SYSINIT(arpstat); @@ -108,7 +108,7 @@ VNET_PCPUSTAT_SYSINIT(arpstat); VNET_PCPUSTAT_SYSUNINIT(arpstat); #endif /* VIMAGE */ -static VNET_DEFINE(int, arp_maxhold) = 1; +VNET_DEFINE_STATIC(int, arp_maxhold) = 1; #define V_arpt_keep VNET(arpt_keep) #define V_arpt_down VNET(arpt_down) Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/igmp.c Tue Jul 24 16:35:52 2018 (r336676) @@ -217,11 +217,11 @@ static MALLOC_DEFINE(M_IGMP, "igmp", "igmp state"); * FUTURE: Stop using IFP_TO_IA/INADDR_ANY, and use source address selection * policy to control the address used by IGMP on the link. */ -static VNET_DEFINE(int, interface_timers_running); /* IGMPv3 general +VNET_DEFINE_STATIC(int, interface_timers_running); /* IGMPv3 general * query response */ -static VNET_DEFINE(int, state_change_timers_running); /* IGMPv3 state-change +VNET_DEFINE_STATIC(int, state_change_timers_running); /* IGMPv3 state-change * retransmit */ -static VNET_DEFINE(int, current_state_timers_running); /* IGMPv1/v2 host +VNET_DEFINE_STATIC(int, current_state_timers_running); /* IGMPv1/v2 host * report; IGMPv3 g/sg * query response */ @@ -229,25 +229,25 @@ static VNET_DEFINE(int, current_state_timers_running); #define V_state_change_timers_running VNET(state_change_timers_running) #define V_current_state_timers_running VNET(current_state_timers_running) -static VNET_DEFINE(LIST_HEAD(, igmp_ifsoftc), igi_head) = +VNET_DEFINE_STATIC(LIST_HEAD(, igmp_ifsoftc), igi_head) = LIST_HEAD_INITIALIZER(igi_head); -static VNET_DEFINE(struct igmpstat, igmpstat) = { +VNET_DEFINE_STATIC(struct igmpstat, igmpstat) = { .igps_version = IGPS_VERSION_3, .igps_len = sizeof(struct igmpstat), }; -static VNET_DEFINE(struct timeval, igmp_gsrdelay) = {10, 0}; +VNET_DEFINE_STATIC(struct timeval, igmp_gsrdelay) = {10, 0}; #define V_igi_head VNET(igi_head) #define V_igmpstat VNET(igmpstat) #define V_igmp_gsrdelay VNET(igmp_gsrdelay) -static VNET_DEFINE(int, igmp_recvifkludge) = 1; -static VNET_DEFINE(int, igmp_sendra) = 1; -static VNET_DEFINE(int, igmp_sendlocal) = 1; -static VNET_DEFINE(int, igmp_v1enable) = 1; -static VNET_DEFINE(int, igmp_v2enable) = 1; -static VNET_DEFINE(int, igmp_legacysupp); -static VNET_DEFINE(int, igmp_default_version) = IGMP_VERSION_3; +VNET_DEFINE_STATIC(int, igmp_recvifkludge) = 1; +VNET_DEFINE_STATIC(int, igmp_sendra) = 1; +VNET_DEFINE_STATIC(int, igmp_sendlocal) = 1; +VNET_DEFINE_STATIC(int, igmp_v1enable) = 1; +VNET_DEFINE_STATIC(int, igmp_v2enable) = 1; +VNET_DEFINE_STATIC(int, igmp_legacysupp); +VNET_DEFINE_STATIC(int, igmp_default_version) = IGMP_VERSION_3; #define V_igmp_recvifkludge VNET(igmp_recvifkludge) #define V_igmp_sendra VNET(igmp_sendra) Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/in.c Tue Jul 24 16:35:52 2018 (r336676) @@ -78,7 +78,7 @@ static int in_difaddr_ioctl(u_long, caddr_t, struct if static void in_socktrim(struct sockaddr_in *); static void in_purgemaddrs(struct ifnet *); -static VNET_DEFINE(int, nosameprefix); +VNET_DEFINE_STATIC(int, nosameprefix); #define V_nosameprefix VNET(nosameprefix) SYSCTL_INT(_net_inet_ip, OID_AUTO, no_same_prefix, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nosameprefix), 0, Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/in_gif.c Tue Jul 24 16:35:52 2018 (r336676) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include <net/if_gif.h> #define GIF_TTL 30 -static VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; +VNET_DEFINE_STATIC(int, ip_gif_ttl) = GIF_TTL; #define V_ip_gif_ttl VNET(ip_gif_ttl) SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_gif_ttl), 0, "Default TTL value for encapsulated packets"); @@ -81,8 +81,8 @@ SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLA * We keep interfaces in a hash table using src+dst as key. * Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list. */ -static VNET_DEFINE(struct gif_list *, ipv4_hashtbl) = NULL; -static VNET_DEFINE(struct gif_list, ipv4_list) = CK_LIST_HEAD_INITIALIZER(); +VNET_DEFINE_STATIC(struct gif_list *, ipv4_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gif_list, ipv4_list) = CK_LIST_HEAD_INITIALIZER(); #define V_ipv4_hashtbl VNET(ipv4_hashtbl) #define V_ipv4_list VNET(ipv4_list) Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/in_pcb.c Tue Jul 24 16:35:52 2018 (r336676) @@ -138,7 +138,7 @@ VNET_DEFINE(int, ipport_randomcps) = 10; /* user contr VNET_DEFINE(int, ipport_randomtime) = 45; /* user controlled via sysctl */ VNET_DEFINE(int, ipport_stoprandom); /* toggled by ipport_tick */ VNET_DEFINE(int, ipport_tcpallocs); -static VNET_DEFINE(int, ipport_tcplastcount); +VNET_DEFINE_STATIC(int, ipport_tcplastcount); #define V_ipport_tcplastcount VNET(ipport_tcplastcount) Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/ip_carp.c Tue Jul 24 16:35:52 2018 (r336676) @@ -187,31 +187,31 @@ static int proto_reg[] = {-1, -1}; */ /* Accept incoming CARP packets. */ -static VNET_DEFINE(int, carp_allow) = 1; +VNET_DEFINE_STATIC(int, carp_allow) = 1; #define V_carp_allow VNET(carp_allow) /* Set DSCP in outgoing CARP packets. */ -static VNET_DEFINE(int, carp_dscp) = 56; +VNET_DEFINE_STATIC(int, carp_dscp) = 56; #define V_carp_dscp VNET(carp_dscp) /* Preempt slower nodes. */ -static VNET_DEFINE(int, carp_preempt) = 0; +VNET_DEFINE_STATIC(int, carp_preempt) = 0; #define V_carp_preempt VNET(carp_preempt) /* Log level. */ -static VNET_DEFINE(int, carp_log) = 1; +VNET_DEFINE_STATIC(int, carp_log) = 1; #define V_carp_log VNET(carp_log) /* Global advskew demotion. */ -static VNET_DEFINE(int, carp_demotion) = 0; +VNET_DEFINE_STATIC(int, carp_demotion) = 0; #define V_carp_demotion VNET(carp_demotion) /* Send error demotion factor. */ -static VNET_DEFINE(int, carp_senderr_adj) = CARP_MAXSKEW; +VNET_DEFINE_STATIC(int, carp_senderr_adj) = CARP_MAXSKEW; #define V_carp_senderr_adj VNET(carp_senderr_adj) /* Iface down demotion factor. */ -static VNET_DEFINE(int, carp_ifdown_adj) = CARP_MAXSKEW; +VNET_DEFINE_STATIC(int, carp_ifdown_adj) = CARP_MAXSKEW; #define V_carp_ifdown_adj VNET(carp_ifdown_adj) static int carp_allow_sysctl(SYSCTL_HANDLER_ARGS); Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/ip_divert.c Tue Jul 24 16:35:52 2018 (r336676) @@ -111,8 +111,8 @@ __FBSDID("$FreeBSD$"); */ /* Internal variables. */ -static VNET_DEFINE(struct inpcbhead, divcb); -static VNET_DEFINE(struct inpcbinfo, divcbinfo); +VNET_DEFINE_STATIC(struct inpcbhead, divcb); +VNET_DEFINE_STATIC(struct inpcbinfo, divcbinfo); #define V_divcb VNET(divcb) #define V_divcbinfo VNET(divcbinfo) Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/ip_gre.c Tue Jul 24 16:35:52 2018 (r336676) @@ -74,7 +74,7 @@ VNET_DEFINE(int, ip_gre_ttl) = GRE_TTL; SYSCTL_INT(_net_inet_ip, OID_AUTO, grettl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_gre_ttl), 0, "Default TTL value for encapsulated packets"); -static VNET_DEFINE(struct gre_list *, ipv4_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gre_list *, ipv4_hashtbl) = NULL; #define V_ipv4_hashtbl VNET(ipv4_hashtbl) #define GRE_HASH(src, dst) (V_ipv4_hashtbl[\ in_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/ip_icmp.c Tue Jul 24 16:35:52 2018 (r336676) @@ -82,13 +82,13 @@ __FBSDID("$FreeBSD$"); * routines to turnaround packets back to the originator, and * host table maintenance routines. */ -static VNET_DEFINE(int, icmplim) = 200; +VNET_DEFINE_STATIC(int, icmplim) = 200; #define V_icmplim VNET(icmplim) SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmplim), 0, "Maximum number of ICMP responses per second"); -static VNET_DEFINE(int, icmplim_output) = 1; +VNET_DEFINE_STATIC(int, icmplim_output) = 1; #define V_icmplim_output VNET(icmplim_output) SYSCTL_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmplim_output), 0, @@ -104,13 +104,13 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_icmp, ICMPCTL_STATS, st VNET_PCPUSTAT_SYSUNINIT(icmpstat); #endif /* VIMAGE */ -static VNET_DEFINE(int, icmpmaskrepl) = 0; +VNET_DEFINE_STATIC(int, icmpmaskrepl) = 0; #define V_icmpmaskrepl VNET(icmpmaskrepl) SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmpmaskrepl), 0, "Reply to ICMP Address Mask Request packets"); -static VNET_DEFINE(u_int, icmpmaskfake) = 0; +VNET_DEFINE_STATIC(u_int, icmpmaskfake) = 0; #define V_icmpmaskfake VNET(icmpmaskfake) SYSCTL_UINT(_net_inet_icmp, OID_AUTO, maskfake, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmpmaskfake), 0, @@ -122,37 +122,37 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, drop_redirect, CT &VNET_NAME(drop_redirect), 0, "Ignore ICMP redirects"); -static VNET_DEFINE(int, log_redirect) = 0; +VNET_DEFINE_STATIC(int, log_redirect) = 0; #define V_log_redirect VNET(log_redirect) SYSCTL_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(log_redirect), 0, "Log ICMP redirects to the console"); -static VNET_DEFINE(char, reply_src[IFNAMSIZ]); +VNET_DEFINE_STATIC(char, reply_src[IFNAMSIZ]); #define V_reply_src VNET(reply_src) SYSCTL_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(reply_src), IFNAMSIZ, "ICMP reply source for non-local packets"); -static VNET_DEFINE(int, icmp_rfi) = 0; +VNET_DEFINE_STATIC(int, icmp_rfi) = 0; #define V_icmp_rfi VNET(icmp_rfi) SYSCTL_INT(_net_inet_icmp, OID_AUTO, reply_from_interface, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp_rfi), 0, "ICMP reply from incoming interface for non-local packets"); /* Router requirements RFC 1812 section 4.3.2.3 requires 576 - 28. */ -static VNET_DEFINE(int, icmp_quotelen) = 548; +VNET_DEFINE_STATIC(int, icmp_quotelen) = 8; #define V_icmp_quotelen VNET(icmp_quotelen) SYSCTL_INT(_net_inet_icmp, OID_AUTO, quotelen, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp_quotelen), 0, "Number of bytes from original packet to quote in ICMP reply"); -static VNET_DEFINE(int, icmpbmcastecho) = 0; +VNET_DEFINE_STATIC(int, icmpbmcastecho) = 0; #define V_icmpbmcastecho VNET(icmpbmcastecho) SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmpbmcastecho), 0, "Reply to multicast ICMP Echo Request and Timestamp packets"); -static VNET_DEFINE(int, icmptstamprepl) = 1; +VNET_DEFINE_STATIC(int, icmptstamprepl) = 1; #define V_icmptstamprepl VNET(icmptstamprepl) SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFLAG_RW, &VNET_NAME(icmptstamprepl), 0, @@ -1001,7 +1001,7 @@ struct icmp_rate { const char *descr; struct counter_rate cr; }; -static VNET_DEFINE(struct icmp_rate, icmp_rates[BANDLIM_MAX]) = { +VNET_DEFINE_STATIC(struct icmp_rate, icmp_rates[BANDLIM_MAX]) = { { "icmp unreach response" }, { "icmp ping response" }, { "icmp tstamp response" }, Modified: head/sys/netinet/ip_id.c ============================================================================== --- head/sys/netinet/ip_id.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/ip_id.c Tue Jul 24 16:35:52 2018 (r336676) @@ -98,8 +98,8 @@ __FBSDID("$FreeBSD$"); * suggested by RFC6864. We use per-CPU counter for that, or if * user wants to, we can turn on random ID generation. */ -static VNET_DEFINE(int, ip_rfc6864) = 1; -static VNET_DEFINE(int, ip_do_randomid) = 0; +VNET_DEFINE_STATIC(int, ip_rfc6864) = 1; +VNET_DEFINE_STATIC(int, ip_do_randomid) = 0; #define V_ip_rfc6864 VNET(ip_rfc6864) #define V_ip_do_randomid VNET(ip_do_randomid) @@ -107,13 +107,13 @@ static VNET_DEFINE(int, ip_do_randomid) = 0; * Random ID state engine. */ static MALLOC_DEFINE(M_IPID, "ipid", "randomized ip id state"); -static VNET_DEFINE(uint16_t *, id_array); -static VNET_DEFINE(bitstr_t *, id_bits); -static VNET_DEFINE(int, array_ptr); -static VNET_DEFINE(int, array_size); -static VNET_DEFINE(int, random_id_collisions); -static VNET_DEFINE(int, random_id_total); -static VNET_DEFINE(struct mtx, ip_id_mtx); +VNET_DEFINE_STATIC(uint16_t *, id_array); +VNET_DEFINE_STATIC(bitstr_t *, id_bits); +VNET_DEFINE_STATIC(int, array_ptr); +VNET_DEFINE_STATIC(int, array_size); +VNET_DEFINE_STATIC(int, random_id_collisions); +VNET_DEFINE_STATIC(int, random_id_total); +VNET_DEFINE_STATIC(struct mtx, ip_id_mtx); #define V_id_array VNET(id_array) #define V_id_bits VNET(id_bits) #define V_array_ptr VNET(array_ptr) @@ -125,7 +125,7 @@ static VNET_DEFINE(struct mtx, ip_id_mtx); /* * Non-random ID state engine is simply a per-cpu counter. */ -static VNET_DEFINE(counter_u64_t, ip_id); +VNET_DEFINE_STATIC(counter_u64_t, ip_id); #define V_ip_id VNET(ip_id) static int sysctl_ip_randomid(SYSCTL_HANDLER_ARGS); Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/ip_input.c Tue Jul 24 16:35:52 2018 (r336676) @@ -109,7 +109,7 @@ SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, &VNET_NAME(ipforwarding), 0, "Enable IP forwarding between interfaces"); -static VNET_DEFINE(int, ipsendredirects) = 1; /* XXX */ +VNET_DEFINE_STATIC(int, ipsendredirects) = 1; /* XXX */ #define V_ipsendredirects VNET(ipsendredirects) SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipsendredirects), 0, @@ -128,7 +128,7 @@ SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect * to the loopback interface instead of the interface where the * packets for those addresses are received. */ -static VNET_DEFINE(int, ip_checkinterface); +VNET_DEFINE_STATIC(int, ip_checkinterface); #define V_ip_checkinterface VNET(ip_checkinterface) SYSCTL_INT(_net_inet_ip, OID_AUTO, check_interface, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_checkinterface), 0, @@ -1347,7 +1347,7 @@ makedummy: * locking. This code remains in ip_input.c as ip_mroute.c is optionally * compiled. */ -static VNET_DEFINE(int, ip_rsvp_on); +VNET_DEFINE_STATIC(int, ip_rsvp_on); VNET_DEFINE(struct socket *, ip_rsvpd); #define V_ip_rsvp_on VNET(ip_rsvp_on) Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Tue Jul 24 16:34:58 2018 (r336675) +++ head/sys/netinet/ip_mroute.c Tue Jul 24 16:35:52 2018 (r336676) @@ -125,7 +125,7 @@ __FBSDID("$FreeBSD$"); #define VIFI_INVALID ((vifi_t) -1) -static VNET_DEFINE(uint32_t, last_tv_sec); /* last time we processed this */ +VNET_DEFINE_STATIC(uint32_t, last_tv_sec); /* last time we processed this */ #define V_last_tv_sec VNET(last_tv_sec) static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast forwarding cache"); @@ -149,14 +149,14 @@ static struct mtx mrouter_mtx; static int ip_mrouter_cnt; /* # of vnets with active mrouters */ static int ip_mrouter_unloading; /* Allow no more V_ip_mrouter sockets */ -static VNET_PCPUSTAT_DEFINE(struct mrtstat, mrtstat); +VNET_PCPUSTAT_DEFINE_STATIC(struct mrtstat, mrtstat); VNET_PCPUSTAT_SYSINIT(mrtstat); VNET_PCPUSTAT_SYSUNINIT(mrtstat); SYSCTL_VNET_PCPUSTAT(_net_inet_ip, OID_AUTO, mrtstat, struct mrtstat, mrtstat, "IPv4 Multicast Forwarding Statistics (struct mrtstat, " "netinet/ip_mroute.h)"); -static VNET_DEFINE(u_long, mfchash); +VNET_DEFINE_STATIC(u_long, mfchash); #define V_mfchash VNET(mfchash) #define MFCHASH(a, g) \ ((((a).s_addr >> 20) ^ ((a).s_addr >> 10) ^ (a).s_addr ^ \ @@ -164,9 +164,9 @@ static VNET_DEFINE(u_long, mfchash); #define MFCHASHSIZE 256 static u_long mfchashsize; /* Hash size */ -static VNET_DEFINE(u_char *, nexpire); /* 0..mfchashsize-1 */ +VNET_DEFINE_STATIC(u_char *, nexpire); /* 0..mfchashsize-1 */ #define V_nexpire VNET(nexpire) -static VNET_DEFINE(LIST_HEAD(mfchashhdr, mfc)*, mfchashtbl); *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807241635.w6OGZqEx034325>