1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

Count output bytes and packets.

This commit is contained in:
Juli Mallett 2011-01-10 22:14:30 +00:00
parent b37ccb6a0c
commit 449cf853ac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217244
2 changed files with 8 additions and 2 deletions

View File

@ -333,9 +333,12 @@ octm_transmit(struct ifnet *ifp, struct mbuf *m)
result = cvmx_mgmt_port_sendm(sc->sc_port, m);
if (result == CVMX_MGMT_PORT_SUCCESS)
if (result == CVMX_MGMT_PORT_SUCCESS) {
ETHER_BPF_MTAP(ifp, m);
else
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
} else
ifp->if_oerrors++;
m_freem(m);

View File

@ -247,6 +247,9 @@ int cvm_oct_xmit(struct mbuf *m, struct ifnet *ifp)
/* Pass it to any BPF listeners. */
ETHER_BPF_MTAP(ifp, m);
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
}
/* Free mbufs not in use by the hardware */