diff mbox series

[net] net: phylink: avoid mvneta warning when setting pause parameters

Message ID E1mg6oY-0020Bg-Td@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit fd8d9731bcdfb22d28e45bce789bcb211c868c78
Delegated to: Netdev Maintainers
Headers show
Series [net] net: phylink: avoid mvneta warning when setting pause parameters | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers warning 1 maintainers not CCed: linux@armlinux.org.uk
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch warning WARNING: 'asymetric' may be misspelled - perhaps 'asymmetric'?
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Russell King (Oracle) Oct. 28, 2021, 2:55 p.m. UTC
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(-)

Comments

Jakub Kicinski Oct. 28, 2021, 3:06 p.m. UTC | #1
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..?
Russell King (Oracle) Oct. 28, 2021, 3:14 p.m. UTC | #2
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.
patchwork-bot+netdevbpf@kernel.org Oct. 29, 2021, 12:50 p.m. UTC | #3
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!
diff mbox series

Patch

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;