netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] amd-xgbe: Avoid spurious link down messages during interface toggle
@ 2025-10-10  6:51 Raju Rangoju
  2025-10-10 12:51 ` Dawid Osuchowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Raju Rangoju @ 2025-10-10  6:51 UTC (permalink / raw)
  To: netdev
  Cc: pabeni, kuba, edumazet, davem, andrew+netdev, thomas.lendacky,
	Shyam-sundar.S-k, Raju Rangoju

During interface toggle operations (ifdown/ifup), the driver currently
resets the local helper variable 'phy_link' to -1. This causes the link
state machine to incorrectly interpret the state as a link change event,
resulting in spurious "Link is down" messages being logged when the
interface is brought back up.

Preserve the phy_link state across interface toggles to avoid treating
the -1 sentinel value as a legitimate link state transition.

Fixes: 88131a812b16 ("amd-xgbe: Perform phy connect/disconnect at dev open/stop")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c  | 1 -
 drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index f0989aa01855..4dc631af7933 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -1080,7 +1080,6 @@ static void xgbe_free_rx_data(struct xgbe_prv_data *pdata)
 
 static int xgbe_phy_reset(struct xgbe_prv_data *pdata)
 {
-	pdata->phy_link = -1;
 	pdata->phy_speed = SPEED_UNKNOWN;
 
 	return pdata->phy_if.phy_reset(pdata);
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
index 1a37ec45e650..7675bb98f029 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
@@ -1555,6 +1555,7 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata)
 		pdata->phy.duplex = DUPLEX_FULL;
 	}
 
+	pdata->phy_link = 0;
 	pdata->phy.link = 0;
 
 	pdata->phy.pause_autoneg = pdata->pause_autoneg;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net] amd-xgbe: Avoid spurious link down messages during interface toggle
  2025-10-10  6:51 [PATCH net] amd-xgbe: Avoid spurious link down messages during interface toggle Raju Rangoju
@ 2025-10-10 12:51 ` Dawid Osuchowski
  2025-10-10 13:30 ` Tom Lendacky
  2025-10-14  9:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: Dawid Osuchowski @ 2025-10-10 12:51 UTC (permalink / raw)
  To: Raju Rangoju, netdev
  Cc: pabeni, kuba, edumazet, davem, andrew+netdev, thomas.lendacky,
	Shyam-sundar.S-k

On 2025-10-10 8:51 AM, Raju Rangoju wrote:
> During interface toggle operations (ifdown/ifup), the driver currently
> resets the local helper variable 'phy_link' to -1. This causes the link
> state machine to incorrectly interpret the state as a link change event,
> resulting in spurious "Link is down" messages being logged when the
> interface is brought back up.
> 
> Preserve the phy_link state across interface toggles to avoid treating
> the -1 sentinel value as a legitimate link state transition.
> 
> Fixes: 88131a812b16 ("amd-xgbe: Perform phy connect/disconnect at dev open/stop")
> Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>

Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
> ---
>   drivers/net/ethernet/amd/xgbe/xgbe-drv.c  | 1 -
>   drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 +
>   2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> index f0989aa01855..4dc631af7933 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> @@ -1080,7 +1080,6 @@ static void xgbe_free_rx_data(struct xgbe_prv_data *pdata)
>   
>   static int xgbe_phy_reset(struct xgbe_prv_data *pdata)
>   {
> -	pdata->phy_link = -1;
>   	pdata->phy_speed = SPEED_UNKNOWN;
>   
>   	return pdata->phy_if.phy_reset(pdata);
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> index 1a37ec45e650..7675bb98f029 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> @@ -1555,6 +1555,7 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata)
>   		pdata->phy.duplex = DUPLEX_FULL;
>   	}
>   
> +	pdata->phy_link = 0;
>   	pdata->phy.link = 0;

Took me a sec to spot the difference between the two :)

>   
>   	pdata->phy.pause_autoneg = pdata->pause_autoneg;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] amd-xgbe: Avoid spurious link down messages during interface toggle
  2025-10-10  6:51 [PATCH net] amd-xgbe: Avoid spurious link down messages during interface toggle Raju Rangoju
  2025-10-10 12:51 ` Dawid Osuchowski
@ 2025-10-10 13:30 ` Tom Lendacky
  2025-10-10 18:08   ` Rangoju, Raju
  2025-10-14  9:00 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 5+ messages in thread
From: Tom Lendacky @ 2025-10-10 13:30 UTC (permalink / raw)
  To: Raju Rangoju, netdev
  Cc: pabeni, kuba, edumazet, davem, andrew+netdev, Shyam-sundar.S-k

On 10/10/25 01:51, Raju Rangoju wrote:
> During interface toggle operations (ifdown/ifup), the driver currently
> resets the local helper variable 'phy_link' to -1. This causes the link
> state machine to incorrectly interpret the state as a link change event,
> resulting in spurious "Link is down" messages being logged when the
> interface is brought back up.
> 
> Preserve the phy_link state across interface toggles to avoid treating
> the -1 sentinel value as a legitimate link state transition.
> 
> Fixes: 88131a812b16 ("amd-xgbe: Perform phy connect/disconnect at dev open/stop")

