From: Petr Machata <petrm@nvidia.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Ido Schimmel <idosch@mellanox.com>,
Ido Schimmel <idosch@nvidia.com>,
"Petr Machata" <petrm@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
<netdev@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH net] mlxsw: fix mlxsw_sp2_nve_vxlan_learning_set() return type
Date: Fri, 6 Oct 2023 12:19:43 +0200 [thread overview]
Message-ID: <87fs2oqc0u.fsf@nvidia.com> (raw)
In-Reply-To: <6b2eb847-1d23-4b72-a1da-204df03f69d3@moroto.mountain>
Dan Carpenter <dan.carpenter@linaro.org> writes:
> The mlxsw_sp2_nve_vxlan_learning_set() function is supposed to return
> zero on success or negative error codes. So it needs to be type int
> instead of bool.
Yes. Vast majority of the time the error code is 0, which converts to
false, which converts back to 0. But for errors this gets sliced to 1,
which eventually percolates to notifier_from_errno(), which yields
NOTIFY_STOP_MASK | NOTIFY_DONE instead of encoding the error code,
masking the failure.
> Fixes: 4ee70efab68d ("mlxsw: spectrum_nve: Add support for VXLAN on Spectrum-2")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Thanks!
> ---
> drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c
> index bb8eeb86edf7..52c2fe3644d4 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c
> @@ -310,8 +310,8 @@ const struct mlxsw_sp_nve_ops mlxsw_sp1_nve_vxlan_ops = {
> .fdb_clear_offload = mlxsw_sp_nve_vxlan_clear_offload,
> };
>
> -static bool mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp,
> - bool learning_en)
> +static int mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp,
> + bool learning_en)
> {
> char tnpc_pl[MLXSW_REG_TNPC_LEN];
next prev parent reply other threads:[~2023-10-06 10:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-05 14:00 [PATCH net] mlxsw: fix mlxsw_sp2_nve_vxlan_learning_set() return type Dan Carpenter
2023-10-06 10:19 ` Petr Machata [this message]
2023-10-08 13:01 ` patchwork-bot+netdevbpf
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=87fs2oqc0u.fsf@nvidia.com \
--to=petrm@nvidia.com \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@mellanox.com \
--cc=idosch@nvidia.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).