igb: fix link test skipping when interface is admin down
Subsystems (3)
PATCH 1/1 igb: fix link test skipping when interface is admin down
The igb driver incorrectly skips the link test when the network interface is admin down (if_running == false), causing the test to always report PASS regardless of the actual physical link state.
This behavior is inconsistent with other drivers (e.g. i40e, ice, ixgbe, etc.) which correctly test the physical link state regardless of admin state.
Remove the if_running check to ensure link test always reflects the physical link state.
--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +1 -4
@@ -2081,11 +2081,8 @@ static void igb_diag_test(struct net_device *netdev, }else {dev_info (&adapter->pdev->dev,"online testing starting\n" ); -/* PHY is powered down when interface is down */ -if (if_running &&igb_link_test (adapter, &data[TEST_LINK ])) +if (igb_link_test (adapter, &data[TEST_LINK ])) eth_test->flags |=ETH_TEST_FL_FAILED ; -else - data[TEST_LINK ] =0 ;/* Online tests aren't run; pass by default */ data[TEST_REG ] =0 ;
Signature · 1 line
2.48.1
Dear Kohei,
Thank you very much for your patch.
Am 15.08.25 um 08:26 schrieb Kohei Enju:
Quoted 7 lines
The igb driver incorrectly skips the link test when the network interface is admin down (
if_running== false), causing the test to always report PASS regardless of the actual physical link state.This behavior is inconsistent with other drivers (e.g. i40e, ice, ixgbe, etc.) which correctly test the physical link state regardless of admin state.
I’d collapse the above two sentences into one paragraph and add an empty line here to visually separate the paragraph below.
Quoted 2 lines
Remove the
if_runningcheck to ensure link test always reflects the physical link state.
Please add how to verify your change, that means the command to run.
Quoted 13 lines
Fixes 8d420a1b3ea6 ("igb: correct link test not being run when link is down")Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/net/ethernet/intel/igb/igb_ethtool.c +0
-0@@ -2081,11 +2081,8 @@ static void igb_diag_test(struct net_device *netdev, }else {dev_info (&adapter->pdev->dev,"online testing starting\n" );
drivers/net/ethernet/intel/igb/igb_ethtool.c static void igb_diag_test(struct net_device *netdev, · line 2088
Quoted 10 lines
drivers/net/ethernet/intel/igb/igb_ethtool.c +1
-4-/* PHY is powered down when interface is down */ -if (if_running &&igb_link_test (adapter, &data[TEST_LINK ])) +if (igb_link_test (adapter, &data[TEST_LINK ])) eth_test->flags |=ETH_TEST_FL_FAILED ; -else - data[TEST_LINK ] =0 ;/* Online tests aren't run; pass by default */ data[TEST_REG ] =0 ;
Regardless of my style comments above:
Kind regards,
Paul
[Correct Alexander’s email address]
Am 15.08.25 um 09:38 schrieb Paul Menzel:
Quoted 52 lines
Dear Kohei,
Thank you very much for your patch.
Am 15.08.25 um 08:26 schrieb Kohei Enju:
Quoted 7 lines
The igb driver incorrectly skips the link test when the network interface is admin down (
if_running== false), causing the test to always report PASS regardless of the actual physical link state.This behavior is inconsistent with other drivers (e.g. i40e, ice, ixgbe, etc.) which correctly test the physical link state regardless of admin state.
I’d collapse the above two sentences into one paragraph and add an empty line here to visually separate the paragraph below.
Quoted 2 lines
Remove the
if_runningcheck to ensure link test always reflects the physical link state.Please add how to verify your change, that means the command to run.
Quoted 12 lines
Fixes 8d420a1b3ea6 ("igb: correct link test not being run when link is down")Signed-off-by Kohei Enju <[email protected]>---
drivers/net/ethernet/intel/igb/igb_ethtool.c| 5 +----1 file changed, 1 insertion(+), 4 deletions(-)drivers/net/ethernet/intel/igb/igb_ethtool.c +0
-0@@ -2081,11 +2081,8 @@ static void igb_diag_test(struct net_device *netdev,drivers/net/ethernet/intel/igb/igb_ethtool.c static void igb_diag_test(struct net_device · line 2087
Quoted 10 lines
drivers/net/ethernet/intel/igb/igb_ethtool.c +1
-4} else { dev_info(&adapter->pdev->dev, "online testing starting\n"); - /* PHY is powered down when interface is down */ - if (if_running && igb_link_test(adapter, &data[TEST_LINK])) + if (igb_link_test(adapter, &data[TEST_LINK])) eth_test->flags |= ETH_TEST_FL_FAILED; - else - data[TEST_LINK] = 0; /* Online tests aren't run; pass by default */ data[TEST_REG] = 0;Regardless of my style comments above:
Reviewed-by Paul Menzel <[email protected]>Kind regards,
Paul
Quoted 1 line · Paul Menzel
[Correct Alexander’s email address]
Thank you for the correction.
I'll use the correct address going forward.
Quoted 18 lines
Am 15.08.25 um 09:38 schrieb Paul Menzel:
Quoted 16 lines
Dear Kohei,
Thank you very much for your patch.
Am 15.08.25 um 08:26 schrieb Kohei Enju:
Quoted 7 lines
The igb driver incorrectly skips the link test when the network interface is admin down (
if_running== false), causing the test to always report PASS regardless of the actual physical link state.This behavior is inconsistent with other drivers (e.g. i40e, ice, ixgbe, etc.) which correctly test the physical link state regardless of admin state.
I’d collapse the above two sentences into one paragraph and add an empty line here to visually separate the paragraph below.
Yes, that makes sense. I'll do that.
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Remove the
if_runningcheck to ensure link test always reflects the physical link state.Please add how to verify your change, that means the command to run.
Sure, I tested the change using the ip and ethtool commands, with the physical link down.
Should I include the following test steps in the commit message?
Before:
$ sudo ip link set dev enp7s0f0 down
$ ip --json link show enp7s0f0 | jq -c ".[].flags" ["BROADCAST","MULTICAST"]
$ sudo ethtool --test enp7s0f0 online The test result is PASS The test extra info: Register test (offline) 0 Eeprom test (offline) 0 Interrupt test (offline) 0 Loopback test (offline) 0 Link test (on/offline) 0 # <- Not expected
After:
$ sudo ip link set dev enp7s0f0 down
$ ip --json link show enp7s0f0 | jq -c ".[].flags" ["BROADCAST","MULTICAST"]
$ sudo ethtool --test enp7s0f0 online The test result is FAIL The test extra info: Register test (offline) 0 Eeprom test (offline) 0 Interrupt test (offline) 0 Loopback test (offline) 0 Link test (on/offline) 1 # <- Expected
Quoted 27 lines
Quoted 27 lines
Quoted 14 lines
Fixes 8d420a1b3ea6 ("igb: correct link test not being run when link is down")Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/ renamed from drivers/net/ethernet/intel/igb/igb_ethtool.c +0
-0
net/ethernet/intel/igb/igb_ethtool.c
indexca6ccbc13954..6412c84e2d17100644drivers/net/ethernet/intel/igb/igb_ethtool.c +0
-0@@ -2081,11 +2081,8 @@ static void igb_diag_test(struct net_device *netdev,drivers/net/ethernet/intel/igb/igb_ethtool.c static void igb_diag_test(struct net_device · line 2087
Quoted 10 lines
drivers/net/ethernet/intel/igb/igb_ethtool.c +1
-4}else {dev_info (&adapter->pdev->dev,"online testing starting\n" ); -/* PHY is powered down when interface is down */ -if (if_running &&igb_link_test (adapter, &data[TEST_LINK ])) +if (igb_link_test (adapter, &data[TEST_LINK ])) eth_test->flags |=ETH_TEST_FL_FAILED ; -else - data[TEST_LINK ] =0 ;/* Online tests aren't run; pass by default */ data[TEST_REG ] =0 ;Regardless of my style comments above:
Quoted 6 lines
Quoted 6 lines
Reviewed-by Paul Menzel <[email protected]>Kind regards,
Paul
Thank you for the review, Paul.
Quoted 10 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: 15 August 2025 11:57
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Alexander Duyck <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH v1 iwl-net] igb: fix link test skipping when interface is admin downThe igb driver incorrectly skips the link test when the network interface is admin down (
if_running== false), causing the test to always report PASS regardless of the actual physical link state.This behavior is inconsistent with other drivers (e.g. i40e, ice, ixgbe,
etc.) which correctly test the physical link state regardless of admin state.
Quoted 8 lines
Remove the
if_runningcheck to ensure link test always reflects the physical link state.Fixes 8d420a1b3ea6 ("igb: correct link test not being run when link is down")Signed-off-by Kohei Enju <[email protected]>---
drivers/net/ethernet/intel/igb/igb_ethtool.c| 5 +----1 file changed, 1 insertion(+), 4 deletions(-)