Skip to content

Commit bb765a7

Browse files
idoschPaolo Abeni
authored andcommitted
mlxsw: spectrum_fid: Fix incorrect local port type
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: bf73904 ("mlxsw: Add support for 802.1Q FID family") Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Danielle Ratson <[email protected]> Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/eace1f9d96545ab8a2775db857cb7e291a9b166b.1679398549.git.petrm@nvidia.com Signed-off-by: Paolo Abeni <[email protected]>
1 parent 4107b87 commit bb765a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ static int mlxsw_sp_fid_8021q_port_vid_map(struct mlxsw_sp_fid *fid,
13541354
u16 vid)
13551355
{
13561356
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
1357-
u8 local_port = mlxsw_sp_port->local_port;
1357+
u16 local_port = mlxsw_sp_port->local_port;
13581358
int err;
13591359

13601360
/* 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,
13911391
struct mlxsw_sp_port *mlxsw_sp_port, u16 vid)
13921392
{
13931393
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
1394-
u8 local_port = mlxsw_sp_port->local_port;
1394+
u16 local_port = mlxsw_sp_port->local_port;
13951395

13961396
mlxsw_sp_fid_port_vid_list_del(fid, mlxsw_sp_port->local_port, vid);
13971397
mlxsw_sp_fid_evid_map(fid, local_port, vid, false);

0 commit comments

Comments
 (0)