From owner-svn-src-user@FreeBSD.ORG Sun Jun 7 23:49:17 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 277441065672; Sun, 7 Jun 2009 23:49:17 +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 160478FC08; Sun, 7 Jun 2009 23:49:17 +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 n57NnFox009607; Sun, 7 Jun 2009 23:49:15 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n57NnF8c009605; Sun, 7 Jun 2009 23:49:15 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200906072349.n57NnF8c009605@svn.freebsd.org> From: Kip Macy Date: Sun, 7 Jun 2009 23:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193670 - in user/kmacy/releng_7_2_fcs/sys: net sys X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 23:49:17 -0000 Author: kmacy Date: Sun Jun 7 23:49:15 2009 New Revision: 193670 URL: http://svn.freebsd.org/changeset/base/193670 Log: track bytes and buffers enqueued in buf_ring Modified: user/kmacy/releng_7_2_fcs/sys/net/if_var.h user/kmacy/releng_7_2_fcs/sys/sys/buf_ring.h Modified: user/kmacy/releng_7_2_fcs/sys/net/if_var.h ============================================================================== --- user/kmacy/releng_7_2_fcs/sys/net/if_var.h Sun Jun 7 23:47:06 2009 (r193669) +++ user/kmacy/releng_7_2_fcs/sys/net/if_var.h Sun Jun 7 23:49:15 2009 (r193670) @@ -559,8 +559,9 @@ do { \ static __inline void drbr_stats_update(struct ifnet *ifp, int len, int mflags) { - +#ifndef NO_SLOW_STATS ifp->if_obytes += len; +#endif if (mflags & M_MCAST) ifp->if_omcasts++; } @@ -578,13 +579,12 @@ drbr_enqueue(struct ifnet *ifp, struct b return (error); } #endif - if ((error = buf_ring_enqueue(br, m)) == ENOBUFS) { + if ((error = buf_ring_enqueue(br, m, m->m_pkthdr.len)) == ENOBUFS) { br->br_drops++; - _IF_DROP(&ifp->if_snd); m_freem(m); } else drbr_stats_update(ifp, len, mflags); - + return (error); } Modified: user/kmacy/releng_7_2_fcs/sys/sys/buf_ring.h ============================================================================== --- user/kmacy/releng_7_2_fcs/sys/sys/buf_ring.h Sun Jun 7 23:47:06 2009 (r193669) +++ user/kmacy/releng_7_2_fcs/sys/sys/buf_ring.h Sun Jun 7 23:49:15 2009 (r193670) @@ -49,10 +49,12 @@ struct buf_ring { int br_prod_size; int br_prod_mask; uint64_t br_drops; + uint64_t br_prod_bufs; + uint64_t br_prod_bytes; /* * Pad out to next L2 cache line */ - uint64_t _pad0[13]; + uint64_t _pad0[11]; volatile uint32_t br_cons_head; volatile uint32_t br_cons_tail; @@ -74,7 +76,7 @@ struct buf_ring { * */ static __inline int -buf_ring_enqueue(struct buf_ring *br, void *buf) +buf_ring_enqueue(struct buf_ring *br, void *buf, int nbytes) { uint32_t prod_head, prod_next; uint32_t cons_tail; @@ -116,6 +118,8 @@ buf_ring_enqueue(struct buf_ring *br, vo */ while (br->br_prod_tail != prod_head) cpu_spinwait(); + br->br_prod_bufs++; + br->br_prod_bytes += nbytes; br->br_prod_tail = prod_next; critical_exit(); return (0);