From owner-freebsd-net@FreeBSD.ORG Fri Dec 30 01:34:56 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67821106564A; Fri, 30 Dec 2011 01:34:56 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 10EF68FC14; Fri, 30 Dec 2011 01:34:55 +0000 (UTC) Received: by iadj38 with SMTP id j38so30958215iad.13 for ; Thu, 29 Dec 2011 17:34:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=S6Zdn/tu9Fp9iFjw3VitDYUzZpr936Qhopxf4MM9IKo=; b=b1TYkhp+yaLfGMaueOBNOXUxVsNJC8Ze3szn9dldX9bJCjFPL2mUnIO7IBtuLzYPCq 9/dX8Pra/wf0cRRaJdoWSlOGPtfAIt3ZNJ1JbjLKIRIDpCxhz4sC17n0Zb0NreJr+jzm HqMtdH9kypC4DNPeSF4/3/XcNlHBhoQ1IUtH0= Received: by 10.42.244.137 with SMTP id lq9mr39044516icb.28.1325208895586; Thu, 29 Dec 2011 17:34:55 -0800 (PST) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id h9sm121258949ibh.11.2011.12.29.17.34.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 29 Dec 2011 17:34:54 -0800 (PST) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 29 Dec 2011 17:32:59 -0800 From: YongHyeon PYUN Date: Thu, 29 Dec 2011 17:32:59 -0800 To: Joe Holden Message-ID: <20111230013259.GH10465@michelle.cdnetworks.com> References: <4EF8D0A2.5010604@rewt.org.uk> <20111227032528.GA1844@michelle.cdnetworks.com> <20111227040551.GH8035@FreeBSD.org> <201112291124.23626.jhb@freebsd.org> <4EFD11C8.7090409@rewt.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EFD11C8.7090409@rewt.org.uk> User-Agent: Mutt/1.4.2.3i Cc: "freebsd-net@freebsd.org" , John Baldwin Subject: Re: bsnmpd not showing out octets for vlan interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 01:34:56 -0000 On Fri, Dec 30, 2011 at 01:20:08AM +0000, Joe Holden wrote: > John Baldwin wrote: > >On Monday, December 26, 2011 11:05:51 pm Gleb Smirnoff wrote: > >>On Mon, Dec 26, 2011 at 07:25:29PM -0800, YongHyeon PYUN wrote: > >>Y> Index: sys/net/if_vlan.c > >>Y> =================================================================== > >>Y> --- sys/net/if_vlan.c (revision 228906) > >>Y> +++ sys/net/if_vlan.c (working copy) > >>Y> @@ -1012,10 +1012,12 @@ > >>Y> { > >>Y> struct ifvlan *ifv; > >>Y> struct ifnet *p; > >>Y> - int error; > >>Y> + int error, len, mcast; > >>Y> > >>Y> ifv = ifp->if_softc; > >>Y> p = PARENT(ifv); > >>Y> + len = m->m_pkthdr.len; > >>Y> + mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; > >>Y> > >>Y> BPF_MTAP(ifp, m); > >>Y> > >>Y> @@ -1025,7 +1027,7 @@ > >>Y> */ > >>Y> if (!UP_AND_RUNNING(p)) { > >>Y> m_freem(m); > >>Y> - ifp->if_collisions++; > >>Y> + ifp->if_oerrors++; > >>Y> return (0); > >>Y> } > >>Y> > >>Y> @@ -1081,9 +1083,11 @@ > >>Y> * Send it, precisely as ether_output() would have. > >>Y> */ > >>Y> error = (p->if_transmit)(p, m); > >>Y> - if (!error) > >>Y> + if (!error) { > >>Y> ifp->if_opackets++; > >>Y> - else > >>Y> + ifp->if_omcasts += mcast; > >>Y> + ifp->if_obytes += len; > >>Y> + } else > >>Y> ifp->if_oerrors++; > >>Y> return (error); > >>Y> } > >> > >>Thanks, Pyun! You can count me in as reviewer. > >> > >>I have also added jhb@ to Cc, the author of changed code, so that he > >>can review, too. > > > >I didn't really change it, I just unindented it when the loop was removed > >during the transition to if_transmit. :) However, this patch looks good to > >me. > > > I have been running with this patch for a couple of days now, counters > appear to be working as expected > FYI: patch committed to HEAD(r228967). > Thanks, > Joe