From owner-svn-src-all@freebsd.org Tue May 17 23:14:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D95DB40E85; Tue, 17 May 2016 23:14:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F7571E63; Tue, 17 May 2016 23:14:18 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4HNEHMs027937; Tue, 17 May 2016 23:14:17 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4HNEHE5027934; Tue, 17 May 2016 23:14:17 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201605172314.u4HNEHE5027934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 May 2016 23:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300096 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 23:14:18 -0000 Author: glebius Date: Tue May 17 23:14:17 2016 New Revision: 300096 URL: https://svnweb.freebsd.org/changeset/base/300096 Log: Tiny refactor of r294869/r296881: use defines to mask the VNET() macro. Suggested by: bz Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue May 17 22:52:42 2016 (r300095) +++ head/sys/netinet/tcp_input.c Tue May 17 23:14:17 2016 (r300096) @@ -250,7 +250,7 @@ static void tcp_vnet_init(const void *unused) { - COUNTER_ARRAY_ALLOC(VNET(tcps_states), TCP_NSTATES, M_WAITOK); + COUNTER_ARRAY_ALLOC(V_tcps_states, TCP_NSTATES, M_WAITOK); VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); } VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, @@ -261,7 +261,7 @@ static void tcp_vnet_uninit(const void *unused) { - COUNTER_ARRAY_FREE(VNET(tcps_states), TCP_NSTATES); + COUNTER_ARRAY_FREE(V_tcps_states, TCP_NSTATES); VNET_PCPUSTAT_FREE(tcpstat); } VNET_SYSUNINIT(tcp_vnet_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue May 17 22:52:42 2016 (r300095) +++ head/sys/netinet/tcp_subr.c Tue May 17 23:14:17 2016 (r300096) @@ -1642,7 +1642,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == NULL) { n = V_tcbinfo.ipi_count + - counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); + counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]); n += imax(n / 8, 10); req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb); return (0); @@ -1659,7 +1659,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) n = V_tcbinfo.ipi_count; INP_LIST_RUNLOCK(&V_tcbinfo); - m = counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); + m = counter_u64_fetch(V_tcps_states[TCPS_SYN_RECEIVED]); error = sysctl_wire_old_buffer(req, 2 * (sizeof xig) + (n + m) * sizeof(struct xtcpcb)); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue May 17 22:52:42 2016 (r300095) +++ head/sys/netinet/tcp_var.h Tue May 17 23:14:17 2016 (r300096) @@ -629,8 +629,9 @@ void kmod_tcpstat_inc(int statnum); * Running TCP connection count by state. */ VNET_DECLARE(counter_u64_t, tcps_states[TCP_NSTATES]); -#define TCPSTATES_INC(state) counter_u64_add(VNET(tcps_states)[state], 1) -#define TCPSTATES_DEC(state) counter_u64_add(VNET(tcps_states)[state], -1) +#define V_tcps_states VNET(tcps_states) +#define TCPSTATES_INC(state) counter_u64_add(V_tcps_states[state], 1) +#define TCPSTATES_DEC(state) counter_u64_add(V_tcps_states[state], -1) /* * TCP specific helper hook point identifiers.