From nobody Thu Oct 29 06:02:55 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jFYYX1jczz6xr6Y for ; Thu, 29 Oct 2026 06:02:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jFYYX0lxvz4rnH for ; Thu, 29 Oct 2026 06:02:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793253776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3b7FdI5Lt3vhI1vsxZtgrksbQBxkSzC088EBWrr8J58=; b=bJUXsqSeybVnIkB2qoUpUq/kjz7QWfN6S/zGmoEZaVwInXOiOcEXD8LVGyqG+Zyi8TCyee xJHc/Efe8v2V0Vw8cOfGim4y4vlklYWUADazFhWCtkGduZoBnOODbC7zwU1+Ww+/LsWV+g D8D0T85G9AeT7peRDEXk5iy4yrm5rr/chDwqLstYxeakEHzTodqvGuFJ4EkOI27iVfx8GR hPDPa6DnFjxgMnLBLNPj6ltf6Fclwq34uD74oMJLXP9x7umTStWcwvT552l6J997oqeNDu 1OqvmKWfd2RavJ4rq+licDwGLe7eKAM5nHeVdtCe8vKrVSmt0kj5975YCT2FwQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793253776; b=fGYrP68P6g/FMtjGE4qTOAoVWLwdrUp+K1Zo/YkfNdgcAlEuwyl+xU1rJQI4mnP9xB7b0C YLg13mG1MUJrOZ3osE7qZSxAwkP4qy5mfGmq4qEvSIJiIG8BRocTRZrHNu0GBbbrUZvUD4 J93u89FatHH28YfNnHgjNmSj6EPhvJhaG8/gZSiGh1UE41LPEM000FODp5JUKmOnunMmNd zmndDSUAJjcTYdTPs6PmKTPHz+fdzY4mQUVIKsRLr/1OxnRT66iX2A+hsVzziM9Jsu6YTm Xnei2y2SjzTwnOTeVSc4Bu5UVj1hdaRFXkZnnTU0AJKxGv1DJwWrwLLmY4M8VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793253776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3b7FdI5Lt3vhI1vsxZtgrksbQBxkSzC088EBWrr8J58=; b=bvjffvyIdsVvLWNpwenxsR5Vs5qCXPEXBwAGJh3naoC0N0OMReoPQqCBtI5gXCNdSwjCw5 y5F+90T1/x/Z1hWXW17DIfL84ulFSTUnrBFxE96olRXnZHUeWENn4mKILAmSXNHqg8g/zN 0OvUFaMUnnpL8O6yw/pMhywvwE4/GLk3cCzod0CWjqWRBmYejwfTGRMJV2H8ZSC36zzC3e /XH8bOMLjs4by3pHwVea+AO1JBSAdLER4mvlPdjNn57VOSKOdYnhCkmv0Q7l0UZ34KDslP lvEB2epTQSo8BhganpP0M+Pn90iRu5CdD2H6MFD/MpW0Pc591aMlfjBmo4QVUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jFYYX0QYtzPsY for ; Thu, 29 Oct 2026 06:02:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a685 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 06:02:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Andrew Gallatin From: Kevin Bowling Subject: git: 87cd7c333f7c - stable/15 - iflib: report output drops and handle ENOBUFS properly List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 87cd7c333f7c6307a9a207be038079b51a1bcd16 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 06:02:55 +0000 Message-Id: <6ae2e18f.3a685.2a4120b3@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=87cd7c333f7c6307a9a207be038079b51a1bcd16 commit 87cd7c333f7c6307a9a207be038079b51a1bcd16 Author: Andrew Gallatin AuthorDate: 2025-09-10 13:17:35 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 05:22:34 +0000 iflib: report output drops and handle ENOBUFS properly - Fix an mbuf leak with iflib.simple_tx=1 when we run out of tx descs in iflib_encap(). It seems odd to free the mbuf in iflib_encap(), but that routine consumes mbufs for other reasons, and it seemed safest to free there rather than have the simple tx routine parse return values to determine what needed to be freed. - Increment counters for output drops when ENOBUFS is encountered and output errors when other transmit errors are encountered for both the simple and normal tx routines. - Performed driver changes so that iflib drivers now add the generic output drop and output error counters to their private counters in their ifdi_get_counter routines. Reviewed by: kbowling, markj Differential Revision: https://reviews.freebsd.org/D52369 Sponsored by: Netflix (cherry picked from commit 6577e32ea2c7868c275eae6d1c68f1c37d418c71) --- sys/dev/axgbe/if_axgbe_pci.c | 3 ++- sys/dev/e1000/if_em.c | 4 ++-- sys/dev/enetc/if_enetc.c | 3 ++- sys/dev/ice/ice_lib.c | 6 ++++-- sys/dev/igc/if_igc.c | 4 ++-- sys/dev/ixgbe/if_ix.c | 2 -- sys/dev/ixl/if_ixl.c | 4 ++-- sys/net/iflib.c | 15 +++++++++++++++ 8 files changed, 29 insertions(+), 12 deletions(-) diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index 51db5ce54df7..00b4c6c1d451 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -2413,7 +2413,8 @@ axgbe_if_get_counter(if_ctx_t ctx, ift_counter cnt) 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 index 6cd7ebce5f0f..74da82296b59 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -6864,8 +6864,8 @@ em_if_get_counter(if_ctx_t ctx, ift_counter cnt) stats->ruc + stats->roc + stats->mpc + stats->cexterr); case IFCOUNTER_OERRORS: - return (stats->ecol + stats->latecol + - sc->watchdog_events); + return (if_get_counter_default(ifp, cnt) + + stats->ecol + 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 index dcc6d4585991..55fec66266fe 100644 --- a/sys/dev/enetc/if_enetc.c +++ b/sys/dev/enetc/if_enetc.c @@ -1347,7 +1347,8 @@ enetc_get_counter(if_ctx_t ctx, ift_counter cnt) 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 index 3965196f728d..e84895393175 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -7823,7 +7823,8 @@ ice_get_ifnet_counter(struct ice_vsi *vsi, ift_counter counter) 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: @@ -7837,7 +7838,8 @@ ice_get_ifnet_counter(struct ice_vsi *vsi, ift_counter counter) 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 index 1cf866dba374..3734bb09508e 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -3171,8 +3171,8 @@ igc_if_get_counter(if_ctx_t ctx, ift_counter cnt) sc->stats.ruc + sc->stats.rfc + sc->stats.roc + sc->stats.mpc); 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 index 0f6604693432..ada3cead1dd1 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -1549,8 +1549,6 @@ ixgbe_if_get_counter(if_ctx_t ctx, ift_counter cnt) 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 index 892e663588ad..ed7163c9eba4 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -1899,7 +1899,7 @@ ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt) 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); @@ -1914,7 +1914,7 @@ ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt) 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 index c008d915fd6d..e27479b9f529 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -3740,6 +3740,12 @@ defrag: 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); @@ -4412,6 +4418,10 @@ iflib_if_transmit(if_t ifp, struct mbuf *m) 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); @@ -7524,6 +7534,11 @@ iflib_simple_transmit(if_t ifp, struct mbuf *m) 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);