From nobody Mon Oct 05 15:19:05 2026 X-Original-To: dev-commits-src-main@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 4hz32K5rYrz6k1sn for ; Mon, 05 Oct 2026 15:19:05 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hz32K5Fdqz3R2x for ; Mon, 05 Oct 2026 15:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791213545; 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=FODi7qRtzInxvJgEQZ7A3u43/BXEMWiWQvbv/SK3VCA=; b=oOcJFvCkq1zvkPDPnsV1f4B0aRP5QKx+/esOlANT17b5+6eCFKWYLmjj4vMWmDgQspWXFB l5FQzkEtXYLcPUa/N4XL9MSOqk4fLT5dM/DxkyvfDD2AH1b4e0ToWIfoJ4M8tPQJvhI9K1 cXaD0/dwpL1tVmBO2wRhd5R5c5SaTDK0cE90e6q0EVZWhfGdt3NrnA/9eMuQNYDQghMnaU PzoYpOtHNw72NT0+qncHVLgPQdogH7Ly92eG4omvERvrYjS8IEYjYUUuCRfumVqLKEHhUR Pqa0+s3uwCGavGCMJ80aKC3VozqRO8BXwSbcATzftctiQOW//Qo7pGjKbf+xmg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791213545; b=KZaK+v865l+2l1l672/25xpQw3fKd1yMorWa4wNgts/Pb0nKRp2onK8q/jnk7YJnUVWi/5 3cT+UONHaYcLYlyc8gpVSVkrLRh17/j8IExDhS+qQNP6EXumJpVBdgjnzrOTWwrKY177cQ i75IFlYsTTrAJUoS4mDkP39kAHzkvaFn+RULrm1G5+veD5TyuvhAk+pJU8yFl2I+yMbE4D zOaeZkkHZUWDghNsFiOVD1AV7qtWI8C4HC2L1mGQuAq/1NcAj/jO5blbFbwJmpgqY7ga+y jgdaRs+w+IdIiWLh0DA4OQzYMPy/Cg//D03ZonIGMCouKb1+oWS9xh0SghZ1Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791213545; 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=FODi7qRtzInxvJgEQZ7A3u43/BXEMWiWQvbv/SK3VCA=; b=vXW/2uNP81fmnWDEguICyKfcyucSBKHi8dhD5jH24dp1bDOUnUywCcVZQtqcmJHqCRXGjT JfXLCVm2Ij8ZgnOV3er/1sL4k092hh3T5oCxZ9yohRHo6RJbmy2YI6q878Pd6XHiyHOQGe TBQymhHi/YNwX/2YfMcHms/TrkoXla4sPX+nmzTrWBmVQJtsVBWp/WsQzC/88Y+KoeJ7za tsMn/Et8Cp4PfH7sPpjsBYIhwONyML++l0MV2YxFlJGhm8Ns/28mi/7A6VsbjDvZSFLHIO J/b4IHD+dlO1nUB8KfUT+Rwuo9YWXeSD7OfnypzdtY6cPQGWa0zsb2A6BbTtgQ== 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 4hz32K41t6zPhQ for ; Mon, 05 Oct 2026 15:19:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ca4a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 05 Oct 2026 15:19:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: R. Christian McDonald Subject: git: 4a0ec469934a - main - iflib: Do not ring the transmit doorbell when nothing is pending List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: 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: 4a0ec469934a5de60b9b540689703a698ac44105 Auto-Submitted: auto-generated Date: Mon, 05 Oct 2026 15:19:05 +0000 Message-Id: <6ac3bfe9.1ca4a.1d0623d2@gitrepo.freebsd.org> The branch main has been updated by rcm: URL: https://cgit.FreeBSD.org/src/commit/?id=4a0ec469934a5de60b9b540689703a698ac44105 commit 4a0ec469934a5de60b9b540689703a698ac44105 Author: R. Christian McDonald AuthorDate: 2026-10-05 15:17:13 +0000 Commit: R. Christian McDonald CommitDate: 2026-10-05 15:19:01 +0000 iflib: Do not ring the transmit doorbell when nothing is pending For a lightly used ring iflib_txd_db_check() may defer zero descriptors, so its "pending >= limit" test is true even when nothing has been queued since the last doorbell. iflib_txq_drain() calls it before, inside and after its loop, so a sender that drains its own packet wrote the tail register three times per packet, twice with the value the hardware already had. The log of 81be655266fa ("iflib: ensure that tx interrupts enabled and cleanups") calls skipping the doorbell when db_pending is zero "an obvious missing optimization"; the comparison against a limit of zero defeated it. vmx(4) and mgb(4) have dropped such repeated requests in the driver since 2019. Return early when nothing is pending. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D60290 --- sys/net/iflib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index c2e70d946bf6..834cc37cb6ab 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -3457,6 +3457,13 @@ iflib_txd_db_check(iflib_txq_t txq, int ring) if_ctx_t ctx = txq->ift_ctx; qidx_t dbval, max; + /* + * Nothing has been queued since the last doorbell. The threshold is + * zero for a lightly used ring, so the test below would not catch this. + */ + if (txq->ift_db_pending == 0) + return (false); + max = TXQ_MAX_DB_DEFERRED(txq, txq->ift_in_use); /* force || threshold exceeded || at the edge of the ring */