Date: Sat, 2 Apr 2016 19:30:31 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296881 - in head: contrib/bsnmp/snmp_mibII sys/netinet Message-ID: <alpine.BSF.2.00.1604021927000.83904@ai.fobar.qr> In-Reply-To: <201603150015.u2F0FATD089432@repo.freebsd.org> References: <201603150015.u2F0FATD089432@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 15 Mar 2016, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Mar 15 00:15:10 2016 > New Revision: 296881 > URL: https://svnweb.freebsd.org/changeset/base/296881 > > Log: > Redo r294869. The array of counters for TCP states doesn't belong to > struct tcpstat, because the structure can be zeroed out by netstat(1) -z, > and of course running connection counts shouldn't be touched. > > Place running connection counts into separate array, and provide > separate read-only sysctl oid for it. This has VNET(xxx) macros in the middle of the code. We do that nowhere else. Could you please #define V_xxx VNET(xxx) and get rid of them? > + > +static void > +tcp_vnet_init(const void *unused) Also that function name is very badly chosen. > + COUNTER_ARRAY_ALLOC(VNET(tcps_states), TCP_NSTATES, M_WAITOK); ^^^^^^^^^^^ > + COUNTER_ARRAY_FREE(VNET(tcps_states), TCP_NSTATES); > + counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); > + m = counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); > /* > + * 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) ^^^^^^^^^^^
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1604021927000.83904>