From nobody Mon Aug 31 21:18:47 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 4hYhgd2SSNz6qDVq for ; Mon, 31 Aug 2026 21:18:53 +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 4hYhgd09BVz40y4 for ; Mon, 31 Aug 2026 21:18:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788211133; 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=bib/l4C7XhaCCryvNiXoMaPPJLy8R6yPGM2k0XBv6Mw=; b=MpN91VPAp9Rf1kXjAx/80/vbO5oHJJ4aAzpagWs+YQHFvWmBPQqoYgV2+jDyXL/oIjueF/ hEekyxyNbXMVlr7c4RGXycYuwyJ2NA62gONHmLM0BVENkjygmpJqLmd6cctzwj2xruF/Fu KWVh+BPna2dD6GFIa0cFfE+1rSboB4r9SehMO+IsyJ+SbfjLMoZCXEYDLxJVY3IA/Ho0VF 3HmouXz2Rj0QxtV+tQefyVc5/2NxpCXao7YIbIMg9Ld4RjUvud+W6+rPyc9gs7YofhK/4J 0QwTvxxbwe95KjF633bpZU2n3/GVR6Zo/aAToG4gWE+rwFclG0fMa1pUTCuIwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788211133; a=rsa-sha256; cv=none; b=XFXZBV3JY/ILlgA5Da5rDV3/lLAVaAivalulVNDN/Y4LkcdxlHxujKZmBqE+AP+96v1jnS D2ZkyswbCtZGkRryrR84MGlADQgT1rYDqvKRcc2K4V41El7WDDHGdFzq3k2kLYUyQFTu+C dG9Vb+PYxp8doeMiGUf2AukbRP4qOacIXtLcjkmOaqeIIbvAgIlAKNcMKgtKT/XXEVtg7i 8O8ANAx9Dc3WLq9iRwfXJ3hIgo7lQO43DSu3HiKPYRs/geQ4+lg+LBHlmse93uLVqfJGsz gcIT4kdE052a9U9OXNUm1lf8yLN27RLKPaJfTwAp+hXO/1qxIYZ77xju3zauSA== 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=1788211133; 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=bib/l4C7XhaCCryvNiXoMaPPJLy8R6yPGM2k0XBv6Mw=; b=JBfscYwXcGqDt5rRWssCuiG0YxK9cCAdj7pOVwSFPU9eN+l2wrzXpmh+mw3haueVcFRHgn 3SxpHqbrew+YhXbQFCBPUayGKrGFjONymsHbr2nNqwhMaeD0RTmQrR52vqeh386oD1iGrd j1CDEsej/ipfYJPIGgxPjTGMYZdE+ZiCMoHmxmS3uxYGIi518kpsxpwCa/FWYLs+nulyYV 6ZpeCtbmu8SBQmxVzfjE+iPXTy0wq43DKjvutm729CGtzoCdmt+eGzSafsxPN0Spu7yUFc HZ2+XsoMqU2rvkoLZ0GryrwIGZGerYJIe4VP5KCizOf1bh9Zi0/T2JnB/2LrFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hYhgc5GSmzCcj for ; Mon, 31 Aug 2026 21:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f843 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 31 Aug 2026 21:18:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: ebb93ce6d86e - main - iflib: don't update the admin status in if_media_status() 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: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ebb93ce6d86e6c6abd9d9fada21a3b107099db8f Auto-Submitted: auto-generated Date: Mon, 31 Aug 2026 21:18:47 +0000 Message-Id: <6a95efb7.1f843.27adc55@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=ebb93ce6d86e6c6abd9d9fada21a3b107099db8f commit ebb93ce6d86e6c6abd9d9fada21a3b107099db8f Author: Andrew Gallatin AuthorDate: 2026-08-31 21:13:47 +0000 Commit: Andrew Gallatin CommitDate: 2026-08-31 21:17:44 +0000 iflib: don't update the admin status in if_media_status() When _task_fn_admin() is active, it will regularly call IFDI_UPDATE_ADMIN_STATUS(). So there is no need to do it in iflib_media_status. This can be fairly expensive on some drivers (long DELAY busywait loops waiting for a NIC command), and there is no need to pause a userspace app in this DELAY() if it is happening asynchronously anyway. Note the logic to detect if _task_fn_admin() is regularly calling IFDI_UPDATE_ADMIN_STATUS() was copied from that function. Reviewed by: erj, kbowling Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54096 --- sys/net/iflib.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index c8662b6b7e69..37f1218bbb17 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2671,9 +2671,23 @@ static void iflib_media_status(if_t ifp, struct ifmediareq *ifmr) { if_ctx_t ctx = if_getsoftc(ifp); + bool oactive, running; + + STATE_LOCK(ctx); + running = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING); + oactive = (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE); + STATE_UNLOCK(ctx); CTX_LOCK(ctx); - IFDI_UPDATE_ADMIN_STATUS(ctx); + /* + * There is no need to update the admin status when it is done regularly by + * _task_fn_admin(), so only do it if that's not running. That can be quite + * expensive on some drivers. + */ + if ((!running && !oactive) && + !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN)) { + IFDI_UPDATE_ADMIN_STATUS(ctx); + } IFDI_MEDIA_STATUS(ctx, ifmr); CTX_UNLOCK(ctx); }