All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Yevgeny Kliteynik <kliteyn@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 06/15] net/mlx5: E-Switch, Improve error messages in term table creation
Date: Mon, 19 Apr 2021 20:20:09 -0700	[thread overview]
Message-ID: <20210420032018.58639-7-saeed@kernel.org> (raw)
In-Reply-To: <20210420032018.58639-1-saeed@kernel.org>

From: Yevgeny Kliteynik <kliteyn@nvidia.com>

Add error code to the error messages and removed duplicated message:
if termination table creation failed, we already get an error message
in mlx5_eswitch_termtbl_create, so no need for the additional error print
in the calling function.

Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../mellanox/mlx5/core/eswitch_offloads_termtbl.c  | 14 ++++++++------
 1 file changed, 8 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 ec679560a95d..a81ece94f599 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c
@@ -83,14 +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\n");
+		esw_warn(dev, "Failed to create termination table (error %d)\n",
+			 IS_ERR(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\n");
+		esw_warn(dev, "Failed to create termination table rule (error %d)\n",
+			 IS_ERR(tt->rule));
 		goto add_flow_err;
 	}
 	return 0;
@@ -140,10 +142,9 @@ mlx5_eswitch_termtbl_get_create(struct mlx5_eswitch *esw,
 	memcpy(&tt->flow_act, flow_act, sizeof(*flow_act));
 
 	err = mlx5_eswitch_termtbl_create(esw->dev, tt, flow_act);
-	if (err) {
-		esw_warn(esw->dev, "Failed to create termination table\n");
+	if (err)
 		goto tt_create_err;
-	}
+
 	hash_add(esw->offloads.termtbl_tbl, &tt->termtbl_hlist, hash_key);
 tt_add_ref:
 	tt->ref_count++;
@@ -282,7 +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 create termination table\n");
+			esw_warn(esw->dev, "Failed to get termination table (error %d)\n",
+				 IS_ERR(tt));
 			goto revert_changes;
 		}
 		attr->dests[num_vport_dests].termtbl = tt;
-- 
2.30.2


  parent reply	other threads:[~2021-04-20  3:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20  3:20 [pull request][net-next 00/15] mlx5 updates 2021-04-19 Saeed Mahameed
2021-04-20  3:20 ` [net-next 01/15] net/mlx5e: Fix lost changes during code movements Saeed Mahameed
2021-04-20 23:30   ` patchwork-bot+netdevbpf
2021-04-20  3:20 ` [net-next 02/15] net/mlx5e: Fix possible non-initialized struct usage Saeed Mahameed
2021-04-20  3:20 ` [net-next 03/15] net/mlx5e: RX, Add checks for calculated Striding RQ attributes Saeed Mahameed
2021-04-20  3:20 ` [net-next 04/15] net/mlx5: DR, Rename an argument in dr_rdma_segments Saeed Mahameed
2021-04-20  3:20 ` [net-next 05/15] net/mlx5: DR, Fix SQ/RQ in doorbell bitmask Saeed Mahameed
2021-04-20  3:20 ` Saeed Mahameed [this message]
2021-04-20  3:20 ` [net-next 07/15] net/mlx5: mlx5_ifc updates for flex parser Saeed Mahameed
2021-04-20  4:54   ` Samudrala, Sridhar
2021-04-20 17:07     ` Yevgeny Kliteynik
2021-04-21 15:08       ` Samudrala, Sridhar
2021-04-21 17:52         ` Yevgeny Kliteynik
2021-04-20  3:20 ` [net-next 08/15] net/mlx5: DR, Remove protocol-specific flex_parser_3 definitions Saeed Mahameed
2021-04-20  3:20 ` [net-next 09/15] net/mlx5: DR, Add support for dynamic flex parser Saeed Mahameed
2021-04-20  3:20 ` [net-next 10/15] net/mlx5: DR, Set STEv0 ICMP flex parser dynamically Saeed Mahameed
2021-04-20  3:20 ` [net-next 11/15] net/mlx5: DR, Add support for matching on geneve TLV option Saeed Mahameed
2021-04-20  3:20 ` [net-next 12/15] net/mlx5: DR, Set flex parser for TNL_MPLS dynamically Saeed Mahameed
2021-04-20  3:20 ` [net-next 13/15] net/mlx5: DR, Add support for matching tunnel GTP-U Saeed Mahameed
2021-04-20  3:20 ` [net-next 14/15] net/mlx5: DR, Add support for force-loopback QP Saeed Mahameed
2021-04-20  3:20 ` [net-next 15/15] net/mlx5: DR, Add support for isolate_vl_tc QP Saeed Mahameed

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=20210420032018.58639-7-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kliteyn@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.