From nobody Mon Nov 02 17:12:43 2026 X-Original-To: dev-commits-src-all@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 4jJJDW3lwRz6y2kD for ; Mon, 02 Nov 2026 17:12:43 +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 4jJJDW2d5Lz3Bqw for ; Mon, 02 Nov 2026 17:12:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793639563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7I4CZIZ5W5xtjQXxmdCtpSrG02pdmLqPYM+6tkxjGrg=; b=l8Poci8lFuk/l1zo5OrQjNhAOnMo/Ptcmwc+Ftwd1BNH3nA8pKXtPFIP8J/2z3IFO6qkS9 ApyiJwjy/ri1pLEyRb6wVoDszWrLd/29KR9pye5loga9X26atr535v2sJc0IDKV9XvwAOD RRRI3wNGGqKDoqASkgp8xHMIuQ/GbEt95UOsps+v6oM3iFN4QkOoof7h9FMov5KCilDF0W cOsYNf8vZIFspJlmcR/ZyGm1Q2gySYvSlcXN9NA793X5qFfi6+h3Ib2f0SRsd7gKBi1PvW oSK5fHUaI8gqA7Buflp9bSsEDuKIuYwRkHMQBhG2HnRkOzXIR+VcII8ZsvvJdA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793639563; b=ysbpgacZ43Zn+A38Jh77lJS7UgOUyJ2zOe13StHU2jE78jLsX+x76lDuRVo0Dz1q731+/g TFDWkdEyhVZpYpnIBVrWnaL++i3Wm8BQuZY0FfR/ybOqxX0hjiY7KzU5up/wn38eJ2pLMQ vgGlhZJVEOvygcGURBBPbr0HHj4QiLUYQ81qf+L4pfLvGSLhqKg35OazroM6bDaNV4oCrk jhn+0fewb353/++3pHv9FiSFbax8ZN/3TD62yogGcAklh5rZciyRK3VU0KIcjp92VnXzUW YyobGQUNfZIy/8zkHigerONAejXH8OKvRbcNHLrxG4g+3voXhmRwwxXaItK2GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793639563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7I4CZIZ5W5xtjQXxmdCtpSrG02pdmLqPYM+6tkxjGrg=; b=mGpHVxv1MhHa8mhuBmqWLOP0gm9A12ayfdjKFddo06/ye7fJa4ZQfB6oWq7xtHs+o6gI5y rcgBXGq1IiWr1FeyexJ2XRYMHfuZracLDjyNpl6KM6L/DPZgV8A0Pr7TBVn+ETB4qu8tCK 4ZTxjNrd0N9ekHU4MpjXr1hkDruY19qkunssSPX2dN9FcItTZ+142rQzClsHo1gMmUKeej 24hGigo8On+a/myBAyKZ3MT2rdBAE25ZLJrr2+QB2qd9uEWHPqPHY80nZu89GshvsVtHs+ SMFeyRlQ66QUkYJkrCRofm5Cl/84nRXbM05oxQ4fwrKtH3af/WQ+WIB9n5sVJw== 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 4jJJDW2HZ7zvkF for ; Mon, 02 Nov 2026 17:12:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f020 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 02 Nov 2026 17:12:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: R. Christian McDonald Subject: git: 5d9f99143690 - main - igc: Count packets dropped for want of a receive descriptor List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the 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: rcm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d9f99143690dcd18e326937769f03514eee2652 Auto-Submitted: auto-generated Date: Mon, 02 Nov 2026 17:12:43 +0000 Message-Id: <6ae8c48b.1f020.55a7008f@gitrepo.freebsd.org> The branch main has been updated by rcm: URL: https://cgit.FreeBSD.org/src/commit/?id=5d9f99143690dcd18e326937769f03514eee2652 commit 5d9f99143690dcd18e326937769f03514eee2652 Author: R. Christian McDonald AuthorDate: 2026-11-02 17:10:17 +0000 Commit: R. Christian McDonald CommitDate: 2026-11-02 17:10:17 +0000 igc: Count packets dropped for want of a receive descriptor When a receive ring is full the hardware drops the packet and counts it in RQDPC, a per-queue register the driver never read. Such drops were invisible: MPC counts packet buffer overflows, not descriptor exhaustion, so an overloaded queue lost packets with nothing to show for it. With several receive queues this is the common overload signature, since RSS loads the queues unevenly and one saturated queue drops while the others idle. Read RQDPC for each queue with the other statistics and account the drops per queue as dev.igc.N.queue_rx_M.rx_drops and in total as the interface's input queue drop counter (netstat -d, Idrop), as ixgbe does with QPRDC. Write the register back to zero after reading; the I210 documents it as read/write rather than read-to-clear. Reviewed by: kbowling MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D61004 --- sys/dev/igc/if_igc.c | 23 +++++++++++++++++++++++ sys/dev/igc/if_igc.h | 1 + 2 files changed, 24 insertions(+) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 7bfbf1c9d1a7..b8a9bd91c2f5 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -3142,6 +3142,19 @@ igc_update_stats_counters(struct igc_softc *sc) sc->stats.htdpmc += IGC_READ_REG(&sc->hw, IGC_HTDPMC); sc->stats.tsctc += IGC_READ_REG(&sc->hw, IGC_TSCTC); + /* + * Packets dropped because a queue's descriptor ring was full. The + * register does not clear on read. + */ + for (int i = 0; i < sc->rx_num_queues; i++) { + u32 rqdpc = IGC_READ_REG(&sc->hw, IGC_RQDPC(i)); + + if (rqdpc != 0) { + IGC_WRITE_REG(&sc->hw, IGC_RQDPC(i), 0); + sc->rx_queues[i].rx_drops += rqdpc; + } + } + igc_update_ecc_stats(sc); } @@ -3166,6 +3179,13 @@ igc_if_get_counter(if_ctx_t ctx, ift_counter cnt) case IFCOUNTER_OERRORS: return (if_get_counter_default(ifp, cnt) + sc->stats.ecol + sc->stats.latecol); + case IFCOUNTER_IQDROPS: { + uint64_t drops = if_get_counter_default(ifp, cnt); + + for (int i = 0; i < sc->rx_num_queues; i++) + drops += sc->rx_queues[i].rx_drops; + return (drops); + } default: return (if_get_counter_default(ifp, cnt)); } @@ -3367,6 +3387,9 @@ igc_add_hw_stats(struct igc_softc *sc) SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "rx_irq", CTLFLAG_RD, &rxr->rx_irq, "Queue MSI-X Receive Interrupts"); + SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_drops", + CTLFLAG_RD, &rx_que->rx_drops, + "Packets dropped for want of a receive descriptor"); } /* MAC stats get their own sub node */ diff --git a/sys/dev/igc/if_igc.h b/sys/dev/igc/if_igc.h index 5b728b6b1193..7c3b90ccee78 100644 --- a/sys/dev/igc/if_igc.h +++ b/sys/dev/igc/if_igc.h @@ -333,6 +333,7 @@ struct igc_rx_queue { u32 eitr_setting; struct rx_ring rxr; u64 irqs; + u64 rx_drops; struct if_irq que_irq; };