]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
igc: disable L1.2 PCI-E link substate to avoid performance issue
authorVitaly Lifshits <vitaly.lifshits@intel.com>
Wed, 11 Jun 2025 12:52:54 +0000 (15:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 14:03:11 +0000 (16:03 +0200)
[ Upstream commit 0325143b59c6c6d79987afc57d2456e7a20d13b7 ]

I226 devices advertise support for the PCI-E link L1.2 substate. However,
due to a hardware limitation, the exit latency from this low-power state
is longer than the packet buffer can tolerate under high traffic
conditions. This can lead to packet loss and degraded performance.

To mitigate this, disable the L1.2 substate. The increased power draw
between L1.1 and L1.2 is insignificant.

Fixes: 43546211738e ("igc: Add new device ID's")
Link: https://lore.kernel.org/intel-wired-lan/15248b4f-3271-42dd-8e35-02bfc92b25e1@intel.com
Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/igc/igc_main.c

index e2f5c4384455e0950b872b40b64391e325d95955..11543db4c47f0ed365acde9d64fb2faa4f974e72 100644 (file)
@@ -6772,6 +6772,10 @@ static int igc_probe(struct pci_dev *pdev,
        adapter->port_num = hw->bus.func;
        adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
 
+       /* Disable ASPM L1.2 on I226 devices to avoid packet loss */
+       if (igc_is_device_id_i226(hw))
+               pci_disable_link_state(pdev, PCIE_LINK_STATE_L1_2);
+
        err = pci_save_state(pdev);
        if (err)
                goto err_ioremap;
@@ -7144,6 +7148,9 @@ static int __maybe_unused igc_resume(struct device *dev)
        pci_enable_wake(pdev, PCI_D3hot, 0);
        pci_enable_wake(pdev, PCI_D3cold, 0);
 
+       if (igc_is_device_id_i226(hw))
+               pci_disable_link_state(pdev, PCIE_LINK_STATE_L1_2);
+
        if (igc_init_interrupt_scheme(adapter, true)) {
                netdev_err(netdev, "Unable to allocate memory for queues\n");
                return -ENOMEM;
@@ -7259,6 +7266,9 @@ static pci_ers_result_t igc_io_slot_reset(struct pci_dev *pdev)
                pci_enable_wake(pdev, PCI_D3hot, 0);
                pci_enable_wake(pdev, PCI_D3cold, 0);
 
+               if (igc_is_device_id_i226(hw))
+                       pci_disable_link_state_locked(pdev, PCIE_LINK_STATE_L1_2);
+
                /* In case of PCI error, adapter loses its HW address
                 * so we should re-assign it here.
                 */