[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200622.163032.618270174941503260.davem@davemloft.net>
Date: Mon, 22 Jun 2020 16:30:32 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: idosch@...sch.org
Cc: netdev@...r.kernel.org, kuba@...nel.org, jiri@...lanox.com,
colin.king@...onical.com, mlxsw@...lanox.com, idosch@...lanox.com
Subject: Re: [PATCH net] mlxsw: spectrum: Do not rely on machine endianness
From: Ido Schimmel <idosch@...sch.org>
Date: Sun, 21 Jun 2020 11:29:17 +0300
> From: Ido Schimmel <idosch@...lanox.com>
>
> The second commit cited below performed a cast of 'u32 buffsize' to
> '(u16 *)' when calling mlxsw_sp_port_headroom_8x_adjust():
>
> mlxsw_sp_port_headroom_8x_adjust(mlxsw_sp_port, (u16 *) &buffsize);
>
> Colin noted that this will behave differently on big endian
> architectures compared to little endian architectures.
>
> Fix this by following Colin's suggestion and have the function accept
> and return 'u32' instead of passing the current size by reference.
>
> Fixes: da382875c616 ("mlxsw: spectrum: Extend to support Spectrum-3 ASIC")
> Fixes: 60833d54d56c ("mlxsw: spectrum: Adjust headroom buffers for 8x ports")
> Signed-off-by: Ido Schimmel <idosch@...lanox.com>
> Reported-by: Colin Ian King <colin.king@...onical.com>
> Suggested-by: Colin Ian King <colin.king@...onical.com>
Applied and queued up for -stable, thanks.
Powered by blists - more mailing lists