Files
linux/drivers
Petr Machata 052d09258f mlxsw: __mlxsw_sp_port_headroom_set(): Fix a use of local variable
[ Upstream commit 289460404f ]

The function-local variable "delay" enters the loop interpreted as delay
in bits. However, inside the loop it gets overwritten by the result of
mlxsw_sp_pg_buf_delay_get(), and thus leaves the loop as quantity in
cells. Thus on second and further loop iterations, the headroom for a
given priority is configured with a wrong size.

Fix by introducing a loop-local variable, delay_cells. Rename thres to
thres_cells for consistency.

Fixes: f417f04da5 ("mlxsw: spectrum: Refactor port buffer configuration")
Signed-off-by: Petr Machata <petrm@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-23 09:06:42 +01:00
..
2019-02-12 19:46:03 +01:00
2018-07-22 14:28:43 +02:00
2018-07-03 11:24:56 +02:00
2019-02-12 19:46:09 +01:00
2018-12-21 14:13:14 +01:00
2019-02-12 19:46:04 +01:00
2018-01-17 09:45:27 +01:00
2018-09-15 09:45:27 +02:00
2018-12-21 14:13:13 +01:00
2019-02-12 19:46:13 +01:00
2018-11-13 11:15:11 -08:00
2018-10-03 17:00:46 -07:00
2019-01-31 08:13:41 +01:00