Date: Wed, 17 Sep 2014 01:50:00 +0400 From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r271538 - head/sys/net Message-ID: <5418B088.8060603@FreeBSD.org> In-Reply-To: <20140915105653.GR60617@FreeBSD.org> References: <201409131813.s8DID8vR061538@svn.freebsd.org> <20140915105653.GR60617@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5418B088.8060603>