diff options
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/adm5120/if_admsw.c | 6 | ||||
-rw-r--r-- | sys/mips/atheros/if_arge.c | 4 | ||||
-rw-r--r-- | sys/mips/cavium/if_octm.c | 10 | ||||
-rw-r--r-- | sys/mips/cavium/octe/ethernet-rx.c | 2 | ||||
-rw-r--r-- | sys/mips/cavium/octe/ethernet-tx.c | 8 | ||||
-rw-r--r-- | sys/mips/idt/if_kr.c | 14 | ||||
-rw-r--r-- | sys/mips/nlm/dev/net/xlpge.c | 9 | ||||
-rw-r--r-- | sys/mips/rmi/dev/nlge/if_nlge.c | 8 | ||||
-rw-r--r-- | sys/mips/rmi/dev/xlr/rge.c | 4 |
9 files changed, 32 insertions, 33 deletions
diff --git a/sys/mips/adm5120/if_admsw.c b/sys/mips/adm5120/if_admsw.c index b069015..11f96b5 100644 --- a/sys/mips/adm5120/if_admsw.c +++ b/sys/mips/adm5120/if_admsw.c @@ -925,7 +925,7 @@ admsw_txintr(struct admsw_softc *sc, int prio) gotone = 1; /* printf("clear tx slot %d\n",i); */ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); sc->sc_txfree++; } @@ -1047,7 +1047,7 @@ admsw_rxintr(struct admsw_softc *sc, int high) m = ds->ds_mbuf; if (admsw_add_rxlbuf(sc, i) != 0) { - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); ADMSW_INIT_RXLDESC(sc, i); bus_dmamap_sync(sc->sc_bufs_dmat, ds->ds_dmamap, BUS_DMASYNC_PREREAD); @@ -1066,7 +1066,7 @@ admsw_rxintr(struct admsw_softc *sc, int high) /* Pass it on. */ (*ifp->if_input)(ifp, m); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); } /* Update the receive pointer. */ diff --git a/sys/mips/atheros/if_arge.c b/sys/mips/atheros/if_arge.c index 8561738..e88f1e8 100644 --- a/sys/mips/atheros/if_arge.c +++ b/sys/mips/atheros/if_arge.c @@ -2147,7 +2147,7 @@ arge_tx_locked(struct arge_softc *sc) txd = &sc->arge_cdata.arge_txdesc[cons]; - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); bus_dmamap_sync(sc->arge_cdata.arge_tx_tag, txd->tx_dmamap, BUS_DMASYNC_POSTWRITE); @@ -2209,7 +2209,7 @@ arge_rx_locked(struct arge_softc *sc) m->m_pkthdr.rcvif = ifp; /* Skip 4 bytes of CRC */ m->m_pkthdr.len = m->m_len = packet_len - ETHER_CRC_LEN; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); rx_npkts++; ARGE_UNLOCK(sc); diff --git a/sys/mips/cavium/if_octm.c b/sys/mips/cavium/if_octm.c index 461d1bb..a689a0f 100644 --- a/sys/mips/cavium/if_octm.c +++ b/sys/mips/cavium/if_octm.c @@ -347,10 +347,10 @@ octm_transmit(struct ifnet *ifp, struct mbuf *m) if (result == CVMX_MGMT_PORT_SUCCESS) { ETHER_BPF_MTAP(ifp, m); - ifp->if_opackets++; - ifp->if_obytes += m->m_pkthdr.len; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); } else - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); m_freem(m); @@ -517,7 +517,7 @@ octm_rx_intr(void *arg) m->m_pkthdr.rcvif = sc->sc_ifp; m->m_pkthdr.len = m->m_len = len; - sc->sc_ifp->if_ipackets++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IPACKETS, 1); (*sc->sc_ifp->if_input)(sc->sc_ifp, m); @@ -529,7 +529,7 @@ octm_rx_intr(void *arg) if (len == 0) break; - sc->sc_ifp->if_ierrors++; + if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); } /* Acknowledge interrupts. */ diff --git a/sys/mips/cavium/octe/ethernet-rx.c b/sys/mips/cavium/octe/ethernet-rx.c index 79470be..492d3e0 100644 --- a/sys/mips/cavium/octe/ethernet-rx.c +++ b/sys/mips/cavium/octe/ethernet-rx.c @@ -304,7 +304,7 @@ void cvm_oct_tasklet_rx(void *context, int pending) m->m_pkthdr.csum_flags = 0; /* XXX */ } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } else { diff --git a/sys/mips/cavium/octe/ethernet-tx.c b/sys/mips/cavium/octe/ethernet-tx.c index b55ada6..b1d1f14 100644 --- a/sys/mips/cavium/octe/ethernet-tx.c +++ b/sys/mips/cavium/octe/ethernet-tx.c @@ -158,7 +158,7 @@ int cvm_oct_xmit(struct mbuf *m, struct ifnet *ifp) work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); if (work == NULL) { m_freem(m); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return 1; } @@ -231,7 +231,7 @@ int cvm_oct_xmit(struct mbuf *m, struct ifnet *ifp) if (__predict_false(dropped)) { m_freem(m); cvmx_fau_atomic_add32(priv->fau+qos*4, -1); - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else { /* Put this packet on the queue to be freed later */ _IF_ENQUEUE(&priv->tx_free_queue[qos], m); @@ -239,8 +239,8 @@ 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; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len); } /* Free mbufs not in use by the hardware */ diff --git a/sys/mips/idt/if_kr.c b/sys/mips/idt/if_kr.c index fdd60ea..4b5d3bf 100644 --- a/sys/mips/idt/if_kr.c +++ b/sys/mips/idt/if_kr.c @@ -1395,13 +1395,13 @@ kr_tx(struct kr_softc *sc) txd = &sc->kr_cdata.kr_txdesc[cons]; if (devcs & KR_DMATX_DEVCS_TOK) - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); else { - ifp->if_oerrors++; + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* collisions: medium busy, late collision */ if ((devcs & KR_DMATX_DEVCS_EC) || (devcs & KR_DMATX_DEVCS_LC)) - ifp->if_collisions++; + if_inc_counter(ifp, IFCOUNTER_COLLISIONS, 1); } bus_dmamap_sync(sc->kr_cdata.kr_tx_tag, txd->tx_dmamap, @@ -1460,11 +1460,11 @@ kr_rx(struct kr_softc *sc) error = 1; if (packet_len != count) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); else if (count < 64) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); else if ((cur_rx->kr_devcs & KR_DMARX_DEVCS_LD) == 0) - ifp->if_ierrors++; + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); else if ((cur_rx->kr_devcs & KR_DMARX_DEVCS_ROK) != 0) { error = 0; bus_dmamap_sync(sc->kr_cdata.kr_rx_tag, rxd->rx_dmamap, @@ -1474,7 +1474,7 @@ kr_rx(struct kr_softc *sc) m->m_pkthdr.rcvif = ifp; /* Skip 4 bytes of CRC */ m->m_pkthdr.len = m->m_len = packet_len - ETHER_CRC_LEN; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); KR_UNLOCK(sc); (*ifp->if_input)(ifp, m); diff --git a/sys/mips/nlm/dev/net/xlpge.c b/sys/mips/nlm/dev/net/xlpge.c index 2c6cba5..41962df 100644 --- a/sys/mips/nlm/dev/net/xlpge.c +++ b/sys/mips/nlm/dev/net/xlpge.c @@ -897,8 +897,7 @@ fail: if (p2p) uma_zfree(nl_tx_desc_zone, p2p); m_freem(mbuf_chain); - /*atomic_incr_long(&ifp->if_iqdrops); */ - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (err); } @@ -1433,8 +1432,7 @@ nlm_xlpge_rx(struct nlm_xlpge_softc *sc, int port, vm_paddr_t paddr, int len) } else m->m_pkthdr.len = m->m_len = len; - /*atomic_incr_long(&ifp->if_ipackets);*/ - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); #ifdef XLP_DRIVER_LOOPBACK if (port == 16 || port == 17) (*ifp->if_input)(ifp, m); @@ -1515,8 +1513,7 @@ nlm_xlpge_msgring_handler(int vc, int size, int code, int src_id, nlm_xlpge_release_mbuf(phys_addr); - /*atomic_incr_long(&ifp->if_opackets);*/ - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } else if (size > 1) { /* Recieve packet */ phys_addr = msg->msg[1] & 0xffffffffc0ULL; diff --git a/sys/mips/rmi/dev/nlge/if_nlge.c b/sys/mips/rmi/dev/nlge/if_nlge.c index 9c7ff05..832c518 100644 --- a/sys/mips/rmi/dev/nlge/if_nlge.c +++ b/sys/mips/rmi/dev/nlge/if_nlge.c @@ -697,7 +697,9 @@ nlge_msgring_handler(int bucket, int size, int code, int stid, printf("ERROR: Tx fb error (%d) on port %d\n", tx_error, port); } - tx_error ? ifp->if_oerrors++ : ifp->if_opackets++; + tx_error ? + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1) : + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } else if (ctrl == CTRL_SNGL || ctrl == CTRL_START) { /* Rx Packet */ @@ -776,7 +778,7 @@ fail: NLGE_UNLOCK(sc); } m_freem(m); - ifp->if_iqdrops++; + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); } return (error); } @@ -825,7 +827,7 @@ nlge_rx(struct nlge_softc *sc, vm_paddr_t paddr, int len) m->m_pkthdr.len = m->m_len = len; m->m_pkthdr.rcvif = ifp; - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } diff --git a/sys/mips/rmi/dev/xlr/rge.c b/sys/mips/rmi/dev/xlr/rge.c index 2d2ba9e..6fd2bc6 100644 --- a/sys/mips/rmi/dev/xlr/rge.c +++ b/sys/mips/rmi/dev/xlr/rge.c @@ -2019,7 +2019,7 @@ rge_rx(struct rge_softc *sc, vm_paddr_t paddr, int len) printf("\n"); } #endif - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input) (ifp, m); } @@ -2116,7 +2116,7 @@ rge_start_locked(struct ifnet *ifp, int threshold) ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } else { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); xlr_rge_tx_done[vcpu]++; } } |