All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sfc: Fix reading non-legacy supported link modes
@ 2021-10-17 17:16 Erik Ekman
  2021-10-18 13:30 ` patchwork-bot+netdevbpf
  2021-10-19 15:21 ` Andrew Lunn
  0 siblings, 2 replies; 12+ messages in thread
From: Erik Ekman @ 2021-10-17 17:16 UTC (permalink / raw)
  To: Edward Cree, Martin Habets, David S. Miller, Jakub Kicinski
  Cc: Erik Ekman, netdev, linux-kernel

Everything except the first 32 bits was lost when the pause flags were
added. This makes the 50000baseCR2 mode flag (bit 34) not appear.

I have tested this with a 10G card (SFN5122F-R7) by modifying it to
return a non-legacy link mode (10000baseCR).

Signed-off-by: Erik Ekman <erik@kryo.se>
---
 drivers/net/ethernet/sfc/ethtool_common.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c
index bf1443539a1a..bd552c7dffcb 100644
--- a/drivers/net/ethernet/sfc/ethtool_common.c
+++ b/drivers/net/ethernet/sfc/ethtool_common.c
@@ -563,20 +563,14 @@ int efx_ethtool_get_link_ksettings(struct net_device *net_dev,
 {
 	struct efx_nic *efx = netdev_priv(net_dev);
 	struct efx_link_state *link_state = &efx->link_state;
-	u32 supported;
 
 	mutex_lock(&efx->mac_lock);
 	efx_mcdi_phy_get_link_ksettings(efx, cmd);
 	mutex_unlock(&efx->mac_lock);
 
 	/* Both MACs support pause frames (bidirectional and respond-only) */
-	ethtool_convert_link_mode_to_legacy_u32(&supported,
-						cmd->link_modes.supported);
-
-	supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
-
-	ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
-						supported);
+	ethtool_link_ksettings_add_link_mode(cmd, supported, Pause);
+	ethtool_link_ksettings_add_link_mode(cmd, supported, Asym_Pause);
 
 	if (LOOPBACK_INTERNAL(efx)) {
 		cmd->base.speed = link_state->speed;
-- 
2.31.1


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

* Re: [PATCH] sfc: Fix reading non-legacy supported link modes
  2021-10-17 17:16 [PATCH] sfc: Fix reading non-legacy supported link modes Erik Ekman
@ 2021-10-18 13:30 ` patchwork-bot+netdevbpf
  2021-10-19 15:21 ` Andrew Lunn
  1 sibling, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-18 13:30 UTC (permalink / raw)
  To: Erik Ekman
  Cc: ecree.xilinx, habetsm.xilinx, davem, kuba, netdev, linux-kernel

Hello:

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

On Sun, 17 Oct 2021 19:16:57 +0200 you wrote:
> Everything except the first 32 bits was lost when the pause flags were
> added. This makes the 50000baseCR2 mode flag (bit 34) not appear.
> 
> I have tested this with a 10G card (SFN5122F-R7) by modifying it to
> return a non-legacy link mode (10000baseCR).
> 
> Signed-off-by: Erik Ekman <erik@kryo.se>
> 
> [...]

Here is the summary with links:
  - sfc: Fix reading non-legacy supported link modes
    https://git.kernel.org/netdev/net-next/c/041c61488236

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

* Re: [PATCH] sfc: Fix reading non-legacy supported link modes
  2021-10-17 17:16 [PATCH] sfc: Fix reading non-legacy supported link modes Erik Ekman
  2021-10-18 13:30 ` patchwork-bot+netdevbpf
@ 2021-10-19 15:21 ` Andrew Lunn
  2021-10-19 17:41   ` Erik Ekman
  1 sibling, 1 reply; 12+ messages in thread
From: Andrew Lunn @ 2021-10-19 15:21 UTC (permalink / raw)
  To: Erik Ekman
  Cc: Edward Cree, Martin Habets, David S. Miller, Jakub Kicinski,
	netdev, linux-kernel

On Sun, Oct 17, 2021 at 07:16:57PM +0200, Erik Ekman wrote:
> Everything except the first 32 bits was lost when the pause flags were
> added. This makes the 50000baseCR2 mode flag (bit 34) not appear.
> 
> I have tested this with a 10G card (SFN5122F-R7) by modifying it to
> return a non-legacy link mode (10000baseCR).

Does this need a Fixes: tag? Should it be added to stable?

     Andrew

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

* Re: [PATCH] sfc: Fix reading non-legacy supported link modes
  2021-10-19 15:21 ` Andrew Lunn
@ 2021-10-19 17:41   ` Erik Ekman
  2021-10-19 18:29     ` Andrew Lunn
  0 siblings, 1 reply; 12+ messages in thread
From: Erik Ekman @ 2021-10-19 17:41 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Edward Cree, Martin Habets, David S. Miller, Jakub Kicinski,
	netdev, linux-kernel

On Tue, 19 Oct 2021 at 17:21, Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Sun, Oct 17, 2021 at 07:16:57PM +0200, Erik Ekman wrote:
> > Everything except the first 32 bits was lost when the pause flags were
> > added. This makes the 50000baseCR2 mode flag (bit 34) not appear.
> >
> > I have tested this with a 10G card (SFN5122F-R7) by modifying it to
> > return a non-legacy link mode (10000baseCR).
>
> Does this need a Fixes: tag? Should it be added to stable?
>

The speed flags in use that can be lost are for 50G and 100G.
The affected devices are ones based on the Solarflare EF100 networking
IP in Xilinx FPGAs supporting 10/25/40/100-gigabit.
I don't know how widespread these are, and if there might be enough
users for adding this to stable.

The gsettings api code for sfc was added in 7cafe8f82438ced6d ("net:
sfc: use new api ethtool_{get|set}_link_ksettings")
and the bug was introduced then, but bits would only be lost after
support for 25/50/100G was added in
5abb5e7f916ee8d2d ("sfc: add bits for 25/50/100G supported/advertised speeds").
Not sure which of these should be used for a Fixes tag.

I only noticed this because I was using newer flags for signaling
1G/10G fibre support in my other patch.

Thanks
/Erik

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

* Re: [PATCH] sfc: Fix reading non-legacy supported link modes
  2021-10-19 17:41   ` Erik Ekman
@ 2021-10-19 18:29     ` Andrew Lunn
  2021-10-25 18:58       ` Erik Ekman
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Lunn @ 2021-10-19 18:29 UTC (permalink / raw)
  To: Erik Ekman
  Cc: Edward Cree, Martin Habets, David S. Miller, Jakub Kicinski,
	netdev, linux-kernel

On Tue, Oct 19, 2021 at 07:41:46PM +0200, Erik Ekman wrote:
> On Tue, 19 Oct 2021 at 17:21, Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > On Sun, Oct 17, 2021 at 07:16:57PM +0200, Erik Ekman wrote:
> > > Everything except the first 32 bits was lost when the pause flags were
> > > added. This makes the 50000baseCR2 mode flag (bit 34) not appear.
> > >
> > > I have tested this with a 10G card (SFN5122F-R7) by modifying it to
> > > return a non-legacy link mode (10000baseCR).
> >
> > Does this need a Fixes: tag? Should it be added to stable?
> >
> 
> The speed flags in use that can be lost are for 50G and 100G.
> The affected devices are ones based on the Solarflare EF100 networking
> IP in Xilinx FPGAs supporting 10/25/40/100-gigabit.
> I don't know how widespread these are, and if there might be enough
> users for adding this to stable.
> 
> The gsettings api code for sfc was added in 7cafe8f82438ced6d ("net:
> sfc: use new api ethtool_{get|set}_link_ksettings")
> and the bug was introduced then, but bits would only be lost after
> support for 25/50/100G was added in
> 5abb5e7f916ee8d2d ("sfc: add bits for 25/50/100G supported/advertised speeds").
> Not sure which of these should be used for a Fixes tag.

I would you this second one, since that is when it becomes visible to
users.

	Andrew

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

* Re: [PATCH] sfc: Fix reading non-legacy supported link modes
  2021-10-19 18:29     ` Andrew Lunn
@ 2021-10-25 18:58       ` Erik Ekman
  2021-10-25 19:29         ` Erik Ekman
  0 siblings, 1 reply; 12+ messages in thread
From: Erik Ekman @ 2021-10-25 18:58 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Edward Cree, Martin Habets, David S. Miller, Jakub Kicinski,
	netdev, linux-kernel

On Tue, 19 Oct 2021 at 20:29, Andrew Lunn <andrew@lunn.ch> wrote:
>
> On Tue, Oct 19, 2021 at 07:41:46PM +0200, Erik Ekman wrote:
> > On Tue, 19 Oct 2021 at 17:21, Andrew Lunn <andrew@lunn.ch> wrote:
> > >
> > > On Sun, Oct 17, 2021 at 07:16:57PM +0200, Erik Ekman wrote:
> > > > Everything except the first 32 bits was lost when the pause flags were
> > > > added. This makes the 50000baseCR2 mode flag (bit 34) not appear.
> > > >
> > > > I have tested this with a 10G card (SFN5122F-R7) by modifying it to
> > > > return a non-legacy link mode (10000baseCR).
> > >
> > > Does this need a Fixes: tag? Should it be added to stable?
> > >
> >
> > The speed flags in use that can be lost are for 50G and 100G.
> > The affected devices are ones based on the Solarflare EF100 networking
> > IP in Xilinx FPGAs supporting 10/25/40/100-gigabit.
> > I don't know how widespread these are, and if there might be enough
> > users for adding this to stable.
> >
> > The gsettings api code for sfc was added in 7cafe8f82438ced6d ("net:
> > sfc: use new api ethtool_{get|set}_link_ksettings")
> > and the bug was introduced then, but bits would only be lost after
> > support for 25/50/100G was added in
> > 5abb5e7f916ee8d2d ("sfc: add bits for 25/50/100G supported/advertised speeds").
> > Not sure which of these should be used for a Fixes tag.
>
> I would you this second one, since that is when it becomes visible to
> users.
>
Thanks

I found that the SFC9250 is also affected (it supports 10/25/40/50/100G)

Fixes: 5abb5e7f916ee8 ("sfc: add bits for 25/50/100G
supported/advertised speeds")

/Erik

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

* Re: [PATCH] sfc: Fix reading non-legacy supported link modes
  2021-10-25 18:58       ` Erik Ekman
@ 2021-10-25 19:29         ` Erik Ekman
  0 siblings, 0 replies; 12+ messages in thread
From: Erik Ekman @ 2021-10-25 19:29 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Edward Cree, Martin Habets, David S. Miller, Jakub Kicinski,
	netdev, linux-kernel

On Mon, 25 Oct 2021 at 20:58, Erik Ekman <erik@kryo.se> wrote:
>
> On Tue, 19 Oct 2021 at 20:29, Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > On Tue, Oct 19, 2021 at 07:41:46PM +0200, Erik Ekman wrote:
> > > On Tue, 19 Oct 2021 at 17:21, Andrew Lunn <andrew@lunn.ch> wrote:
> > > >
> > > > On Sun, Oct 17, 2021 at 07:16:57PM +0200, Erik Ekman wrote:
> > > > > Everything except the first 32 bits was lost when the pause flags were
> > > > > added. This makes the 50000baseCR2 mode flag (bit 34) not appear.
> > > > >
> > > > > I have tested this with a 10G card (SFN5122F-R7) by modifying it to
> > > > > return a non-legacy link mode (10000baseCR).
> > > >
> > > > Does this need a Fixes: tag? Should it be added to stable?
> > > >
> > >
> > > The speed flags in use that can be lost are for 50G and 100G.
> > > The affected devices are ones based on the Solarflare EF100 networking
> > > IP in Xilinx FPGAs supporting 10/25/40/100-gigabit.
> > > I don't know how widespread these are, and if there might be enough
> > > users for adding this to stable.
> > >
> > > The gsettings api code for sfc was added in 7cafe8f82438ced6d ("net:
> > > sfc: use new api ethtool_{get|set}_link_ksettings")
> > > and the bug was introduced then, but bits would only be lost after
> > > support for 25/50/100G was added in
> > > 5abb5e7f916ee8d2d ("sfc: add bits for 25/50/100G supported/advertised speeds").
> > > Not sure which of these should be used for a Fixes tag.
> >
> > I would you this second one, since that is when it becomes visible to
> > users.
> >
> Thanks
>
> I found that the SFC9250 is also affected (it supports 10/25/40/50/100G)
>
> Fixes: 5abb5e7f916ee8 ("sfc: add bits for 25/50/100G
> supported/advertised speeds")
>
> /Erik

I see that the other patch adding new modes (c62041c5baa9d, "sfc:
Export fibre-specific supported link mode") has been merged to net
(and upstream), so this is needed there as well.

/Erik

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

* Re: [PATCH] sfc: Fix reading non-legacy supported link modes
  2021-11-03 11:15 ` Erik Ekman
@ 2021-11-04  8:18   ` Greg KH
  0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2021-11-04  8:18 UTC (permalink / raw)
  To: Erik Ekman; +Cc: stable, David S . Miller

On Wed, Nov 03, 2021 at 12:15:22PM +0100, Erik Ekman wrote:
> commit 041c61488236a5a84789083e3d9f0a51139b6edf upstream,
> with filename updated in backport to v5.4 and older.

Thank you, now queued up.

greg k-h

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

* [PATCH] sfc: Fix reading non-legacy supported link modes
  2021-11-03 11:15 Erik Ekman
@ 2021-11-03 11:15 ` Erik Ekman
  2021-11-04  8:18   ` Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: Erik Ekman @ 2021-11-03 11:15 UTC (permalink / raw)
  To: stable; +Cc: Erik Ekman, David S . Miller

commit 041c61488236a5a84789083e3d9f0a51139b6edf upstream,
with filename updated in backport to v5.4 and older.

Everything except the first 32 bits was lost when the pause flags were
added. This makes the 50000baseCR2 mode flag (bit 34) not appear.

I have tested this with a 10G card (SFN5122F-R7) by modifying it to
return a non-legacy link mode (10000baseCR).

Signed-off-by: Erik Ekman <erik@kryo.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/ethernet/sfc/ethtool.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 86b965875540..d53e945dd08f 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -128,20 +128,14 @@ efx_ethtool_get_link_ksettings(struct net_device *net_dev,
 {
 	struct efx_nic *efx = netdev_priv(net_dev);
 	struct efx_link_state *link_state = &efx->link_state;
-	u32 supported;
 
 	mutex_lock(&efx->mac_lock);
 	efx->phy_op->get_link_ksettings(efx, cmd);
 	mutex_unlock(&efx->mac_lock);
 
 	/* Both MACs support pause frames (bidirectional and respond-only) */
-	ethtool_convert_link_mode_to_legacy_u32(&supported,
-						cmd->link_modes.supported);
-
-	supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
-
-	ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
-						supported);
+	ethtool_link_ksettings_add_link_mode(cmd, supported, Pause);
+	ethtool_link_ksettings_add_link_mode(cmd, supported, Asym_Pause);
 
 	if (LOOPBACK_INTERNAL(efx)) {
 		cmd->base.speed = link_state->speed;
-- 
2.33.1


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

* [PATCH] sfc: Fix reading non-legacy supported link modes
@ 2021-11-03 11:15 Erik Ekman
  2021-11-03 11:15 ` Erik Ekman
  0 siblings, 1 reply; 12+ messages in thread
From: Erik Ekman @ 2021-11-03 11:15 UTC (permalink / raw)
  To: stable

Here is the backported patch for v5.4 and v4.19.

Cheers


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

* [PATCH] sfc: Fix reading non-legacy supported link modes
@ 2021-11-03 11:13 Erik Ekman
  0 siblings, 0 replies; 12+ messages in thread
From: Erik Ekman @ 2021-11-03 11:13 UTC (permalink / raw)
  To: stable

Here is the backported version for v5.4 and v4.19

Cheers


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

* [PATCH] sfc: Fix reading non-legacy supported link modes
@ 2021-11-03 11:12 Erik Ekman
  0 siblings, 0 replies; 12+ messages in thread
From: Erik Ekman @ 2021-11-03 11:12 UTC (permalink / raw)
  To: stable

Here is the backported version for v5.4 and v4.19.


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

end of thread, other threads:[~2021-11-04  8:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-17 17:16 [PATCH] sfc: Fix reading non-legacy supported link modes Erik Ekman
2021-10-18 13:30 ` patchwork-bot+netdevbpf
2021-10-19 15:21 ` Andrew Lunn
2021-10-19 17:41   ` Erik Ekman
2021-10-19 18:29     ` Andrew Lunn
2021-10-25 18:58       ` Erik Ekman
2021-10-25 19:29         ` Erik Ekman
2021-11-03 11:12 Erik Ekman
2021-11-03 11:13 Erik Ekman
2021-11-03 11:15 Erik Ekman
2021-11-03 11:15 ` Erik Ekman
2021-11-04  8:18   ` Greg KH

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.