From owner-svn-src-head@FreeBSD.ORG Wed Dec 17 08:12:50 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A08A4106564A; Wed, 17 Dec 2008 08:12:50 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 920A98FC16; Wed, 17 Dec 2008 08:12:50 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBH8Cos3061961; Wed, 17 Dec 2008 08:12:50 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBH8CoXx061960; Wed, 17 Dec 2008 08:12:50 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200812170812.mBH8CoXx061960@svn.freebsd.org> From: Kip Macy Date: Wed, 17 Dec 2008 08:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186213 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 17 Dec 2008 08:12:50 -0000 Author: kmacy Date: Wed Dec 17 08:12:50 2008 New Revision: 186213 URL: http://svn.freebsd.org/changeset/base/186213 Log: Keep stats in drbr_enqueue Discussed with: ps Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Dec 17 06:56:58 2008 (r186212) +++ head/sys/net/if_var.h Wed Dec 17 08:12:50 2008 (r186213) @@ -550,16 +550,29 @@ do { \ } while (0) #ifdef _KERNEL +static __inline void +drbr_stats_update(struct ifnet *ifp, int len, int mflags) +{ + + ifp->if_obytes += len; + if (mflags & M_MCAST) + ifp->if_omcasts++; +} + static __inline int -drbr_enqueue(struct buf_ring *br, struct mbuf *m) +drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m) { int error = 0; + int len = m->m_pkthdr.len; + int mflags = m->m_flags; if ((error = buf_ring_enqueue(br, m)) == ENOBUFS) { br->br_drops++; + _IF_DROP(&ifp->if_snd); m_freem(m); - } - + } else + drbr_stats_update(ifp, len, mflags); + return (error); }