From: David Miller <davem@davemloft.net>
To: idosch@mellanox.com
Cc: netdev@vger.kernel.org, jiri@mellanox.com, petrm@mellanox.com,
mlxsw@mellanox.com
Subject: Re: [PATCH net] mlxsw: __mlxsw_sp_port_headroom_set(): Fix a use of local variable
Date: Sun, 17 Feb 2019 10:14:40 -0800 (PST) [thread overview]
Message-ID: <20190217.101440.744217887687576351.davem@davemloft.net> (raw)
In-Reply-To: <20190217071809.19295-1-idosch@mellanox.com>
From: Ido Schimmel <idosch@mellanox.com>
Date: Sun, 17 Feb 2019 07:18:41 +0000
> From: Petr Machata <petrm@mellanox.com>
>
> 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: f417f04da589 ("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>
Applied and queued up for -stable, thanks Ido.
next prev parent reply other threads:[~2019-02-17 18:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-17 7:18 [PATCH net] mlxsw: __mlxsw_sp_port_headroom_set(): Fix a use of local variable Ido Schimmel
2019-02-17 18:14 ` David Miller [this message]
2019-02-19 9:30 ` Ido Schimmel
2019-02-19 18:33 ` David Miller
2019-02-20 8:12 ` Ido Schimmel
2019-02-20 18:41 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190217.101440.744217887687576351.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=idosch@mellanox.com \
--cc=jiri@mellanox.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).