From nobody Thu Oct 29 04:58:46 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 4jFX7V1dr4z6xmG1 for ; Thu, 29 Oct 2026 04:58:46 +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 4jFX7V0psBz4c8k for ; Thu, 29 Oct 2026 04:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793249926; 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=mdladBEX9y5WBuc1jA+BqCf5j++VyjFpI3MUeN1yF9s=; b=VnOf1A7nmeUbbR+1R4XSU4rXRZJtDovkITixGSMdJxUyUKpyxO6ECwapefoSgE34pJd8Bp yiZMmDr5eL169QRydhX/ES/trW292hgQMRL8KD0QOtUWFmTnruJdrgmEYop8WTMUmBkRZ3 e2j5SUNKmTXKrdgI7/ZVXd2vaooq2vb7xVdHB+zyCVy5J27FC4zQD5XViGOUcyXqyBRLET j0q8bvbFbsQnw9rs4PY4HgJ0eImlkh3JmkVkatvhtvvxGQ7ijjZi6j0c+7y2L05AulWnlL XXx4EarVSCQSKLg2xeYqa5XPfBE7FBrwShFrSKX9Pvfz1d4MqXldw6eYzDAWew== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793249926; b=sT/NymtvVPn1gh6vBd0EkUmOPTXXuDC/37NBTvN64aiGI720HdELwj2Abt70aRddMZEe6P l9oHNNX36RK8eVS0QOS0XfDYHM+TpE+CKWbjpWa3M4t3IdQn4F290tthAcyNGH3qc6IstF 98g6uzStpUSjn9spKNB9JY47/EwKh2amGnGykeNdZBVnZZohLdXTjARxewJE9npm2qYz/H lt0asUPhKKC/zGLjxtgi913fgQP7vOVBxz0GLVTkdZFkoVDtOWzPNxyf3/q7i4O5YN/GNQ +mIJuzuvnsOnATB4+0YZeQp5TymT+/Q+TtQ0wAcfiBl2YE24JoxacTC4meVZTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793249926; 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=mdladBEX9y5WBuc1jA+BqCf5j++VyjFpI3MUeN1yF9s=; b=Gp1z5h7Cd2nV0ZiNolZ6VGgOr2F8mp+iIcvvIuA5A5mLlETSmER+mfJTscjMK6cIBmH6WW X32lkC9KhtJkfsi7J6SOgffVt1jMN/lBftJMDGiAvMiNo4gl1pp1c8hdrh2MHWhSI7HPHR k9I483ro3jN3u/tRXrG0/WdNHjNbLDPWFkMIW22nj2yNMffmjKXlPty2R0BIWU8nxMjTMi nPP8QCt6UQ+rexub6U3Ip+evAQ9mxlRcx+S0Jx8RwyEEp4PM7vFAh9woE+6ekuNXkOoirL HI+21WL7ytRml6hTV5gbzcjSvESI2qtjeorHM/XWCSCfRE9PcseE66J8bcdZtQ== 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 4jFX7V0SqKzPFb for ; Thu, 29 Oct 2026 04:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 331c6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 04:58:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: c489bd72cdbb - stable/15 - iflib: Reject media changes during suspend 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: c489bd72cdbba7c5f719cadffe3aeb301e0da830 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 04:58:46 +0000 Message-Id: <6ae2d286.331c6.204cbf82@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=c489bd72cdbba7c5f719cadffe3aeb301e0da830 commit c489bd72cdbba7c5f719cadffe3aeb301e0da830 Author: Kevin Bowling AuthorDate: 2026-08-30 08:20:27 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 04:58:36 +0000 iflib: Reject media changes during suspend iflib gates its built-in administrative and media-status callbacks once a power transition starts, but iflib_media_change() could still invoke a driver while the device was suspending or suspended. Several drivers perform PHY or firmware I/O directly from this callback. Return EBUSY before invoking IFDI_MEDIA_CHANGE() unless the device is active. ifmedia then restores the prior selection, avoiding both suspended hardware access and an unvalidated configuration that would need to be replayed during resume. Validated with device suspend on 82579LM, I210, and I225-IT controllers. Media-selection requests returned EBUSY on every suspended device. Resume restored the linked management interfaces at 1 Gbps with working traffic and no watchdogs; unconfigured interfaces retained their prior admin and link state. Reviewed by: iflib (gallatin) Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59330 (cherry picked from commit 62dd064b03dfe04b727e7d1fdea17eb165b52e9c) --- share/man/man9/iflibdd.9 | 3 +++ sys/net/iflib.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/share/man/man9/iflibdd.9 b/share/man/man9/iflibdd.9 index 3706271352ae..54551c9c7053 100644 --- a/share/man/man9/iflibdd.9 +++ b/share/man/man9/iflibdd.9 @@ -311,6 +311,9 @@ Sets the mtu interface to the value of the second function parameter mtu. Function is called when the user changes speed/duplex using the media/mediaopt option with .Xr ifconfig 8 . +It is not called while the device is suspending or suspended; iflib rejects +such a media change with +.Er EBUSY . .It Fn ifdi_promisc_set Enables or disables promisc settings depending upon the flags value. .Va flags diff --git a/sys/net/iflib.c b/sys/net/iflib.c index b2a6a68b69f1..2fff221023d2 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2605,6 +2605,10 @@ iflib_media_change(if_t ifp) int err; CTX_LOCK(ctx); + if (ctx->ifc_pm_state != IFLIB_PM_ACTIVE) { + CTX_UNLOCK(ctx); + return (EBUSY); + } restart = (if_getflags(ifp) & IFF_UP) != 0 || ctx->ifc_datapath_state == IFLIB_DP_RUNNING; if ((err = IFDI_MEDIA_CHANGE(ctx)) == 0 && restart)