* [PATCH v2 net-next] net/mlx5: net/mlx5: Fix some error messages
@ 2021-04-29 11:06 Dan Carpenter
2021-05-02 7:41 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-04-29 11:06 UTC (permalink / raw)
To: Saeed Mahameed
Cc: Leon Romanovsky, David S. Miller, Jakub Kicinski,
Yevgeny Kliteynik, netdev, linux-rdma, kernel-janitors
This code was using IS_ERR() instead of PTR_ERR() so it prints 1 instead
of the correct error code. Even better would be to use %pe which prints
out the name of the error, as in "ENOMEM", "EINVAL" etc.
Fixes: 25cb31768042 ("net/mlx5: E-Switch, Improve error messages in term table creation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: Use %pe instead of %ld.
Leon says this goes through netdev instead of the RDMA tree.
.../mellanox/mlx5/core/eswitch_offloads_termtbl.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
index a81ece94f599..a0efb19bf285 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
@@ -83,16 +83,16 @@ mlx5_eswitch_termtbl_create(struct mlx5_core_dev *dev,
ft_attr.autogroup.max_num_groups = 1;
tt->termtbl = mlx5_create_auto_grouped_flow_table(root_ns, &ft_attr);
if (IS_ERR(tt->termtbl)) {
- esw_warn(dev, "Failed to create termination table (error %d)\n",
- IS_ERR(tt->termtbl));
+ esw_warn(dev, "Failed to create termination table (error %pe)\n",
+ tt->termtbl);
return -EOPNOTSUPP;
}
tt->rule = mlx5_add_flow_rules(tt->termtbl, NULL, flow_act,
&tt->dest, 1);
if (IS_ERR(tt->rule)) {
- esw_warn(dev, "Failed to create termination table rule (error %d)\n",
- IS_ERR(tt->rule));
+ esw_warn(dev, "Failed to create termination table rule (error %pe)\n",
+ tt->rule);
goto add_flow_err;
}
return 0;
@@ -283,8 +283,8 @@ mlx5_eswitch_add_termtbl_rule(struct mlx5_eswitch *esw,
tt = mlx5_eswitch_termtbl_get_create(esw, &term_tbl_act,
&dest[i], attr);
if (IS_ERR(tt)) {
- esw_warn(esw->dev, "Failed to get termination table (error %d)\n",
- IS_ERR(tt));
+ esw_warn(esw->dev, "Failed to get termination table (error %pe)\n",
+ tt);
goto revert_changes;
}
attr->dests[num_vport_dests].termtbl = tt;
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 net-next] net/mlx5: net/mlx5: Fix some error messages
2021-04-29 11:06 [PATCH v2 net-next] net/mlx5: net/mlx5: Fix some error messages Dan Carpenter
@ 2021-05-02 7:41 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2021-05-02 7:41 UTC (permalink / raw)
To: Dan Carpenter
Cc: Saeed Mahameed, David S. Miller, Jakub Kicinski,
Yevgeny Kliteynik, netdev, linux-rdma, kernel-janitors
On Thu, Apr 29, 2021 at 02:06:04PM +0300, Dan Carpenter wrote:
> This code was using IS_ERR() instead of PTR_ERR() so it prints 1 instead
> of the correct error code. Even better would be to use %pe which prints
> out the name of the error, as in "ENOMEM", "EINVAL" etc.
>
> Fixes: 25cb31768042 ("net/mlx5: E-Switch, Improve error messages in term table creation")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: Use %pe instead of %ld.
>
> Leon says this goes through netdev instead of the RDMA tree.
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-02 7:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 11:06 [PATCH v2 net-next] net/mlx5: net/mlx5: Fix some error messages Dan Carpenter
2021-05-02 7:41 ` Leon Romanovsky
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).