From nobody Fri Aug 14 22:08:57 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 4hMGbF3h3Pz6nrVH for ; Fri, 14 Aug 2026 22:08:57 +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 4hMGbF2tkjz3km7 for ; Fri, 14 Aug 2026 22:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786745337; 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=L9zwEkZevsnIbr6FocfWgLuMRnOP9edtdYtmYU82uvc=; b=bPFrXsaecfynzT8fPAW2S7aQ1fVxua+VZ8hMZ+ihyaOMKqDo15ptDOGROEzHOM58bGugbe qJQ3oXc9jf/qEBXdg0p8a8tVhSLr1HCnz+9TqWpc3SakpjIAITM4RYuwlCFUfeh2V947ND JKRfjK1GsJDI7KU8kMDqOjo6eJ1IdnrcLcX1/ZEGBr6ERs8yfMEGYOwI4OAgPlm4j0FpIm AhlbElZmgikO5jVteeqmU3d/35hQtJ6010qR2TqTGRSSJKQIjvXCJzSX+vzg0UiViuaF9J /sXrzGid13+23ixdoxFlmDwp5YHLXnmgsbQ6QqJNQStL06MWtnsE9XxeREzivQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786745337; a=rsa-sha256; cv=none; b=Ue70FbZEZA6BplXzK828konFLouSkBVCaLVvHRpWvRlQk60N0fyzFPj1dd2NOxaHD7S/zv jK10MYTo/C4TlwVLmx2+xYMxZ8Em8VIgsWC6oIpT+nIBkWp3n+k9TDGqCkDglUU4k2lSJa TEUhpHxSoT6zfdzQ5Mdml0Ehx18cfZp6cvWiuWczd+AJGzjBFk3F7PB7GmNZUpFG0aCX7r qBW+NJ7LNXk0kqFArnV2lOjAV9u9kg5MZ+gPnyAcMB51WE+9ZylmknOkL51ZWgMeDdzP9m zAWtR9NXoV8WbQNkAaPUe1I3cByTmEmoh4We5Z3qETaysv0FtpLrA5gkn2ySGg== 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=1786745337; 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=L9zwEkZevsnIbr6FocfWgLuMRnOP9edtdYtmYU82uvc=; b=WHG4ayI1IPp6seVSsHy+mzou2YyLwWd8mqkNwgKSZ4XQpr90LLw3RLut8gMdSii/+5/HD0 MDxT2hEqruCvXH/KtAJXNnmhZ7LAlQjr+zIMSKDcyyuADI2oQuWHErm0gqD1/fnSkdM1Fy F7kZEH2L49uG2K0+NokS6XA8LTNUeqvEjiM78rPUD51zYvxhRuSN8CnPHQYEhbvwRk4dej I5bJtYHwTUL227g1cUW0zxzx2ETZli7AALY2KbJ3+1lR9tLFwqrli1ncxa43xwI3RaAJNs RG5BYA8y4z+CKu4JScT2Ywydt4fx69oFupYUwYRp20UVio1dctlbv+ASZUePeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hMGbF1wLZz1s9 for ; Fri, 14 Aug 2026 22:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f0e5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 14 Aug 2026 22:08:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Nick Price From: Kevin Bowling Subject: git: ba353c8950d5 - main - iflib: Drain configuration tasks before interface detach 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/main X-Git-Reftype: branch X-Git-Commit: ba353c8950d575f9d15b82c92658e660935fba25 Auto-Submitted: auto-generated Date: Fri, 14 Aug 2026 22:08:57 +0000 Message-Id: <6a7f91f9.1f0e5.45cfc0a@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=ba353c8950d575f9d15b82c92658e660935fba25 commit ba353c8950d575f9d15b82c92658e660935fba25 Author: Nick Price AuthorDate: 2026-08-08 06:17:16 +0000 Commit: Kevin Bowling CommitDate: 2026-08-14 22:08:36 +0000 iflib: Drain configuration tasks before interface detach iflib_device_deregister() sets IFC_IN_DETACH before removing the interface, but a task which already passed its detach check can still report a link change. This can re-arm if_linktask after ether_ifdetach() has drained it and leave work pending across queue teardown. Drain the entire private taskqueue before ether_ifdetach(). Drivers may register their own link-related configuration tasks there, so draining only the framework admin task leaves the same race for those drivers. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D58452 Co-authored-by: Andrew Gallatin Co-authored-by: Kevin Bowling --- sys/net/iflib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 461ff0ba273e..cda60f174a31 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5658,6 +5658,13 @@ iflib_device_deregister(if_ctx_t ctx) iflib_unregister_vlan_handlers(ctx); iflib_netmap_detach(ifp); + /* + * A task that passed its IFC_IN_DETACH check before the flag was set + * can still report a link change. Drain every private task before + * ether_ifdetach() performs the final if_linktask drain. Drivers may + * register their own link-related tasks on this taskqueue. + */ + taskqueue_drain_all(ctx->ifc_tq); ether_ifdetach(ifp); CTX_LOCK(ctx);