git: 990f2ad47fa1 - stable/15 - ixgbe: Apply the 82599 D3 link workaround only for D3

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Fri, 21 Aug 2026 00:33:13 UTC
The branch stable/15 has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=990f2ad47fa1af2e4e05abc86631a8ba6725165b

commit 990f2ad47fa1af2e4e05abc86631a8ba6725165b
Author:     Kevin Bowling <kbowling@FreeBSD.org>
AuthorDate: 2026-08-05 14:33:32 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-08-21 00:33:03 +0000

    ixgbe: Apply the 82599 D3 link workaround only for D3
    
    ixgbe_stop_mac_link_on_d3_82599() implements the workaround for
    82599 erratum 33.  It forces incompatible auto-negotiation settings
    before the device enters D3, and reset clears them when returning to
    D0.
    
    ixgbe_if_stop() is also used for ordinary interface reconfiguration
    and recovery.  Those paths do not enter D3 and should not program
    this power-management workaround.  They continue to stop the adapter
    and disable the transmit laser.
    
    Move the call to ixgbe_setup_low_power_mode(), after
    ixgbe_if_stop().  This preserves the required ordering for detach,
    shutdown, and suspend while avoiding the D3 settings during ordinary
    restarts.
    
    (cherry picked from commit d025b84268ec18d55c2d3088729cf4ad7673ecac)
---
 sys/dev/ixgbe/if_ix.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c
index 2b023ce67eed..7588cb369a10 100644
--- a/sys/dev/ixgbe/if_ix.c
+++ b/sys/dev/ixgbe/if_ix.c
@@ -3777,6 +3777,10 @@ ixgbe_setup_low_power_mode(if_ctx_t ctx)
 		ixgbe_if_stop(ctx);
 	}
 
+	/* Disable the 82599 link only when actually entering D3. */
+	if (hw->mac.type == ixgbe_mac_82599EB)
+		ixgbe_stop_mac_link_on_d3_82599(hw);
+
 	return error;
 } /* ixgbe_setup_low_power_mode */
 
@@ -4747,8 +4751,6 @@ ixgbe_if_stop(if_ctx_t ctx)
 	ixgbe_reset_hw(hw);
 	hw->adapter_stopped = false;
 	ixgbe_stop_adapter(hw);
-	if (hw->mac.type == ixgbe_mac_82599EB)
-		ixgbe_stop_mac_link_on_d3_82599(hw);
 	/* Turn off the laser - noop with no optics */
 	ixgbe_disable_tx_laser(hw);