On Thu, Nov 29, 2012 at 04:41:09PM +0100, Mike Belopuhov wrote:
> hi,
>
> drivers ex age alc ale jme se vic vte xe upl and octeon/cmac
> make use of the if_iqdrops counter that is not shown by any of our
> tools (like netstat). looks like most of its usage comes from
> freebsd where they show it in the "netstat -di" output in a new
> column. do we want to do that or just convert them to if_ierrors
> since 90% of our drivers do only if_ierrors. there's also doesn't
> seem to be any rule when to use if_iqdrops (well, since in most
> drivers there's no input queueing -- check out upl(4) :)
>
> the diff below changes all the drivers in our tree to use
> if_ierrors instead of if_iqdrops. i've decided to leave
> octeon/cmac driver as is because if_iqdrops is used for
> debugging purposes there.
>
> ack? nack? meh?
Seems like a good idea to me to not lose those errors. I have
no great desire for a new column in netstat, but no great
antagonism to one either.
.... Ken
>
> diff --git sys/dev/isa/if_ex.c sys/dev/isa/if_ex.c
> index 49eb077..f93165f 100644
> --- sys/dev/isa/if_ex.c
> +++ sys/dev/isa/if_ex.c
> @@ -661,7 +661,7 @@ ex_rx_intr(struct ex_softc *sc)
> MGETHDR(m, M_DONTWAIT, MT_DATA);
> ipkt = m;
> if (ipkt == NULL)
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> else {
> ipkt->m_pkthdr.rcvif = ifp;
> ipkt->m_pkthdr.len = pkt_len;
> @@ -673,7 +673,7 @@ ex_rx_intr(struct ex_softc *sc)
> m->m_len = MCLBYTES;
> else {
> m_freem(ipkt);
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> goto rx_another;
> }
> }
> @@ -696,7 +696,7 @@ ex_rx_intr(struct ex_softc *sc)
> MT_DATA);
> if (m->m_next == NULL) {
> m_freem(ipkt);
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> goto rx_another;
> }
> m = m->m_next;
> diff --git sys/dev/pci/if_age.c sys/dev/pci/if_age.c
> index f5f6de5..53903c1 100644
> --- sys/dev/pci/if_age.c
> +++ sys/dev/pci/if_age.c
> @@ -1329,7 +1329,7 @@ age_rxeof(struct age_softc *sc, struct rx_rdesc *rxrd)
> desc = rxd->rx_desc;
> /* Add a new receive buffer to the ring. */
> if (age_newbuf(sc, rxd) != 0) {
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> /* Reuse Rx buffers. */
> if (sc->age_cdata.age_rxhead != NULL) {
> m_freem(sc->age_cdata.age_rxhead);
> diff --git sys/dev/pci/if_alc.c sys/dev/pci/if_alc.c
> index eac4148..ef22bb5 100644
> --- sys/dev/pci/if_alc.c
> +++ sys/dev/pci/if_alc.c
> @@ -1952,7 +1952,7 @@ alc_rxeof(struct alc_softc *sc, struct rx_rdesc *rrd)
> mp = rxd->rx_m;
> /* Add a new receive buffer to the ring. */
> if (alc_newbuf(sc, rxd) != 0) {
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> /* Reuse Rx buffers. */
> if (sc->alc_cdata.alc_rxhead != NULL)
> m_freem(sc->alc_cdata.alc_rxhead);
> diff --git sys/dev/pci/if_ale.c sys/dev/pci/if_ale.c
> index 1e5004e..ef6348f 100644
> --- sys/dev/pci/if_ale.c
> +++ sys/dev/pci/if_ale.c
> @@ -1552,7 +1552,7 @@ ale_rxeof(struct ale_softc *sc)
> m = m_devget((char *)(rs + 1), length - ETHER_CRC_LEN,
> ETHER_ALIGN, ifp, NULL);
> if (m == NULL) {
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> ale_rx_update_page(sc, &rx_page, length, &prod);
> continue;
> }
> diff --git sys/dev/pci/if_jme.c sys/dev/pci/if_jme.c
> index 25c954f..37a1efa 100644
> --- sys/dev/pci/if_jme.c
> +++ sys/dev/pci/if_jme.c
> @@ -1602,7 +1602,7 @@ jme_rxpkt(struct jme_softc *sc)
>
> /* Add a new receive buffer to the ring. */
> if (jme_newbuf(sc, rxd) != 0) {
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> /* Reuse buffer. */
> jme_discard_rxbufs(sc, cons, nsegs - count);
> if (sc->jme_cdata.jme_rxhead != NULL) {
> diff --git sys/dev/pci/if_se.c sys/dev/pci/if_se.c
> index 1c75288..b2206ae 100644
> --- sys/dev/pci/if_se.c
> +++ sys/dev/pci/if_se.c
> @@ -947,7 +947,7 @@ se_rxeof(struct se_softc *sc)
> m = cd->se_rx_mbuf[i];
> if (se_newbuf(sc, i) != 0) {
> se_discard_rxbuf(sc, i);
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> continue;
> }
> /*
> diff --git sys/dev/pci/if_vic.c sys/dev/pci/if_vic.c
> index 247c880..78cece0 100644
> --- sys/dev/pci/if_vic.c
> +++ sys/dev/pci/if_vic.c
> @@ -858,7 +858,7 @@ vic_rx_proc(struct vic_softc *sc, int q)
> if (len < VIC_MIN_FRAMELEN) {
> m_freem(m);
>
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> goto nextp;
> }
>
> diff --git sys/dev/pci/if_vte.c sys/dev/pci/if_vte.c
> index fec0bb5..4e4dc32 100644
> --- sys/dev/pci/if_vte.c
> +++ sys/dev/pci/if_vte.c
> @@ -1033,7 +1033,7 @@ vte_rxeof(struct vte_softc *sc)
> continue;
> }
> if (vte_newbuf(sc, rxd, 0) != 0) {
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> rxd->rx_desc->drlen =
> htole16(MCLBYTES - sizeof(uint32_t));
> rxd->rx_desc->drst = htole16(VTE_DRST_RX_OWN);
> diff --git sys/dev/pcmcia/if_xe.c sys/dev/pcmcia/if_xe.c
> index b2d10ad..a6f3f9a 100644
> --- sys/dev/pcmcia/if_xe.c
> +++ sys/dev/pcmcia/if_xe.c
> @@ -684,7 +684,7 @@ xe_intr(arg)
> DPRINTF(XED_INTR,
> ("%s: too many bytes this interrupt\n",
> sc->sc_dev.dv_xname));
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> /* Drop packet. */
> bus_space_write_2(sc->sc_bst, sc->sc_bsh,
> sc->sc_offset + DO0, DO_SKIP_RX_PKT);
> diff --git sys/dev/usb/if_upl.c sys/dev/usb/if_upl.c
> index a42b850..4008e51 100644
> --- sys/dev/usb/if_upl.c
> +++ sys/dev/usb/if_upl.c
> @@ -1011,7 +1011,7 @@ upl_input(struct ifnet *ifp, struct mbuf *m)
> if (sc->sc_flags & SC_DEBUG)
> printf("%s: input queue full\n", ifp->if_xname);
> #endif
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> return;
> }
> IF_ENQUEUE(inq, m);
> diff --git sys/net/if_ppp.c sys/net/if_ppp.c
> index f7cf3d3..0320676 100644
> --- sys/net/if_ppp.c
> +++ sys/net/if_ppp.c
> @@ -1520,7 +1520,7 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m)
> splx(s);
> if (sc->sc_flags & SC_DEBUG)
> printf("%s: input queue full\n", ifp->if_xname);
> - ifp->if_iqdrops++;
> + ifp->if_ierrors++;
> if (!inq->ifq_congestion)
> if_congestion(inq);
> goto bad;
> diff --git sys/net/if_sl.c sys/net/if_sl.c
> index 7b48118..d81c46e 100644
> --- sys/net/if_sl.c
> +++ sys/net/if_sl.c
> @@ -887,7 +887,6 @@ slinput(c, tp)
> if (IF_QFULL(&ipintrq)) {
> IF_DROP(&ipintrq);
> sc->sc_if.if_ierrors++;
> - sc->sc_if.if_iqdrops++;
> m_freem(m);
> if (!ipintrq.ifq_congestion)
> if_congestion(&ipintrq);
> diff --git sys/net/if_spppsubr.c sys/net/if_spppsubr.c
> index 91a3652..9a257fc 100644
> --- sys/net/if_spppsubr.c
> +++ sys/net/if_spppsubr.c
> @@ -504,7 +504,6 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
> SPP_ARGS(ifp), m->m_pkthdr.len);
> drop:
> ++ifp->if_ierrors;
> - ++ifp->if_iqdrops;
> m_freem (m);
> return;
> }
> @@ -532,7 +531,6 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
> log(LOG_DEBUG,
> SPP_FMT "Failed to align packet!\n",
> SPP_ARGS(ifp));
> ++ifp->if_ierrors;
> - ++ifp->if_iqdrops;
> return;
> }
> }