From nobody Fri Aug 28 02:23:33 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 4hWMd25cJ5z6ptVL for ; Fri, 28 Aug 2026 02:23:34 +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 4hWMd2136mz3K6D for ; Fri, 28 Aug 2026 02:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1787883814; 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=2osuuMFn1uuV5iSrGbp0sAsioR9G/mIuc7GuuqWPm3A=; b=mNiP0Ek6GPAYtva1l9sjUR0ED0ydGdCtLMuyAb/J4A1c5rRvXMMZ3sDWZNQppD48R93zLQ SEcTLMlPqWJB2EYsvGB5PMliRmgo+jjRyBtQ9oNtaqikhsSlXq/CT/5/NBJE9hO2LF73yg wG3rUJBiD8hTDSewIwy2xcHg4IbXChtdgwAZ6vOWluJRADsFVotIDA4/tUt37agvONOoce KdN3n3eTCLtBQifJ8gMr5yfSbfdKD4HN/GmO2OajtWgaFwK4HUNfxnMUL67QNaLPIzpG4v 75LKI0Gzl/Hps8MUctHsHnIPzmBA9sCUOk/NXLzJKkmLg3awThE3YKKuezf+2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1787883814; a=rsa-sha256; cv=none; b=dSxbk5WGJELlO5slH0UCOG3K7yVD4Fdd7wNY2XNfceyjdnANPO0+ArjR7DIXHwXpEg/aia P79R1pp1Saz2Z+T5nySji45GNyNejvsz9M/2bOYRnbhk6yilbXzqBi9Sy2dvjP1czsqw16 vu6IAfJz3/9ZYrpl26ngqmkMGO2eyhJzLZYbz1Kl6GO/CqBq7iEccxQmwQiYd0x7j7NwOO aUHjiioze6bX+ZYbKPrpm4TElPe4xeZE5WuECy0f1P3mAkDY8QpNFoufO6Z8lIrvUlUqdL exJGiuZJUX17LPKxyR0lFRfZ5ZcTF2NP6lfSWwWhQUZeyO9D0Rn7hk3loeekCQ== 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=1787883814; 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=2osuuMFn1uuV5iSrGbp0sAsioR9G/mIuc7GuuqWPm3A=; b=HXruAlsjyn+btCy84WA6BwQS3po57wtJWL00ts03+c8d91i0usIqvjWlncNq/QMrwzwOVD ox2BW53ZttgNJlfYepXUKHRZp9oAjPBvv4FIFYbP/XSmQhwEEiL0/76l6Xm/hUEGA3ThB4 ROWOfxbSDLFypOVBxQumBM1bdpW2qwxO8p6BZf1QjxVWmFrBg9T9oOBlJbvX3Ic9j9DiMl WgZBOy/1gspsOCWHxEQgEp9TifHzcWAzccLIaXoz+ujlKH1r6puU6LzkCa3RYhnMQWDamZ jp+ZwRUFTQXrzNGa92DHSgBKdKaqx74Na1Nezm4Txa364voSCFb5gOawSl9MZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hWMd16kPLzrLQ for ; Fri, 28 Aug 2026 02:23:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34ae7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 28 Aug 2026 02:23:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 375892c6ab09 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 375892c6ab09107e92a781a84f11546ac75ae2f5 Auto-Submitted: auto-generated Date: Fri, 28 Aug 2026 02:23:33 +0000 Message-Id: <6a90f125.34ae7.c70923c@gitrepo.freebsd.org> The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=375892c6ab09107e92a781a84f11546ac75ae2f5 commit 375892c6ab09107e92a781a84f11546ac75ae2f5 Author: Kevin Bowling AuthorDate: 2026-08-08 06:18:26 +0000 Commit: Kevin Bowling CommitDate: 2026-08-28 02:20:57 +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 94502f3c49b3..79c58107f0ed 100644 --- a/share/man/man4/iflib.4 +++ b/share/man/man4/iflib.4 @@ -244,6 +244,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 0eb4b86542cb..593b8c4396c8 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -537,6 +537,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 */ @@ -4169,6 +4175,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 &&