diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -2415,7 +2415,8 @@ case IFCOUNTER_OPACKETS: return (pstats->txframecount_gb); case IFCOUNTER_OERRORS: - return (pstats->txframecount_gb - pstats->txframecount_g); + return (if_get_counter_default(ifp, cnt) + + pstats->txframecount_gb - pstats->txframecount_g); case IFCOUNTER_IBYTES: return (pstats->rxoctetcount_gb); case IFCOUNTER_OBYTES: diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -4782,8 +4782,8 @@ sc->stats.ruc + sc->stats.roc + sc->stats.mpc + sc->stats.cexterr); case IFCOUNTER_OERRORS: - return (sc->stats.ecol + sc->stats.latecol + - sc->watchdog_events); + return (if_get_counter_default(ifp, cnt) + + sc->stats.ecol + sc->stats.latecol + sc->watchdog_events); default: return (if_get_counter_default(ifp, cnt)); } diff --git a/sys/dev/enetc/if_enetc.c b/sys/dev/enetc/if_enetc.c --- a/sys/dev/enetc/if_enetc.c +++ b/sys/dev/enetc/if_enetc.c @@ -1343,7 +1343,8 @@ case IFCOUNTER_IERRORS: return (ENETC_PORT_RD8(sc, ENETC_PM0_RERR)); case IFCOUNTER_OERRORS: - return (ENETC_PORT_RD8(sc, ENETC_PM0_TERR)); + return (if_get_counter_default(ifp, cnt) + + ENETC_PORT_RD8(sc, ENETC_PM0_TERR)); default: return (if_get_counter_default(ifp, cnt)); } diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -7818,7 +7818,8 @@ case IFCOUNTER_OPACKETS: return (es->tx_unicast + es->tx_multicast + es->tx_broadcast); case IFCOUNTER_OERRORS: - return (es->tx_errors); + return (if_get_counter_default(vsi->sc->ifp, counter) + + es->tx_errors); case IFCOUNTER_COLLISIONS: return (0); case IFCOUNTER_IBYTES: @@ -7832,7 +7833,8 @@ case IFCOUNTER_IQDROPS: return (es->rx_discards); case IFCOUNTER_OQDROPS: - return (hs->tx_dropped_link_down); + return (if_get_counter_default(vsi->sc->ifp, counter) + + hs->tx_dropped_link_down); case IFCOUNTER_NOPROTO: return (es->rx_unknown_protocol); default: diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -2599,8 +2599,8 @@ sc->stats.ruc + sc->stats.roc + sc->stats.mpc + sc->stats.htdpmc); case IFCOUNTER_OERRORS: - return (sc->stats.ecol + sc->stats.latecol + - sc->watchdog_events); + return (if_get_counter_default(ifp, cnt) + + sc->stats.ecol + sc->stats.latecol + sc->watchdog_events); default: return (if_get_counter_default(ifp, cnt)); } diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1350,8 +1350,6 @@ return (0); case IFCOUNTER_IQDROPS: return (sc->iqdrops); - case IFCOUNTER_OQDROPS: - return (0); case IFCOUNTER_IERRORS: return (sc->ierrors); default: diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -1785,7 +1785,7 @@ case IFCOUNTER_OPACKETS: return (vsi->opackets); case IFCOUNTER_OERRORS: - return (vsi->oerrors); + return (if_get_counter_default(ifp, cnt) + vsi->oerrors); case IFCOUNTER_COLLISIONS: /* Collisions are by standard impossible in 40G/10G Ethernet */ return (0); @@ -1800,7 +1800,7 @@ case IFCOUNTER_IQDROPS: return (vsi->iqdrops); case IFCOUNTER_OQDROPS: - return (vsi->oqdrops); + return (if_get_counter_default(ifp, cnt) + vsi->oqdrops); case IFCOUNTER_NOPROTO: return (vsi->noproto); default: diff --git a/sys/net/iflib.c b/sys/net/iflib.c --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -3646,6 +3646,12 @@ bus_dmamap_unload(buf_tag, map); DBG_COUNTER_INC(encap_txq_avail_fail); DBG_COUNTER_INC(encap_txd_encap_fail); + if (ctx->ifc_sysctl_simple_tx) { + *m_headp = m_head = iflib_remove_mbuf(txq); + m_freem(*m_headp); + DBG_COUNTER_INC(tx_frees); + *m_headp = NULL; + } if ((txq->ift_task.gt_task.ta_flags & TASK_ENQUEUED) == 0) GROUPTASK_ENQUEUE(&txq->ift_task); return (ENOBUFS); @@ -4298,6 +4304,10 @@ ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); m_freem(m); DBG_COUNTER_INC(tx_frees); + if (err == ENOBUFS) + if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); + else + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } return (err); @@ -7141,6 +7151,11 @@ bytes_sent += m->m_pkthdr.len; mcast_sent += !!(m->m_flags & M_MCAST); (void)iflib_txd_db_check(txq, true); + } else { + if (error == ENOBUFS) + if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); + else + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } (void)iflib_completed_tx_reclaim(txq, RECLAIM_THRESH(ctx)); mtx_unlock(&txq->ift_mtx);