From nobody Mon Aug 31 21:18:47 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 4hYhgX08Jcz6qDQF for ; Mon, 31 Aug 2026 21:18:48 +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 4hYhgW6jRWz40rp for ; Mon, 31 Aug 2026 21:18:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788211127; 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=RMQkBdiGH2g6/SkA3le0EfDbmoJViqjiPHk1080NokP6WwB7bt2Bzm1HDFqQk128iNblOJ xRhSs9T4DeNmdfdb0UXpYpLedwdxs0jOZntlRgA0Yv7Xkglm/FFKCBUcvLtWji/SsBeIck LlzD96b0SZbWBq6BUxnBLpRolvldu+OjUGn+ghH2jtzsN4Smx/X/YMLamowy2plnj0o1Qr s2TkTJj8Xs9KvfzipZkKYkU4O8TQR2nPHgItPWSaDEpmHoBi79HcmF29G58YdCa2oJV9zJ +YcpqVZZn6vyZtiQ4M1a5AnAioBhGvCG04XxPygVBkUVUy1Nr5hnxGJQp2KBSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788211127; a=rsa-sha256; cv=none; b=gZ0Z0HnRnEFy/UVSK9jWMovduu7mL9lf6TCH7CL6LRfDqoDPtMFcbFbCxF3n4t8EM3gLvV zZepplfJ0A47ujwPAFNBHusaXnRAq8xNNHdnjyFQ6QpvvS0Fa5+VkL8WfqrpEQtDib1tFN szhzXi7lLRM/EUuwvAJKwxk+hyGubhOkK+CqQrPgllhqW8Gt0gVXe17FxcL0fKcN/HX1lS 6ypzazLsuec3CjfYMMJSc1ItpxKFDlhn9p1L/mdBeEm143h2MmG09NEn2I8EEHyKl0F0Tu C4D2OaKT2/xaK/RNJR5JZqoOMWWnQoQQT5+FdN23Ep+zQiwOlXaT0AqjxHMJ/w== 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=1788211127; 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=RvCirt43a+AVNV5cryHjtnOY6ZsCpdurJpal7ad1LgolZKrQ+OBuWCKm2Z2w/4RPJiJWHP TuHZr/GJhafXtJR/vj0DUAo4Ckx6s4jIzGkKL6n9TXjxtYNp7YqmWbopkefvtj+MwkOtK1 BgBDBxBtA/2+DL4jdGNDLoOTm+Lr5GcApK9NXTix8mWDV2xuUD1ckwI8L7JH/TEX6CgHV/ IAo2HlXOHNbHCB8uuJP3RtRl+Em0Sfeg6w/yxjnlOjLDF2bVL5RAryVvm6L/NEhIn1xzjc G/2kN5eG62XEYwgwMiG/yDj3keS9kLyeEmqajaNaD0kqoRqf0lZVwLJauUJHuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hYhgW5DXfzD4H for ; Mon, 31 Aug 2026 21:18:47 +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 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: 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); }