From owner-svn-src-head@freebsd.org Sat Apr 2 19:30:46 2016 Return-Path: Delivered-To: svn-src-head@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 2F1B9AECF86; Sat, 2 Apr 2016 19:30:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id DC9DA1F40; Sat, 2 Apr 2016 19:30:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id BFD8725D3857; Sat, 2 Apr 2016 19:30:34 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id CF1F6C7B6E6; Sat, 2 Apr 2016 19:30:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id eEhNwnp6wECy; Sat, 2 Apr 2016 19:30:32 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 57B90C7A885; Sat, 2 Apr 2016 19:30:32 +0000 (UTC) Date: Sat, 2 Apr 2016 19:30:31 +0000 (UTC) From: "Bjoern A. Zeeb" To: Gleb Smirnoff 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 In-Reply-To: <201603150015.u2F0FATD089432@repo.freebsd.org> Message-ID: References: <201603150015.u2F0FATD089432@repo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2016 19:30:46 -0000 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) ^^^^^^^^^^^