Did this always happen, that is, did this behavior exist before the recent
changes to detect short drops in the phy link status? If it didn't exist
prior to those changes, then the Fixes: needs to be against that recent
change, possibly limiting the amount of backporting required into stable
kernels.

Thanks,
Tom

> Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
> ---
>  drivers/net/ethernet/amd/xgbe/xgbe-drv.c  | 1 -
>  drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> index f0989aa01855..4dc631af7933 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> @@ -1080,7 +1080,6 @@ static void xgbe_free_rx_data(struct xgbe_prv_data *pdata)
>  
>  static int xgbe_phy_reset(struct xgbe_prv_data *pdata)
>  {
> -	pdata->phy_link = -1;
>  	pdata->phy_speed = SPEED_UNKNOWN;
>  
>  	return pdata->phy_if.phy_reset(pdata);
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> index 1a37ec45e650..7675bb98f029 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> @@ -1555,6 +1555,7 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata)
>  		pdata->phy.duplex = DUPLEX_FULL;
>  	}
>  
> +	pdata->phy_link = 0;
>  	pdata->phy.link = 0;
>  
>  	pdata->phy.pause_autoneg = pdata->pause_autoneg;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] amd-xgbe: Avoid spurious link down messages during interface toggle
  2025-10-10 13:30 ` Tom Lendacky
@ 2025-10-10 18:08   ` Rangoju, Raju
  0 siblings, 0 replies; 5+ messages in thread
From: Rangoju, Raju @ 2025-10-10 18:08 UTC (permalink / raw)
  To: Tom Lendacky, netdev
  Cc: pabeni, kuba, edumazet, davem, andrew+netdev, Shyam-sundar.S-k



On 10/10/2025 7:00 PM, Tom Lendacky wrote:
> On 10/10/25 01:51, Raju Rangoju wrote:
>> During interface toggle operations (ifdown/ifup), the driver currently
>> resets the local helper variable 'phy_link' to -1. This causes the link
>> state machine to incorrectly interpret the state as a link change event,
>> resulting in spurious "Link is down" messages being logged when the
>> interface is brought back up.
>>
>> Preserve the phy_link state across interface toggles to avoid treating
>> the -1 sentinel value as a legitimate link state transition.
>>
>> Fixes: 88131a812b16 ("amd-xgbe: Perform phy connect/disconnect at dev open/stop")
> 
> Did this always happen, that is, did this behavior exist before the recent
> changes to detect short drops in the phy link status? 

Yes, this behavior exist before the recent changes to detect short drops.

> If it didn't exist
> prior to those changes, then the Fixes: needs to be against that recent
> change, possibly limiting the amount of backporting required into stable
> kernels.
> 
> Thanks,
> Tom
> 
>> Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
>> ---
>>   drivers/net/ethernet/amd/xgbe/xgbe-drv.c  | 1 -
>>   drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 +
>>   2 files changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
>> index f0989aa01855..4dc631af7933 100644
>> --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
>> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
>> @@ -1080,7 +1080,6 @@ static void xgbe_free_rx_data(struct xgbe_prv_data *pdata)
>>   
>>   static int xgbe_phy_reset(struct xgbe_prv_data *pdata)
>>   {
>> -	pdata->phy_link = -1;
>>   	pdata->phy_speed = SPEED_UNKNOWN;
>>   
>>   	return pdata->phy_if.phy_reset(pdata);
>> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
>> index 1a37ec45e650..7675bb98f029 100644
>> --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
>> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
>> @@ -1555,6 +1555,7 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata)
>>   		pdata->phy.duplex = DUPLEX_FULL;
>>   	}
>>   
>> +	pdata->phy_link = 0;
>>   	pdata->phy.link = 0;
>>   
>>   	pdata->phy.pause_autoneg = pdata->pause_autoneg;
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] amd-xgbe: Avoid spurious link down messages during interface toggle
  2025-10-10  6:51 [PATCH net] amd-xgbe: Avoid spurious link down messages during interface toggle Raju Rangoju
  2025-10-10 12:51 ` Dawid Osuchowski
  2025-10-10 13:30 ` Tom Lendacky
@ 2025-10-14  9:00 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-14  9:00 UTC (permalink / raw)
  To: Rangoju, Raju
  Cc: netdev, pabeni, kuba, edumazet, davem, andrew+netdev,
	thomas.lendacky, Shyam-sundar.S-k

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Fri, 10 Oct 2025 12:21:42 +0530 you wrote:
> During interface toggle operations (ifdown/ifup), the driver currently
> resets the local helper variable 'phy_link' to -1. This causes the link
> state machine to incorrectly interpret the state as a link change event,
> resulting in spurious "Link is down" messages being logged when the
> interface is brought back up.
> 
> Preserve the phy_link state across interface toggles to avoid treating
> the -1 sentinel value as a legitimate link state transition.
> 
> [...]

Here is the summary with links:
  - [net] amd-xgbe: Avoid spurious link down messages during interface toggle
    https://git.kernel.org/netdev/net/c/2616222e4233

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-14  9:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-10  6:51 [PATCH net] amd-xgbe: Avoid spurious link down messages during interface toggle Raju Rangoju
2025-10-10 12:51 ` Dawid Osuchowski
2025-10-10 13:30 ` Tom Lendacky
2025-10-10 18:08   ` Rangoju, Raju
2025-10-14  9:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).