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");
                }
        }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to