From nobody Fri Sep 11 20:15:49 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 4hhQlp095mz6rCxM for ; Fri, 11 Sep 2026 20:15:50 +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 4hhQln6l14z4JQt for ; Fri, 11 Sep 2026 20:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789157750; 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=TxOA09LLhtGPS9+kQRYZ008QuVtH1RPPWuRhS3iLBls=; b=aRKXRUeaI4yzGw1/R7e5XyrIMmg8ly9lYvn8/Yl91+aKAVt7RFQmLNh8179qAzmTBzsK/A JJoEsQ3iselLpgSTJLHs/EBg3ppy6X2EGxZiKyoSFoP+fCdKIRz3s9zSOC7X6ddRtJoK4+ P3EawNiS3CP/VnCDY21D7sGLRzL7pgi0ggKEWId5PibtluQjKVRL+tNhDfBSRjn6boXBpi I+cWsyL6cxJfhQeGvxk/GAJieI8NaGoYbWwhh6ZM8OtNcjea/vi7MfgnkG5fDqbwBwC+uo 6bSelckhqvGaFhwHsscv98+tkUpoOiWzsthhUMjj0LNZKttMkO7vc0Okf7Ip9Q== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789157749; b=sho1Zq75rzolTGl7zRBbZaPMq108YRwKWwlmP3BJDphWxYsuoBjlCnbyS7sQBTbkrDWTIW prgjNpq5+MTINemBIeJ1zPFj2dc7Js8+/H3VzTgzNleWHIrSEbxUHXMjLozzCTyLtnPkU6 enpWNKqrgFtoBt4wYK5qtMuKK5E3LkngdX17NtPFofbRVM4w+kYitIws2KKgPGDGeQFSBu 5NSEUQeFObm1JQE0JQT2cBySoNEnrHTGQVaUyaj4grrs9PYj9XMSsd2PSLG39wQ8XWTBdm oV9vjC8WPsGDRahzBltgVewC6Pc2Hxg6YfC+o83W2gK7ebe6LDdkNa//gApn/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789157749; 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=TxOA09LLhtGPS9+kQRYZ008QuVtH1RPPWuRhS3iLBls=; b=fDzb9V4moSJnDhWKsgGV/b9R9M+7FnX1YLz8Z3iCtb4RTBm5KQPwWblPBhRwyY0BUp6Qw4 e9qid+1RqaegiHFMNX+Gyboj7s/zj+Mo/J52rWhBAMuB+6h2tgM2JeIv6UwSDUEnat7Ptb gLY+c0cG66MNrpe2kxLRttKVvKG2OVPf9u+yWWh2ErfU2dBsWm5hI7qCxvLrDM9nTHKNpJ cSUXIim6NbipVj+DCMJXiK2t7q8MqVUxSceBESHJnTT5AEKOTVBc1+7qPwP/BzdcGfZH/u nhbGJro8bCcNhtGlkuQi6fOg7h0Mw4Sl645CMZclal7vsCg4hXwsWssNEiCGCQ== 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 4hhQln5pXQzSVQ for ; Fri, 11 Sep 2026 20:15:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25efc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 11 Sep 2026 20:15:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 62dd064b03df - main - iflib: Reject media changes during suspend 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: 62dd064b03dfe04b727e7d1fdea17eb165b52e9c Auto-Submitted: auto-generated Date: Fri, 11 Sep 2026 20:15:49 +0000 Message-Id: <6aa46175.25efc.278be5ba@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=62dd064b03dfe04b727e7d1fdea17eb165b52e9c commit 62dd064b03dfe04b727e7d1fdea17eb165b52e9c Author: Kevin Bowling AuthorDate: 2026-08-30 08:20:27 +0000 Commit: Kevin Bowling CommitDate: 2026-09-11 20:14:14 +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) MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59330 --- 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 0015cbb34a27..d3d25bc13f85 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -2728,6 +2728,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)