All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: phylink: avoid mvneta warning when setting pause parameters
@ 2021-10-28 14:55 Russell King (Oracle)
  2021-10-28 15:06 ` Jakub Kicinski
  2021-10-29 12:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2021-10-28 14:55 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit; +Cc: David S. Miller, netdev, Jakub Kicinski

mvneta does not support asymetric pause modes, and it flags this by the
lack of AsymPause in the supported field. When setting pause modes, we
check that pause->rx_pause == pause->tx_pause, but only when pause
autoneg is enabled. When pause autoneg is disabled, we still allow
pause->rx_pause != pause->tx_pause, which is incorrect when the MAC
does not support asymetric pause, and causes mvneta to issue a warning.

Fix this by removing the test for pause->autoneg, so we always check
that pause->rx_pause == pause->tx_pause for network devices that do not
support AsymPause.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/phylink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 0a0abe8e4be0..5defc721dd05 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1724,7 +1724,7 @@ int phylink_ethtool_set_pauseparam(struct phylink *pl,
 		return -EOPNOTSUPP;
 
 	if (!phylink_test(pl->supported, Asym_Pause) &&
-	    !pause->autoneg && pause->rx_pause != pause->tx_pause)
+	    pause->rx_pause != pause->tx_pause)
 		return -EINVAL;
 
 	pause_state = 0;
-- 
2.30.2


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

* Re: [PATCH net] net: phylink: avoid mvneta warning when setting pause parameters
  2021-10-28 14:55 [PATCH net] net: phylink: avoid mvneta warning when setting pause parameters Russell King (Oracle)
@ 2021-10-28 15:06 ` Jakub Kicinski
  2021-10-28 15:14   ` Russell King (Oracle)
  2021-10-29 12:50 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2021-10-28 15:06 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, netdev

On Thu, 28 Oct 2021 15:55:34 +0100 Russell King (Oracle) wrote:
> mvneta does not support asymetric pause modes, and it flags this by the
> lack of AsymPause in the supported field. When setting pause modes, we
> check that pause->rx_pause == pause->tx_pause, but only when pause
> autoneg is enabled. When pause autoneg is disabled, we still allow
> pause->rx_pause != pause->tx_pause, which is incorrect when the MAC
> does not support asymetric pause, and causes mvneta to issue a warning.
> 
> Fix this by removing the test for pause->autoneg, so we always check
> that pause->rx_pause == pause->tx_pause for network devices that do not
> support AsymPause.

Fixes..?

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

* Re: [PATCH net] net: phylink: avoid mvneta warning when setting pause parameters
  2021-10-28 15:06 ` Jakub Kicinski
@ 2021-10-28 15:14   ` Russell King (Oracle)
  0 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2021-10-28 15:14 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, netdev

On Thu, Oct 28, 2021 at 08:06:07AM -0700, Jakub Kicinski wrote:
> On Thu, 28 Oct 2021 15:55:34 +0100 Russell King (Oracle) wrote:
> > mvneta does not support asymetric pause modes, and it flags this by the
> > lack of AsymPause in the supported field. When setting pause modes, we
> > check that pause->rx_pause == pause->tx_pause, but only when pause
> > autoneg is enabled. When pause autoneg is disabled, we still allow
> > pause->rx_pause != pause->tx_pause, which is incorrect when the MAC
> > does not support asymetric pause, and causes mvneta to issue a warning.
> > 
> > Fix this by removing the test for pause->autoneg, so we always check
> > that pause->rx_pause == pause->tx_pause for network devices that do not
> > support AsymPause.
> 
> Fixes..?

If people care...

Fixes: 9525ae83959b ("phylink: add phylink infrastructure")

but since no one reported the issue, I'd be tempted not to backport
the patch until there's a need to do so. Especially as it's going
to have conflicts.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

* Re: [PATCH net] net: phylink: avoid mvneta warning when setting pause parameters
  2021-10-28 14:55 [PATCH net] net: phylink: avoid mvneta warning when setting pause parameters Russell King (Oracle)
  2021-10-28 15:06 ` Jakub Kicinski
@ 2021-10-29 12:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-29 12:50 UTC (permalink / raw)
  To: Russell King; +Cc: andrew, hkallweit1, davem, netdev, kuba

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 28 Oct 2021 15:55:34 +0100 you wrote:
> mvneta does not support asymetric pause modes, and it flags this by the
> lack of AsymPause in the supported field. When setting pause modes, we
> check that pause->rx_pause == pause->tx_pause, but only when pause
> autoneg is enabled. When pause autoneg is disabled, we still allow
> pause->rx_pause != pause->tx_pause, which is incorrect when the MAC
> does not support asymetric pause, and causes mvneta to issue a warning.
> 
> [...]

Here is the summary with links:
  - [net] net: phylink: avoid mvneta warning when setting pause parameters
    https://git.kernel.org/netdev/net/c/fd8d9731bcdf

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] 4+ messages in thread

end of thread, other threads:[~2021-10-29 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 14:55 [PATCH net] net: phylink: avoid mvneta warning when setting pause parameters Russell King (Oracle)
2021-10-28 15:06 ` Jakub Kicinski
2021-10-28 15:14   ` Russell King (Oracle)
2021-10-29 12:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.