Date: Fri, 19 Sep 2014 09:19:49 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271858 - in head/sys/mips: adm5120 atheros cavium cavium/octe idt nlm/dev/net rmi/dev/nlge rmi/dev/xlr Message-ID: <201409190919.s8J9JnoM005466@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Fri Sep 19 09:19:49 2014 New Revision: 271858 URL: http://svnweb.freebsd.org/changeset/base/271858 Log: Mechanically convert to if_inc_counter(). Modified: head/sys/mips/adm5120/if_admsw.c head/sys/mips/atheros/if_arge.c head/sys/mips/cavium/if_octm.c head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/idt/if_kr.c head/sys/mips/nlm/dev/net/xlpge.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/dev/xlr/rge.c Modified: head/sys/mips/adm5120/if_admsw.c ============================================================================== --- head/sys/mips/adm5120/if_admsw.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/adm5120/if_admsw.c Fri Sep 19 09:19:49 2014 (r271858) @@ -925,7 +925,7 @@ admsw_txintr(struct admsw_softc *sc, int 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 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 /* Pass it on. */ (*ifp->if_input)(ifp, m); - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); } /* Update the receive pointer. */ Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/atheros/if_arge.c Fri Sep 19 09:19:49 2014 (r271858) @@ -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); Modified: head/sys/mips/cavium/if_octm.c ============================================================================== --- head/sys/mips/cavium/if_octm.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/cavium/if_octm.c Fri Sep 19 09:19:49 2014 (r271858) @@ -347,10 +347,10 @@ octm_transmit(struct ifnet *ifp, struct 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. */ Modified: head/sys/mips/cavium/octe/ethernet-rx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rx.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/cavium/octe/ethernet-rx.c Fri Sep 19 09:19:49 2014 (r271858) @@ -304,7 +304,7 @@ void cvm_oct_tasklet_rx(void *context, i m->m_pkthdr.csum_flags = 0; /* XXX */ } - ifp->if_ipackets++; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); (*ifp->if_input)(ifp, m); } else { Modified: head/sys/mips/cavium/octe/ethernet-tx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-tx.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/cavium/octe/ethernet-tx.c Fri Sep 19 09:19:49 2014 (r271858) @@ -158,7 +158,7 @@ int cvm_oct_xmit(struct mbuf *m, struct 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 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 /* 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 */ Modified: head/sys/mips/idt/if_kr.c ============================================================================== --- head/sys/mips/idt/if_kr.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/idt/if_kr.c Fri Sep 19 09:19:49 2014 (r271858) @@ -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); Modified: head/sys/mips/nlm/dev/net/xlpge.c ============================================================================== --- head/sys/mips/nlm/dev/net/xlpge.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/nlm/dev/net/xlpge.c Fri Sep 19 09:19:49 2014 (r271858) @@ -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, } 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 si 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; Modified: head/sys/mips/rmi/dev/nlge/if_nlge.c ============================================================================== --- head/sys/mips/rmi/dev/nlge/if_nlge.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/rmi/dev/nlge/if_nlge.c Fri Sep 19 09:19:49 2014 (r271858) @@ -697,7 +697,9 @@ nlge_msgring_handler(int bucket, int siz 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_ 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); } Modified: head/sys/mips/rmi/dev/xlr/rge.c ============================================================================== --- head/sys/mips/rmi/dev/xlr/rge.c Fri Sep 19 09:19:29 2014 (r271857) +++ head/sys/mips/rmi/dev/xlr/rge.c Fri Sep 19 09:19:49 2014 (r271858) @@ -2019,7 +2019,7 @@ rge_rx(struct rge_softc *sc, vm_paddr_t 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 ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; } else { - ifp->if_opackets++; + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); xlr_rge_tx_done[vcpu]++; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409190919.s8J9JnoM005466>