svn commit: r297043 - head/sys/arm/ti/cpsw
Luiz Otavio O Souza
loos at FreeBSD.org
Fri Mar 18 20:24:32 UTC 2016
Author: loos
Date: Fri Mar 18 20:24:31 2016
New Revision: 297043
URL: https://svnweb.freebsd.org/changeset/base/297043
Log:
Count the input and output packets.
Sponsored by: Rubicon Communications (Netgate)
Modified:
head/sys/arm/ti/cpsw/if_cpsw.c
head/sys/arm/ti/cpsw/if_cpswvar.h
Modified: head/sys/arm/ti/cpsw/if_cpsw.c
==============================================================================
--- head/sys/arm/ti/cpsw/if_cpsw.c Fri Mar 18 20:09:54 2016 (r297042)
+++ head/sys/arm/ti/cpsw/if_cpsw.c Fri Mar 18 20:24:31 2016 (r297043)
@@ -1196,6 +1196,7 @@ cpsw_rx_teardown_locked(struct cpsw_soft
received->m_nextpkt = NULL;
ifp = received->m_pkthdr.rcvif;
(*ifp->if_input)(ifp, received);
+ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
received = next;
}
CPSW_GLOBAL_LOCK(sc);
@@ -1536,6 +1537,7 @@ cpsw_intr_rx(void *arg)
received->m_nextpkt = NULL;
ifp = received->m_pkthdr.rcvif;
(*ifp->if_input)(ifp, received);
+ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
received = next;
}
}
@@ -1789,6 +1791,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc)
("Queueing TX packet: %d segments + %d pad bytes",
nsegs, padlen));
+ slot->ifp = sc->ifp;
/* If there is only one segment, the for() loop
* gets skipped and the single buffer gets set up
* as both SOP and EOP. */
@@ -1913,6 +1916,8 @@ cpsw_tx_dequeue(struct cpsw_softc *sc)
bus_dmamap_unload(sc->mbuf_dtag, slot->dmamap);
m_freem(slot->mbuf);
slot->mbuf = NULL;
+ if (slot->ifp)
+ if_inc_counter(slot->ifp, IFCOUNTER_OPACKETS, 1);
/* Dequeue any additional buffers used by this packet. */
while (slot != NULL && slot->mbuf == NULL) {
Modified: head/sys/arm/ti/cpsw/if_cpswvar.h
==============================================================================
--- head/sys/arm/ti/cpsw/if_cpswvar.h Fri Mar 18 20:09:54 2016 (r297042)
+++ head/sys/arm/ti/cpsw/if_cpswvar.h Fri Mar 18 20:24:31 2016 (r297043)
@@ -43,6 +43,7 @@
struct cpsw_slot {
uint32_t bd_offset; /* Offset of corresponding BD within CPPI RAM. */
bus_dmamap_t dmamap;
+ struct ifnet *ifp;
struct mbuf *mbuf;
STAILQ_ENTRY(cpsw_slot) next;
};
More information about the svn-src-all
mailing list