* [PATCH net] mlxsw: spectrum_fid: Fix incorrect local port type
@ 2023-03-21 11:42 Petr Machata
2023-03-21 16:43 ` Simon Horman
2023-03-22 15:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Petr Machata @ 2023-03-21 11:42 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
Cc: Ido Schimmel, Petr Machata, Amit Cohen, mlxsw, Danielle Ratson
From: Ido Schimmel <idosch@nvidia.com>
Local port is a 10-bit number, but it was mistakenly stored in a u8,
resulting in firmware errors when using a netdev corresponding to a
local port higher than 255.
Fix by storing the local port in u16, as is done in the rest of the
code.
Fixes: bf73904f5fba ("mlxsw: Add support for 802.1Q FID family")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c
index 045a24cacfa5..b6ee2d658b0c 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c
@@ -1354,7 +1354,7 @@ static int mlxsw_sp_fid_8021q_port_vid_map(struct mlxsw_sp_fid *fid,
u16 vid)
{
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
- u8 local_port = mlxsw_sp_port->local_port;
+ u16 local_port = mlxsw_sp_port->local_port;
int err;
/* In case there are no {Port, VID} => FID mappings on the port,
@@ -1391,7 +1391,7 @@ mlxsw_sp_fid_8021q_port_vid_unmap(struct mlxsw_sp_fid *fid,
struct mlxsw_sp_port *mlxsw_sp_port, u16 vid)
{
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
- u8 local_port = mlxsw_sp_port->local_port;
+ u16 local_port = mlxsw_sp_port->local_port;
mlxsw_sp_fid_port_vid_list_del(fid, mlxsw_sp_port->local_port, vid);
mlxsw_sp_fid_evid_map(fid, local_port, vid, false);
--
2.39.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] mlxsw: spectrum_fid: Fix incorrect local port type
2023-03-21 11:42 [PATCH net] mlxsw: spectrum_fid: Fix incorrect local port type Petr Machata
@ 2023-03-21 16:43 ` Simon Horman
2023-03-22 15:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-03-21 16:43 UTC (permalink / raw)
To: Petr Machata
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, Ido Schimmel, Amit Cohen, mlxsw, Danielle Ratson
On Tue, Mar 21, 2023 at 12:42:00PM +0100, Petr Machata wrote:
> From: Ido Schimmel <idosch@nvidia.com>
>
> Local port is a 10-bit number, but it was mistakenly stored in a u8,
> resulting in firmware errors when using a netdev corresponding to a
> local port higher than 255.
>
> Fix by storing the local port in u16, as is done in the rest of the
> code.
>
> Fixes: bf73904f5fba ("mlxsw: Add support for 802.1Q FID family")
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> Reviewed-by: Danielle Ratson <danieller@nvidia.com>
> Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] mlxsw: spectrum_fid: Fix incorrect local port type
2023-03-21 11:42 [PATCH net] mlxsw: spectrum_fid: Fix incorrect local port type Petr Machata
2023-03-21 16:43 ` Simon Horman
@ 2023-03-22 15:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-22 15:00 UTC (permalink / raw)
To: Petr Machata
Cc: davem, edumazet, kuba, pabeni, netdev, idosch, amcohen, mlxsw,
danieller
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Tue, 21 Mar 2023 12:42:00 +0100 you wrote:
> From: Ido Schimmel <idosch@nvidia.com>
>
> Local port is a 10-bit number, but it was mistakenly stored in a u8,
> resulting in firmware errors when using a netdev corresponding to a
> local port higher than 255.
>
> Fix by storing the local port in u16, as is done in the rest of the
> code.
>
> [...]
Here is the summary with links:
- [net] mlxsw: spectrum_fid: Fix incorrect local port type
https://git.kernel.org/netdev/net/c/bb765a743377
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] 3+ messages in thread
end of thread, other threads:[~2023-03-22 15:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-21 11:42 [PATCH net] mlxsw: spectrum_fid: Fix incorrect local port type Petr Machata
2023-03-21 16:43 ` Simon Horman
2023-03-22 15:00 ` 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.