From nobody Tue Aug 4 17:15:59 2026 X-Original-To: net@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 4hF0Yr3wC3z6n5ZQ for ; Tue, 04 Aug 2026 17:16:00 +0000 (UTC) (envelope-from bugzilla-noreply@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 4hF0Yr3BtQz3tQD for ; Tue, 04 Aug 2026 17:16:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785863760; 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: in-reply-to:in-reply-to:references:references; bh=SHw/e4HuO004pAuRbJWGcvYoETQ9Gh4LTKCO3rVhPDs=; b=DsVTpljA9L50/Ct1i6jbT7TKFBPnhCH8Mz+g0EjF4tNyw/8oEGxu9asiPuYdiXQC6PrL3H q1wfVLvZ8dpjfTzs+Z1A9iq4RzcThRYn+yFzS3A2xkqXCwooYgL1xk6fxEzPqNgz7r+5hx jxebmPkzDPNNmB0BYC5ZP1xY7zMr06VxbPrKDARN2fCOBXp/qTGEw83zkisWyznrW00khl MvcSUWScS+gfHQ2yO/JcfddY+8k5fir6V4w1ddplZ/gxNYYhhV1FgdIpcgSHsT1E9L+wmx U7Sh+NnpXBKWIyI9uuagrsIITdqDV8D/vWR66/lJGpQKyhhM//6KAW6FEqWQ7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785863760; a=rsa-sha256; cv=none; b=M9f0+XBMpcLsS3veV3S73iaD1fmdLi3aAiAcc6D29wgd41beBXTQQPnu8wsWAMs973XqCS +AXBex/gICV7zgYjc4apc5OfR3XYW7MOFND/EfEhTZhBbQLROQQjK1Gxj6dpCsn1Tj3C1P s6TxTVfbYfgLGwL9lyuLeqX5XixyLN9e7VXnhmxrM4L14Dx5e6heXC8dvVdUY+Z4+8HlMo K6njhfEtI2BiTr7w03Ay7zm03605Bbq5RAxP5UDpgx92QtOSq8BsA1OWjY+oc4dKzL0Gdu cuwIbOI5SqHIZhGQCKV12upKDBJXCUeIvnhLhqkMRgwgfyr/aXhN0FuiSuqRlA== 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=1785863760; 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: in-reply-to:in-reply-to:references:references; bh=SHw/e4HuO004pAuRbJWGcvYoETQ9Gh4LTKCO3rVhPDs=; b=hPqHDCzfJ1Qb8a7JADlttA2thB07J8abwcy4d3FduRzLLTiG6na8B0bV42dcwoK3wAhS9L xsopS4/RxKeajY7yK/zjeGRzabRd7ke50WE3Ee1yQ06+d094eE/63wsm2/NTcaMf8L9ur+ hRjD1+c4hIlS+lLD+lQ+A12aG858Dv/P9wEdjYvt25n9Iai+YbE03pWeeYdNU/ysXwQJNi Vaf9V1P1FO2FZtSxM8QJgXAPWzH4loDZ+5gnngDz0rE5THmlHYsOThC10xr7NxVGt0FVYW jndiXFBl1u1FXlReSRtBq3G1hLjwO/6YEx9t1atCm3UkSyr4CeVyDX5rUaO15Q== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4hF0Yr1yZzzwtb for ; Tue, 04 Aug 2026 17:16:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 674HG07c063803 for ; Tue, 4 Aug 2026 17:16:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 674HG0F2063802 for net@FreeBSD.org; Tue, 4 Aug 2026 17:16:00 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 220997] Broken watchdog after iflib update (em0) Date: Tue, 04 Aug 2026 17:15:59 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: IntelNetworking, regression X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D220997 --- Comment #19 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D69c3e0de01c1938792d319f18ba0a9ffa= 60dfa96 commit 69c3e0de01c1938792d319f18ba0a9ffa60dfa96 Author: Alexander Leidinger AuthorDate: 2026-08-04 16:44:52 +0000 Commit: Alexander Leidinger CommitDate: 2026-08-04 17:13:43 +0000 iflib: restore TX watchdog functionality Since f6afed726b00 the TX-hang check in iflib_timer() has required a queue state other than IFLIB_QUEUE_IDLE, but nothing ever sets IFLIB_QUEUE_WORKING, so IFLIB_QUEUE_HUNG has been unreachable ever since: stalled TX queues are not detected, not reported, and not reset - the TX watchdog of every iflib(4) driver has been dead code. Instead of resurrecting the queue-state machine, detect the hang directly. A transmit queue is frozen while it holds descriptors the hardware has not reported as completed and none were reclaimed over a timer period. Being frozen is not a fault: the hardware may defer marking descriptors as completed indefinitely. The check therefore arms only when a frozen queue also takes on new work, while the link is up, no pause frames were received and no doorbell is pending; and it acts only after the queue has stayed frozen for net.iflib.tx_watchdog_periods consecutive periods. It then asks the hardware through the driver's read-only credits peek (isc_txd_credits_update with clear=3Dfalse, the same call the mp_ring can_drain callback makes routinely): if completions are ready but were not harvested for this long, the completion interrupt went missing - kick the queue's task instead of resetting; if the hardware reports nothing although the queue kept receiving work, it is hung and the existing watchdog reset machinery takes over. Neither software counters alone nor mere persistence of unharvested work can make this decision. iflib reclaims lazily (up to isc_tx_nsegments completed descriptors stay unharvested indefinitely) and defers report-status requests, so "descriptors in use" and "no cleaning progress" are normal states of an idle healthy queue. And hardware that coalesces completion reports (e.g. 8254x, TXDCTL.WTHRESH) legitimately withholds the last one of a quiet queue indefinitely, so a zero credits peek is a normal idle state, not a hang indicator: arming on persistence alone reset healthy interfaces on every traffic lull (field-tested on 82541PI). Only growth across frozen periods separates a wedged queue from a coalescing one. The threshold is a threshold in time, not in device work: a period is one iflib_timer interval (hz/2 by default), so at the default of four periods the verdict falls after roughly two seconds. It was calibrated from counter traces on that old and slow hardware, where healthy coalescing always cleared within two periods; newer hardware reports completions far sooner and leaves the frozen state earlier, so the default needs no recalibration for more modern devices. Setting the sysctl to zero disables the check. A queue whose link is down is never flagged - preserving what f6afed726b00 fixed. The new per-queue state goes into padding the transmit queue structure already had, rather than next to the counters it is derived from: that region is packed, so an insertion there would grow the structure. What is left of that padding is now spelled out instead of being implicit. The size of the structure is unchanged on amd64, arm64, riscv64, i386 and armv7. The IFLIB_QUEUE_* states no longer participate in the watchdog decision; they will be removed in a followup commit. PR: 220997, 239240 Fixes: f6afed726b00 ("iflib: Prevent watchdog from resetting i= dle queues") Suggested by: gallatin (mxge-style detection) Reviewed by: adrian, markj MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D58266 Assisted-by: Claude Code (Fable 5, Opus 5) share/man/man4/iflib.4 | 11 +++- sys/net/iflib.c | 135 +++++++++++++++++++++++++++++++++++++++------= ---- 2 files changed, 118 insertions(+), 28 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=