From nobody Sun Jul 19 18:50:50 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 4h3CQg0BC2z6lQlS for ; Sun, 19 Jul 2026 18:50:51 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h3CQf5ncnz3R9f for ; Sun, 19 Jul 2026 18:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784487050; 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=P8dqDixU9jG4Yv6SLwH5bd8Wrz/99dEX7plMa6r4Jts=; b=a0knaM6ueYREloZEWZRQVdkMbyuKWrEuj48wI5KUdj6LUxoS9qE8h1gB12cGBYyg+jyyji x6RkyqjQ5OLvnsVrG7qLzO0ye3LV0FsFYT8qDf1xKZJu+MXDk6tZGNKDoofxfYMEfrHldz FSmhN+V8hJLE3KquBw3yiWgLZVyBa0aw8klfgd3ueIsNgnwlSzlkAqjiqFvK3MumE3M65e tyjcZavGKIb+9pTji788g4DnG730PVowM0YuxhkWeW1usGW6j+4PzhhQZxAVoRJd1cFVvd qiXQylKAYcudk1IH8Y9izy5j4+JOU0cAS6IfYFMG8OM084Bah67+GbVoxMm6Uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784487050; a=rsa-sha256; cv=none; b=NgakYaj6Klnqm/7VAv52E8Z4dmYavxtKrA/BxES5Vm/12vUQOxe6+EEVCRAT3kPyqF4Z5S VyyjUZyUVQhNxFF8/VbNfbu5fOhaLe+NKsH4o3vyogaf1IGlSZpFoV7LvHN+9fPfv5qmas QQ+ptAM/p8PTFyLFNEI5B5SSDsBCCkpkwxauKW+37bBLVP5JSqhj59G8yX1HiWqrLsFS9L tsykjWYt04CO04/aL1jjjGfRZTaE6O/seVNGyou0sSdpyPXvkKF05n4SmD+XRqp5J2v0Xs Y0ENBVFMZaCZTPqlGS3Ia6TkTZqX59G80sGaXlBKR1fm/BtVpShuDYCwbUVHIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784487050; 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=P8dqDixU9jG4Yv6SLwH5bd8Wrz/99dEX7plMa6r4Jts=; b=FUj8Kk8MhAWprgbSbCrxnpttLBeQGVGiTbAve5BXVVqdaCOyEn6EkUsiqZh+0yYyIaW2yN JFZz4ioMEYfZ1dyk50p9YrO093Np0bdbBTAB8MTl5/+mYeRA7xvrx5ghaTWsqaMO+wHA4B 4Ojk0+EY8ucRG6u9REJx4bbPXJMWcbjp4/1n91Y8+17dja5qOA39paG/Sk6Kg1NYvQLYuF UGJIq1S5PtHGOcO9WFheRGzCR/r9d4Om2CYLvS6HLzv1LeaYu43HVLIFkJ4WkBaKWcTshG 5GCcvIWae5l9yaXZ8CKZ7OKwZOhcT19+rhcC35baJdavbP0NpudBnMrReA/pEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h3CQf4T39zBrP for ; Sun, 19 Jul 2026 18:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e1f9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Jul 2026 18:50:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: =?utf-8?Q?J=C3=A9r=C3=A9mie?= Jourdin From: Adrian Chadd Subject: git: d11f124e932b - main - re(4): recover Tx completions whose MSI was swallowed in re_intr_msi() 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d11f124e932bfa4fabdc6c5b67735181615a0630 Auto-Submitted: auto-generated Date: Sun, 19 Jul 2026 18:50:50 +0000 Message-Id: <6a5d1c8a.3e1f9.34bfee7e@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=d11f124e932bfa4fabdc6c5b67735181615a0630 commit d11f124e932bfa4fabdc6c5b67735181615a0630 Author: Jérémie Jourdin AuthorDate: 2026-07-19 18:45:47 +0000 Commit: Adrian Chadd CommitDate: 2026-07-19 18:45:49 +0000 re(4): recover Tx completions whose MSI was swallowed in re_intr_msi() A Tx completion that raises a status bit between the ISR ack at the top of re_intr_msi() and the IMR re-enable at the bottom is never re-signalled: these controllers do not re-assert MSI for an already-set status bit (this is why hw.re.msi_disable is a known workaround in the PR). Re-read ISR before re-enabling; if a Tx bit is pending, ack just that bit, reap the ring and restart the queue. Rx bits are deliberately left set so they re-arm the interrupt normally and Rx moderation state is untouched. Also flush the posted IMR write. Mirrors what the INTx path already achieves via the loop in re_intr(). * MSI interrupt mode on RTL8168H under load; "missed Tx interrupts" watchdog recoveries no longer occur. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58278 PR: kern/166724 --- sys/dev/re/if_re.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 4df75474bce3..b04dc3cbaf4a 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -2731,7 +2731,34 @@ re_intr_msi(void *xsc) if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { if (!if_sendq_empty(ifp)) re_start_locked(ifp); + /* + * A Tx completion can set a Tx status bit between the ISR ack + * near the top of this routine and re-enabling interrupts + * below. These controllers do not re-assert the MSI for a + * status bit that is already set, so the completion would not + * be serviced until the next interrupt or the 1 Hz re_tick() + * reclaim (this is why hw.re.msi_disable is a known + * workaround). If a Tx bit is pending, clear just that bit and + * reap the ring now; leave any Rx bits set so they re-arm the + * interrupt normally and the Rx moderation state is untouched. + */ + status = CSR_READ_2(sc, RL_ISR); + if ((status & (RL_ISR_TX_OK | RL_ISR_TX_ERR | + RL_ISR_TX_DESC_UNAVAIL)) != 0) { + CSR_WRITE_2(sc, RL_ISR, status & (RL_ISR_TX_OK | + RL_ISR_TX_ERR | RL_ISR_TX_DESC_UNAVAIL)); + if ((status & (RL_ISR_TX_OK | + RL_ISR_TX_DESC_UNAVAIL)) != 0 && + (sc->rl_flags & RL_FLAG_PCIE) != 0) + CSR_WRITE_1(sc, sc->rl_txstart, + RL_TXSTART_START); + re_txeof(sc); + if (!if_sendq_empty(ifp)) + re_start_locked(ifp); + } CSR_WRITE_2(sc, RL_IMR, intrs); + /* Flush the posted IMR write. */ + (void)CSR_READ_2(sc, RL_ISR); } RL_UNLOCK(sc); }