From nobody Fri Aug 14 22:17:55 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 4hMGnb5f3bz6nrmq for ; Fri, 14 Aug 2026 22:17:55 +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 4hMGnb51kBz3lfG for ; Fri, 14 Aug 2026 22:17:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786745875; 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=lbYVsNaIrEPdFsecmXoCHgE7bXhMjZHkhv47xh1m8OE=; b=c+Kz0YBELdJ5u5zNkrnVNlY+mPV/4d5NZSRcxW3UlVeMuEFydfbAFe4oE1V4qVPT11W4Kc a5pMZdrlWGKN3APlrrTMmZ6ZDDWqnMdFWjCMq2LDoyLbGSGKvNiP8G91qZpeDmggtFnY1V M9pNqHWCTETGHPziM2dIK799AFfm+M0rGRg4GhX5iYKYvpT8ikKlHMZvwPmvmzoM+uWlvL ZmQoreQycHAlmMK6RNjhCr/jqnhUJPl+YK37zHAdFykL9PQYM+8DjaPegdT4c4Kb5z/RKX 6TNpybtLU5F/X+T/2cI7vBYymaAJcEHntjf1nEULWn2HppcZQY6R7RRB2YkKzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786745875; a=rsa-sha256; cv=none; b=GSl0I70siCztXqVIXtYdfe1jzJPxn3C3WXb9RnjToUbc2X+MkbwCT/QN00Ha2k54fC9PBT JIgZwLdQmEUiku5SY+qgJ1HY9HmGe3rIkVf2wWUjpmCW+5miOZKh0ktwZLLwT6a37XUUrC BqFU1D7ZA+CRkFF8y8epqGKcsv4um7YEMOn0CDD+gIDsLkTwq8bY2WB1w/xAA6IT9BAFl/ X7zUO26w/p9ghpgIMhREVx/CvQ9Lt3/W2zCo1XgdMUXfAcwEbeT5PSuYI8uZJcvx0fgtDd K8jQDb12ljpnD3uQbxLNdT6FLNN7v84BIsablGGFd/SUdUn5behMoVIv6yDyyA== 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=1786745875; 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=lbYVsNaIrEPdFsecmXoCHgE7bXhMjZHkhv47xh1m8OE=; b=wq1x7Vr8RCG3dA+xfkRnnqAQyGT6l3MV1GQamAf9Sa+rOJbz8VK1/sToO24yq/hHsyLkYl UVLRjm0zxwX3AeXxILZPXz2ZrGXq4drcV23Wu2UZqsYAFeF9AzGgeiPkTjkwT1AU2kHLGt 5JZ9CMST1qla2BFqsNUEYAe1BtGWlA11dx0b/WHcZTWjnBleK8iy4tYGZXiJ70bug+EIUE 2BDU8eGMK59DsO7xpwpcM4RIl3pBUcv7vmNe/mqCj/G4KbhJ9X3QSVuieIjAWujSKNvqTl 39K9+ELysDsJ9HBfR41AJPJ6k1dQZgGGjWyHpvYHcjpVCreD+J4LuUzN7kjs6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hMGnb3g6Qz2Jc for ; Fri, 14 Aug 2026 22:17:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f7a0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 14 Aug 2026 22:17:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: ac56d36007a5 - main - iflib: Add an admin task detach fail point 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac56d36007a5a1a01fe69df370f272060e852e0b Auto-Submitted: auto-generated Date: Fri, 14 Aug 2026 22:17:55 +0000 Message-Id: <6a7f9413.1f7a0.46f466a2@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=ac56d36007a5a1a01fe69df370f272060e852e0b commit ac56d36007a5a1a01fe69df370f272060e852e0b Author: Kevin Bowling AuthorDate: 2026-08-08 06:18:26 +0000 Commit: Kevin Bowling CommitDate: 2026-08-14 22:17:04 +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 MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D58720 --- 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 031e33a2409e..4cf08602fd04 100644 --- a/share/man/man4/iflib.4 +++ b/share/man/man4/iflib.4 @@ -286,6 +286,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 cda60f174a31..9efd4b56c5d1 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -575,6 +575,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 */ @@ -4233,6 +4239,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 &&