Date: Fri, 4 Mar 2016 07:07:42 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296381 - head/sys/dev/hyperv/netvsc Message-ID: <201603040707.u2477gJW064327@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Fri Mar 4 07:07:42 2016 New Revision: 296381 URL: https://svnweb.freebsd.org/changeset/base/296381 Log: hyperv/hn: Add per-TX ring stats for # of transmitted packets MFC after: 2 weeks Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Mar 4 07:00:37 2016 (r296380) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Mar 4 07:07:42 2016 (r296381) @@ -1208,6 +1208,7 @@ struct hn_tx_ring { u_long hn_txdma_failed; u_long hn_tx_collapsed; u_long hn_tx_chimney; + u_long hn_pkts; /* Rarely used stuffs */ struct hn_txdesc *hn_txdesc; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Mar 4 07:00:37 2016 (r296380) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Mar 4 07:07:42 2016 (r296381) @@ -1021,6 +1021,7 @@ again: if (txd->m->m_flags & M_MCAST) if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); } + txr->hn_pkts++; } hn_txdesc_put(txr, txd); @@ -2402,6 +2403,9 @@ hn_create_tx_ring(struct hn_softc *sc, i CTLFLAG_RD, &txr->hn_oactive, 0, "over active"); } + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "packets", + CTLFLAG_RW, &txr->hn_pkts, + "# of packets transmitted"); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603040707.u2477gJW064327>