Date: Tue, 18 Nov 2008 11:10:18 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 153124 for review Message-ID: <200811181110.mAIBAIfM025305@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=153124 Change 153124 by zec@zec_tca51 on 2008/11/18 11:10:11 Revert non-essential changes (i.e. misc. INIT_VNET lines, SYSCTL_FOO to SYSCTL_V_FOO conversions, some WS noise) in order to reduce the diff against head. These changes will be merged back to vimage-commit2 after vimage-commit2 gets commited to head first... Affected files ... .. //depot/projects/vimage-commit2/src/sys/net/if_loop.c#11 edit .. //depot/projects/vimage-commit2/src/sys/net/route.c#17 edit .. //depot/projects/vimage-commit2/src/sys/netinet/in_pcb.c#22 edit .. //depot/projects/vimage-commit2/src/sys/netinet/in_rmx.c#16 edit .. //depot/projects/vimage-commit2/src/sys/netinet/ip_divert.c#13 edit .. //depot/projects/vimage-commit2/src/sys/netinet/ip_fw_pfil.c#7 edit .. //depot/projects/vimage-commit2/src/sys/netinet/ip_output.c#9 edit .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_input.c#23 edit .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_reass.c#10 edit .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#24 edit .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_syncache.c#25 edit .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_timewait.c#11 edit .. //depot/projects/vimage-commit2/src/sys/netinet/udp_usrreq.c#21 edit .. //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#15 edit .. //depot/projects/vimage-commit2/src/sys/netinet6/nd6_nbr.c#13 edit .. //depot/projects/vimage-commit2/src/sys/netinet6/raw_ip6.c#14 edit .. //depot/projects/vimage-commit2/src/sys/netinet6/vinet6.h#9 edit .. //depot/projects/vimage-commit2/src/sys/netipsec/key.c#15 edit .. //depot/projects/vimage-commit2/src/sys/netipsec/keysock.c#11 edit .. //depot/projects/vimage-commit2/src/sys/netipsec/vipsec.h#6 edit Differences ... ==== //depot/projects/vimage-commit2/src/sys/net/if_loop.c#11 (text+ko) ==== @@ -141,7 +141,6 @@ static int loop_modevent(module_t mod, int type, void *data) { - INIT_VNET_NET(curvnet); switch (type) { case MOD_LOAD: ==== //depot/projects/vimage-commit2/src/sys/net/route.c#17 (text+ko) ==== @@ -145,7 +145,6 @@ static void route_init(void) { - INIT_VNET_INET(curvnet); int table; struct domain *dom; int fam; ==== //depot/projects/vimage-commit2/src/sys/netinet/in_pcb.c#22 (text+ko) ==== @@ -120,7 +120,6 @@ static int sysctl_net_ipport_check(SYSCTL_HANDLER_ARGS) { - INIT_VNET_INET(curvnet); int error; error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req); ==== //depot/projects/vimage-commit2/src/sys/netinet/in_rmx.c#16 (text+ko) ==== @@ -287,7 +287,6 @@ static void in_rtqtimo_one(void *rock) { - INIT_VNET_INET(curvnet); struct radix_node_head *rnh = rock; struct rtqk_arg arg; static time_t last_adjusted_timeout = 0; ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_divert.c#13 (text+ko) ==== @@ -580,7 +580,6 @@ static int div_pcblist(SYSCTL_HANDLER_ARGS) { - INIT_VNET_INET(curvnet); int error, i, n; struct inpcb *inp, **inp_list; inp_gen_t gencnt; ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_fw_pfil.c#7 (text+ko) ==== @@ -487,7 +487,6 @@ int ipfw_chg_hook(SYSCTL_HANDLER_ARGS) { - INIT_VNET_IPFW(curvnet); int enable = *(int *)arg1; int error; ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_output.c#9 (text+ko) ==== @@ -111,8 +111,6 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, struct ip_moptions *imo, struct inpcb *inp) { - INIT_VNET_NET(curvnet); - INIT_VNET_INET(curvnet); struct ip *ip; struct ifnet *ifp = NULL; /* keep compiler happy */ struct mbuf *m0; @@ -630,7 +628,6 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, u_long if_hwassist_flags, int sw_csum) { - INIT_VNET_INET(curvnet); int error = 0; int hlen = ip->ip_hl << 2; int len = (mtu - hlen) & ~7; /* size of payload in each fragment */ ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_input.c#23 (text+ko) ==== @@ -2989,7 +2989,6 @@ int isipv6; #endif KASSERT(tp != NULL, ("%s: tp == NULL", __func__)); - INIT_VNET_INET(tp->t_vnet); tcp_mss_update(tp, offer, &metrics); ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_reass.c#10 (text+ko) ==== @@ -115,7 +115,6 @@ void tcp_reass_init(void) { - INIT_VNET_INET(curvnet); V_tcp_reass_maxseg = 0; V_tcp_reass_qsize = 0; ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#24 (text+ko) ==== @@ -130,7 +130,7 @@ static int sysctl_net_inet_tcp_mss_check(SYSCTL_HANDLER_ARGS) { - INIT_VNET_INET(curvnet); + INIT_VNET_INET(TD_TO_VNET(curthread)); int error, new; new = V_tcp_mssdflt; @@ -144,16 +144,15 @@ return (error); } -SYSCTL_V_PROC(V_NET, vnet_inet, _net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, - CTLTYPE_INT|CTLFLAG_RW, tcp_mssdflt, 0, - &sysctl_net_inet_tcp_mss_check, "I", - "Default TCP Maximum Segment Size"); +SYSCTL_PROC(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, CTLTYPE_INT|CTLFLAG_RW, + &tcp_mssdflt, 0, &sysctl_net_inet_tcp_mss_check, "I", + "Default TCP Maximum Segment Size"); #ifdef INET6 static int sysctl_net_inet_tcp_mss_v6_check(SYSCTL_HANDLER_ARGS) { - INIT_VNET_INET6(curvnet); + INIT_VNET_INET6(TD_TO_VNET(curthread)); int error, new; new = V_tcp_v6mssdflt; @@ -167,10 +166,9 @@ return (error); } -SYSCTL_V_PROC(V_NET, vnet_inet, _net_inet_tcp, TCPCTL_V6MSSDFLT, v6mssdflt, - CTLTYPE_INT|CTLFLAG_RW, tcp_v6mssdflt, 0, - &sysctl_net_inet_tcp_mss_v6_check, "I", - "Default TCP Maximum Segment Size for IPv6"); +SYSCTL_PROC(_net_inet_tcp, TCPCTL_V6MSSDFLT, v6mssdflt, CTLTYPE_INT|CTLFLAG_RW, + &tcp_v6mssdflt, 0, &sysctl_net_inet_tcp_mss_v6_check, "I", + "Default TCP Maximum Segment Size for IPv6"); #endif /* @@ -227,9 +225,9 @@ SYSCTL_INT(_net_inet_tcp_inflight, OID_AUTO, debug, CTLFLAG_RW, &tcp_inflight_debug, 0, "Debug TCP inflight calculations"); -SYSCTL_V_PROC(V_NET, vnet_inet, _net_inet_tcp_inflight, OID_AUTO, rttthresh, - CTLTYPE_INT|CTLFLAG_RW, tcp_inflight_rttthresh, 0, sysctl_msec_to_ticks, - "I", "RTT threshold below which inflight will deactivate itself"); +SYSCTL_PROC(_net_inet_tcp_inflight, OID_AUTO, rttthresh, CTLTYPE_INT|CTLFLAG_RW, + &tcp_inflight_rttthresh, 0, sysctl_msec_to_ticks, "I", + "RTT threshold below which inflight will deactivate itself"); SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp_inflight, OID_AUTO, min, CTLFLAG_RW, tcp_inflight_min, 0, "Lower-bound for TCP inflight window"); @@ -344,7 +342,6 @@ V_tcp_sack_globalmaxholes = 65536; V_tcp_sack_globalholes = 0; - hashsize = TCBHASHSIZE; tcp_delacktime = TCPTV_DELACK; tcp_keepinit = TCPTV_KEEP_INIT; tcp_keepidle = TCPTV_KEEP_IDLE; @@ -361,6 +358,7 @@ INP_INFO_LOCK_INIT(&V_tcbinfo, "tcp"); LIST_INIT(&V_tcb); V_tcbinfo.ipi_listhead = &V_tcb; + hashsize = TCBHASHSIZE; TUNABLE_INT_FETCH("net.inet.tcp.tcbhashsize", &hashsize); if (!powerof2(hashsize)) { printf("WARNING: TCB hash size not a power of 2\n"); @@ -949,9 +947,6 @@ tcp_notify(struct inpcb *inp, int error) { struct tcpcb *tp; -#ifdef INVARIANTS - INIT_VNET_INET(inp->inp_vnet); /* V_tcbinfo WLOCK ASSERT */ -#endif INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); @@ -1945,7 +1940,6 @@ tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen, u_char *buf, u_int direction) { - INIT_VNET_IPSEC(curvnet); union sockaddr_union dst; struct ippseudo ippseudo; MD5_CTX ctx; ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_syncache.c#25 (text+ko) ==== @@ -105,12 +105,12 @@ int tcp_sc_rst_sock_fail; #endif -SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, syncookies, - CTLFLAG_RW, tcp_syncookies, 0, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, syncookies, CTLFLAG_RW, + &tcp_syncookies, 0, "Use TCP SYN cookies if the syncache overflows"); -SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, syncookies_only, - CTLFLAG_RW, tcp_syncookiesonly, 0, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, syncookies_only, CTLFLAG_RW, + &tcp_syncookiesonly, 0, "Use only TCP SYN cookies"); #ifdef TCP_OFFLOAD_DISABLE @@ -359,13 +359,11 @@ syncache_timer(void *xsch) { struct syncache_head *sch = (struct syncache_head *)xsch; + INIT_VNET_INET(sch->sch_vnet); struct syncache *sc, *nsc; int tick = ticks; char *s; - CURVNET_SET(sch->sch_vnet); - INIT_VNET_INET(sch->sch_vnet); - /* NB: syncache_head has already been locked by the callout. */ SCH_LOCK_ASSERT(sch); @@ -414,7 +412,6 @@ if (!TAILQ_EMPTY(&(sch)->sch_bucket)) callout_reset(&(sch)->sch_timer, (sch)->sch_nextc - tick, syncache_timer, (void *)(sch)); - CURVNET_RESTORE(); } /* @@ -839,7 +836,7 @@ * B. check that the syncookie is valid. If it is, then * cobble up a fake syncache entry, and return. */ - if (!V_tcp_syncookies) { + if (!tcp_syncookies) { SCH_UNLOCK(sch); if ((s = tcp_log_addrs(inc, th, NULL, NULL))) log(LOG_DEBUG, "%s; %s: Spurious ACK, " @@ -932,7 +929,6 @@ tcp_offload_syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, struct socket **lsop, struct mbuf *m) { - INIT_VNET_INET(curvnet); int rc; INP_INFO_WLOCK(&V_tcbinfo); ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_timewait.c#11 (text+ko) ==== @@ -150,8 +150,8 @@ &maxtcptw, 0, sysctl_maxtcptw, "IU", "Maximum number of compressed TCP TIME_WAIT entries"); -SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_tcp, OID_AUTO, nolocaltimewait, - CTLFLAG_RW, nolocaltimewait, 0, +SYSCTL_INT(_net_inet_tcp, OID_AUTO, nolocaltimewait, CTLFLAG_RW, + &nolocaltimewait, 0, "Do not create compressed TCP TIME_WAIT entries for local connections"); void ==== //depot/projects/vimage-commit2/src/sys/netinet/udp_usrreq.c#21 (text+ko) ==== @@ -113,8 +113,7 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, log_in_vain, CTLFLAG_RW, &udp_log_in_vain, 0, "Log all incoming UDP packets"); -SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_udp, OID_AUTO, blackhole, - CTLFLAG_RW, udp_blackhole, 0, +SYSCTL_INT(_net_inet_udp, OID_AUTO, blackhole, CTLFLAG_RW, &udp_blackhole, 0, "Do not send port unreachables for refused connects"); u_long udp_sendspace = 9216; /* really max datagram size */ ==== //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#15 (text+ko) ==== @@ -225,14 +225,14 @@ static int rtq_toomany6 = 128; /* 128 cached routes is ``too many'' */ #endif -SYSCTL_V_INT(V_NET, vnet_inet6, _net_inet6_ip6, IPV6CTL_RTEXPIRE, rtexpire, - CTLFLAG_RW, rtq_reallyold6 , 0, ""); +SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTEXPIRE, rtexpire, + CTLFLAG_RW, &rtq_reallyold6 , 0, ""); -SYSCTL_V_INT(V_NET, vnet_inet6, _net_inet6_ip6, IPV6CTL_RTMINEXPIRE, - rtminexpire, CTLFLAG_RW, rtq_minreallyold6 , 0, ""); +SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTMINEXPIRE, rtminexpire, + CTLFLAG_RW, &rtq_minreallyold6 , 0, ""); -SYSCTL_V_INT(V_NET, vnet_inet6, _net_inet6_ip6, IPV6CTL_RTMAXCACHE, rtmaxcache, - CTLFLAG_RW, rtq_toomany6 , 0, ""); +SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RTMAXCACHE, rtmaxcache, + CTLFLAG_RW, &rtq_toomany6 , 0, ""); /* ==== //depot/projects/vimage-commit2/src/sys/netinet6/nd6_nbr.c#13 (text+ko) ==== @@ -78,7 +78,6 @@ #define SDL(s) ((struct sockaddr_dl *)s) struct dadq; - static struct dadq *nd6_dad_find(struct ifaddr *); static void nd6_dad_starttimer(struct dadq *, int); static void nd6_dad_stoptimer(struct dadq *); ==== //depot/projects/vimage-commit2/src/sys/netinet6/raw_ip6.c#14 (text+ko) ==== @@ -765,6 +765,7 @@ rip6_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td) { + INIT_VNET_INET(so->so_vnet); struct inpcb *inp; struct sockaddr_in6 tmp; struct sockaddr_in6 *dst; ==== //depot/projects/vimage-commit2/src/sys/netinet6/vinet6.h#9 (text+ko) ==== @@ -106,8 +106,8 @@ int _ip6_mcast_pmtu; int _ip6_v6only; int _ip6_keepfaith; + int _ip6stealth; time_t _ip6_log_time; - int _ip6stealth; int _nd6_onlink_ns_rfc4861; int _pmtu_expire; ==== //depot/projects/vimage-commit2/src/sys/netipsec/key.c#15 (text+ko) ==== @@ -2699,9 +2699,9 @@ /* searching all SA registerd in the secindex. */ for (stateidx = 0; - stateidx < _ARRAYLEN(saorder_state_any); + stateidx < _ARRAYLEN(V_saorder_state_any); stateidx++) { - u_int state = saorder_state_any[stateidx]; + u_int state = V_saorder_state_any[stateidx]; LIST_FOREACH_SAFE(sav, &sah->savtree[state], chain, nextsav) { if (sav->refcnt == 0) { /* sanity check */ @@ -2985,10 +2985,10 @@ SAHTREE_LOCK_ASSERT(); /* search all status */ for (stateidx = 0; - stateidx < _ARRAYLEN(saorder_state_alive); + stateidx < _ARRAYLEN(V_saorder_state_alive); stateidx++) { - state = saorder_state_alive[stateidx]; + state = V_saorder_state_alive[stateidx]; LIST_FOREACH(sav, &sah->savtree[state], chain) { /* sanity check */ @@ -5313,9 +5313,9 @@ /* Delete all non-LARVAL SAs. */ for (stateidx = 0; - stateidx < _ARRAYLEN(saorder_state_alive); + stateidx < _ARRAYLEN(V_saorder_state_alive); stateidx++) { - state = saorder_state_alive[stateidx]; + state = V_saorder_state_alive[stateidx]; if (state == SADB_SASTATE_LARVAL) continue; for (sav = LIST_FIRST(&sah->savtree[state]); @@ -6518,9 +6518,9 @@ continue; for (stateidx = 0; - stateidx < _ARRAYLEN(saorder_state_alive); + stateidx < _ARRAYLEN(V_saorder_state_alive); stateidx++) { - state = saorder_state_any[stateidx]; + state = V_saorder_state_any[stateidx]; for (sav = LIST_FIRST(&sah->savtree[state]); sav != NULL; sav = nextsav) { @@ -6603,9 +6603,9 @@ continue; for (stateidx = 0; - stateidx < _ARRAYLEN(saorder_state_any); + stateidx < _ARRAYLEN(V_saorder_state_any); stateidx++) { - state = saorder_state_any[stateidx]; + state = V_saorder_state_any[stateidx]; LIST_FOREACH(sav, &sah->savtree[state], chain) { cnt++; } @@ -6633,9 +6633,9 @@ } for (stateidx = 0; - stateidx < _ARRAYLEN(saorder_state_any); + stateidx < _ARRAYLEN(V_saorder_state_any); stateidx++) { - state = saorder_state_any[stateidx]; + state = V_saorder_state_any[stateidx]; LIST_FOREACH(sav, &sah->savtree[state], chain) { n = key_setdumpsa(sav, SADB_DUMP, satype, --cnt, mhp->msg->sadb_msg_pid); ==== //depot/projects/vimage-commit2/src/sys/netipsec/keysock.c#11 (text+ko) ==== @@ -166,7 +166,7 @@ V_pfkeystat.in_msgtype[pmsg->sadb_msg_type]++; } - if (!sbappendaddr(&rp->rcb_socket->so_rcv, (struct sockaddr *)&key_src, + if (!sbappendaddr(&rp->rcb_socket->so_rcv, (struct sockaddr *)&V_key_src, m, NULL)) { V_pfkeystat.in_nomem++; m_freem(m); ==== //depot/projects/vimage-commit2/src/sys/netipsec/vipsec.h#6 (text+ko) ==== @@ -81,6 +81,8 @@ int _key_preferred_oldsa; u_int32_t _acq_seq; + u_int _saorder_state_alive[3]; + u_int _saorder_state_any[4]; int _esp_enable; struct espstat _espstat; int _esp_max_ivlen; @@ -96,6 +98,7 @@ int _ip6_ah_trans_deflev; int _ip6_ah_net_deflev; int _ip6_ipsec_ecn; + int _ip6_esp_randpad; int _ah_enable; int _ah_cleartos; @@ -106,6 +109,8 @@ struct pfkeystat _pfkeystat; struct key_cb _key_cb; + struct sockaddr _key_dst; + struct sockaddr _key_src; LIST_HEAD(, secpolicy) _sptree[IPSEC_DIR_MAX]; LIST_HEAD(, secashead) _sahtree; @@ -142,6 +147,7 @@ #define V_ip4_ipsec_dfbit VNET_IPSEC(ip4_ipsec_dfbit) #define V_ip4_ipsec_ecn VNET_IPSEC(ip4_ipsec_ecn) #define V_ip6_ah_net_deflev VNET_IPSEC(ip6_ah_net_deflev) +#define V_ip6_esp_randpad VNET_IPSEC(ip6_esp_randpad) #define V_ip6_ah_trans_deflev VNET_IPSEC(ip6_ah_trans_deflev) #define V_ip6_esp_net_deflev VNET_IPSEC(ip6_esp_net_deflev) #define V_ip6_esp_trans_deflev VNET_IPSEC(ip6_esp_trans_deflev) @@ -162,16 +168,20 @@ #define V_key_blockacq_lifetime VNET_IPSEC(key_blockacq_lifetime) #define V_key_cb VNET_IPSEC(key_cb) #define V_key_debug_level VNET_IPSEC(key_debug_level) +#define V_key_dst VNET_IPSEC(key_dst) #define V_key_int_random VNET_IPSEC(key_int_random) #define V_key_larval_lifetime VNET_IPSEC(key_larval_lifetime) #define V_key_preferred_oldsa VNET_IPSEC(key_preferred_oldsa) #define V_key_spi_maxval VNET_IPSEC(key_spi_maxval) #define V_key_spi_minval VNET_IPSEC(key_spi_minval) #define V_key_spi_trycnt VNET_IPSEC(key_spi_trycnt) +#define V_key_src VNET_IPSEC(key_src) #define V_pfkeystat VNET_IPSEC(pfkeystat) #define V_policy_id VNET_IPSEC(policy_id) #define V_regtree VNET_IPSEC(regtree) #define V_sahtree VNET_IPSEC(sahtree) +#define V_saorder_state_alive VNET_IPSEC(saorder_state_alive) +#define V_saorder_state_any VNET_IPSEC(saorder_state_any) #define V_spacqtree VNET_IPSEC(spacqtree) #define V_sptree VNET_IPSEC(sptree)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811181110.mAIBAIfM025305>