From nobody Thu Oct 29 04:58:20 2026 X-Original-To: dev-commits-src-branches@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 4jFX704cCVz6xmMt for ; Thu, 29 Oct 2026 04:58:20 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jFX703tMgz4bj6 for ; Thu, 29 Oct 2026 04:58:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793249900; 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=yMwDMuCnQdBb8zFhYIWke90ix2YiqSS68n6RTm7/3Ac=; b=hPugwKoGKBwptxaIY2go1hJKNfEoHEN6sTf/97FHRw+sR2lhDc0PEKgeD/xoKJmy3u2gyI spsrAUnlraRHTEkKDg2SqOkVJyXSWjrb/ok1EilleygoBneftgc7xAzJXrHcSv0yvJL0Cj xWYxYQ1p8X2L3Bz/nUnPM8Rj8Xtzpj/bDzsolad43r61DFo8DHuReRRLuRHvGKWuYYLF55 p1t34dFl0Z0Eun0HodwYwj6QZ7IceB61yVRFhArbGJYOvty6Z1zmam/RGs2m3RNHRNAfx8 ZgLzzUm+SYfsuajwHZHcUtx0KA6HCZ+gC0z0oQlrObNa2q/c1pN9CxaIbCOwHA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793249900; b=j6IvNW2ln36G/46lXqhZAjLxmEVQALOKDSpshlHUI+ILwKBmh2VCXJwtP8wNrEViXj/HnN Pa3/BFV5dgiVHa4mVgBu6RnFDKOazig1TmrB6mPF4HR8vXrlJE/XoxQteVs0YuD+3Qw3C1 HWfLGlCuq+3CmgHTeio5tEiqWGhmUus7Z/OqVGcWI+K4yyeMoFBjQ4PTfiDlVN8ULx8iPU 2q4wcCi3nsssyo4ziON9SglBiCRZyAAUIyPdtumrqjALiCHSm1iOJN+UR6qEfnLmxmmz1G vk51hMUWaGy0WnYV8rhD7QvDvYZxVu+XqEPTuszB3rPijkedW1Zp7j5EHgf42w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793249900; 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=yMwDMuCnQdBb8zFhYIWke90ix2YiqSS68n6RTm7/3Ac=; b=IEnvbflZm79Wrzrp8EwC5wk2RRRZAJ2UuGSjycSUWAWYRjzq3mC2OjER4sIbj2bkb7Y2yZ lYFFr53HG1T1W6tLC4Ktdk2rAIxPalMBIUZYysbcXz6rw3NDXqXrIedPpuBcZVGXU0X1e+ PCD4k8MD2AFa9Ld/lXLWYG22AV9lNO701wwqR5IM36QVn8YbK/JAB2u6j/YJ05USchDWHx oR//7FKspyaMwbcExIGsQCvdCPsAYZs73yFydfnm4jBiZOGJsuR1uzQmcXGcJZgV1tEv17 sgl1EpunaOPwrIHc5l4cGp93XGgb+ZVL34Gtzcp70SWcPxsBucITwJ1fRO1hFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jFX702ycMzPFZ for ; Thu, 29 Oct 2026 04:58:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 327d9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 04:58:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Andrew Gallatin From: Kevin Bowling Subject: git: 812a6ee0d3cb - stable/15 - iflib: don't update the admin status in if_media_status() List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository 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: 812a6ee0d3cb5b15af60c029a35751e405980341 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 04:58:20 +0000 Message-Id: <6ae2d26c.327d9.5d625158@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=812a6ee0d3cb5b15af60c029a35751e405980341 commit 812a6ee0d3cb5b15af60c029a35751e405980341 Author: Andrew Gallatin AuthorDate: 2026-08-31 21:13:47 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 04:57:24 +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 (cherry picked from commit ebb93ce6d86e6c6abd9d9fada21a3b107099db8f) --- 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 8f1e8c30e374..c62bf10370f2 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2602,9 +2602,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); }