From nobody Fri Aug 28 02:12:21 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 4hWMN628dnz6pspF for ; Fri, 28 Aug 2026 02:12:22 +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 4hWMN56y5Bz3Gcd for ; Fri, 28 Aug 2026 02:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787883142; 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=sNfVh0Si5LJ+YI+F2iK/vdct7yRaqWb6PeZrgbrtYRE=; b=QNuSAtNwRkkMr7iQnnYCQWRmHaBC3uAxzHdup9C+iWfMEBoWJTwdDQhyWrWqmC1udZPOKh 2bHI4L+dEb98djPSJbQO/p26pJM6rypK855J2+oGentXrewoF7u2ejzN0ZE1QwlMV+cfpa mrHXzELusnhhH89K+nvVnj1X3FZC895QmVwC+kRICwCIaDP7U+ALkTjqkIKCAjq391GPvJ vrfwBujkzFR4Opqj45KEXiIwi7sx7wF6mJWGOLXV93645PYSRfytRdE8TWq/6LBFMyvUBv MtxPkw/1Yy8+HqshlazWmiM0Q2GsH7uZsSj9YUmkInvnagK89FAZfIu2yCXFlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787883142; a=rsa-sha256; cv=none; b=inpoS7s54H0uZ+iVbmJBFoM64XZAInyFgRs1Waxewg3t+18a38Gmja2lfWR5rMFsXveqjo PO6ihPxCG4mlphmmR63G8P/MspNPz3kvibEHw88G60cci34oGxLXM1KLioxIsKF+mPEwfs 2fVxyp+hyUVhrlWb1dmzZdaFTfXw0zAMQ66ge6y2dwpB/pDo7fdDFg300i3lsVVXJlo8H7 zguUpWvmTIWLLrJ1hShB9Gy9J5/N8SfZq+XsLDJRv/4Uoah/7S9D3aQq/uVOCmF6aRiwvx NcsUkR77Ig1QOrm24r8pGtXWrQwukcI4n50r/Q9j/pG7Tndv0pp2Z7XHEhaGfw== 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=1787883142; 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=sNfVh0Si5LJ+YI+F2iK/vdct7yRaqWb6PeZrgbrtYRE=; b=MAzHVwYidFsy/zQjuGv3K2BQ+HXJSf7/UsKz/LpjFQ0JM5xG89HmcqZF8/UJtj1Sgw89cH Uv6+J4SXdbMTELUKchDezqjMhgZF+hqVKFuW84uPWWI8/34XuZObE3ukCjZO0NEhLEuuOy 806sXmuzyNLNj+IbuFUTqwny4zc0xCDdCkTPotV1/jMcHJ/w1JJw1/Z2nLan3K1SgR3FYg DEG58osp98ibSJE239NatOLH6zh1HfKs+nrLxVU5AqXQLs+hFZgWTLXhQploKbwBBG100/ diuR6LzctdoH8pM6vxri5luejGVwrGDUUpAnfyPGpp+07yB9Xj2GtWume8H1yw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hWMN556jRzr5n for ; Fri, 28 Aug 2026 02:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3678f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Aug 2026 02:12:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: be587e656874 - stable/15 - iflib: Add an admin task detach fail point List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: be587e65687493c234ab9723840a1f9b2a8b0841 Auto-Submitted: auto-generated Date: Fri, 28 Aug 2026 02:12:21 +0000 Message-Id: <6a90ee85.3678f.6fa4151e@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=be587e65687493c234ab9723840a1f9b2a8b0841 commit be587e65687493c234ab9723840a1f9b2a8b0841 Author: Kevin Bowling AuthorDate: 2026-08-08 06:18:26 +0000 Commit: Kevin Bowling CommitDate: 2026-08-28 02:11:45 +0000 iflib: Add an admin task detach fail point Add an exact-device fail point immediately after the admin task checks IFC_IN_DETACH. This makes the detach race reproducible without affecting another interface. Use a bounded delay to keep the task active while detach enters the taskqueue drain. Mark the point nonsleepable as a safety backstop, and document a one-shot test for verifying that deregistration drains an already-running task before ether_ifdetach(). Reviewed by: gallatin, kgalazka Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58720 (cherry picked from commit ac56d36007a5a1a01fe69df370f272060e852e0b) --- share/man/man4/iflib.4 | 19 +++++++++++++++++++ sys/net/iflib.c | 11 +++++++++++ 2 files changed, 30 insertions(+) diff --git a/share/man/man4/iflib.4 b/share/man/man4/iflib.4 index 54d5fd6040d2..721eaab3ee24 100644 --- a/share/man/man4/iflib.4 +++ b/share/man/man4/iflib.4 @@ -266,6 +266,25 @@ devctl attach pci0:4:0:0 # succeeds .Pp After detach, a device may no longer have its former name. Use a bus-specific address, as shown in the PCI example above, to reprobe it. +.Pp +The normal detach path can be synchronized with an in-flight admin task to +test taskqueue teardown. +Set +.Va debug.fail_point.iflib.admin_task_device +to the exact device name, bring the interface up, and set +.Va debug.fail_point.iflib.admin_task_after_detach_check +to a one-shot bounded delay, such as +.Ql 1*print(1)->1*delay(5000000) . +The delay keeps the admin task active long enough for detach to begin and +remain blocked in the taskqueue drain. +As a safety backstop, this fail point is marked nonsleepable and converts a +configured +.Sy sleep +action to a delay. +Once the execution message appears in the system log, +detach should wait for the delay to finish. +This exercises the case where an admin task has passed its detach check but +has not yet acquired the context lock. .Sh SEE ALSO .Xr devctl 8 , .Xr fail 9 , diff --git a/sys/net/iflib.c b/sys/net/iflib.c index b4e44321194a..cc17efb0bce6 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -543,6 +543,12 @@ SYSCTL_STRING(_debug_fail_point_iflib, OID_AUTO, register_device, iflib_register_fail_device, sizeof(iflib_register_fail_device), "device name eligible for registration fail points"); +static char iflib_admin_task_fail_device[32]; +SYSCTL_STRING(_debug_fail_point_iflib, OID_AUTO, admin_task_device, + CTLFLAG_RW | CTLFLAG_MPSAFE, + iflib_admin_task_fail_device, sizeof(iflib_admin_task_fail_device), + "device name eligible for admin task fail points"); + /* * XXX need to ensure that this can't accidentally cause the head to be moved backwards */ @@ -4098,6 +4104,11 @@ _task_fn_admin(void *context, int pending) return; if (in_detach) return; + KFAIL_POINT_CODE_COND(_debug_fail_point_iflib, + admin_task_after_detach_check, + iflib_admin_task_fail_device[0] != '\0' && + strcmp(device_get_nameunit(ctx->ifc_dev), + iflib_admin_task_fail_device) == 0, FAIL_POINT_NONSLEEPABLE, {}); CTX_LOCK(ctx); if (!do_reset && do_reset_if_up &&