hyperv/hn: Add per-TX ring stats for # of transmitted packets

MFC after:	2 weeks
Sponsored by:	Microsoft OSTC
This commit is contained in:
Sepherosa Ziehau 2016-03-04 07:07:42 +00:00
parent 7dda664075
commit 05c0884ee1
2 changed files with 5 additions and 0 deletions

View File

@ -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;

View File

@ -1021,6 +1021,7 @@ hn_send_pkt(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd)
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, int id)
CTLFLAG_RD, &txr->hn_oactive, 0,
"over active");
}
SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "packets",
CTLFLAG_RW, &txr->hn_pkts,
"# of packets transmitted");
}
}