From owner-svn-src-all@FreeBSD.ORG Tue Sep 16 21:51:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D80ACA3; Tue, 16 Sep 2014 21:51:14 +0000 (UTC) Received: from mail.ipfw.ru (mail.ipfw.ru [IPv6:2a01:4f8:120:6141::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0278E6; Tue, 16 Sep 2014 21:51:13 +0000 (UTC) Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net) by mail.ipfw.ru with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1XTwfn-000FfC-Qp; Tue, 16 Sep 2014 21:36:15 +0400 Message-ID: <5418B088.8060603@FreeBSD.org> Date: Wed, 17 Sep 2014 01:50:00 +0400 From: "Alexander V. Chernikov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r271538 - head/sys/net References: <201409131813.s8DID8vR061538@svn.freebsd.org> <20140915105653.GR60617@FreeBSD.org> In-Reply-To: <20140915105653.GR60617@FreeBSD.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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, 16 Sep 2014 21:51:14 -0000 On 15.09.2014 14:56, Gleb Smirnoff wrote: > On Sat, Sep 13, 2014 at 06:13:08PM +0000, Alexander V. Chernikov wrote: > A> @@ -1099,15 +1117,39 @@ vlan_transmit(struct ifnet *ifp, struct > A> * Send it, precisely as ether_output() would have. > A> */ > A> error = (p->if_transmit)(p, m); > A> - if (!error) { > A> - ifp->if_opackets++; > A> - ifp->if_omcasts += mcast; > A> - ifp->if_obytes += len; > A> + if (error == 0) { > A> + counter_u64_add(ifv->ifv_opackets, 1); > A> + counter_u64_add(ifv->ifv_obytes, len); > A> + counter_u64_add(ifv->ifv_omcasts, 1); > A> } else > A> ifp->if_oerrors++; > A> return (error); > A> } > > This looks like counting all packets as multicasts. Strange that compiler > didn't warn you about write only variable. Unfortunately, clang does not warn about this kind of thing. > > P.S. Why did you decide to keep if_oerrors old style? Id had a stong feeling that oerrors is used both by drivers and stack. It looks like this is not the case. I've committed both changes in r271691. >