Netdev List
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Eran Ben Elisha <eranbe@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 5/9] net/mlx5e: Re-add support for TX timeout when TX reporter is not valid
Date: Fri, 22 Feb 2019 13:44:22 -0800	[thread overview]
Message-ID: <20190222214426.27833-6-saeedm@mellanox.com> (raw)
In-Reply-To: <20190222214426.27833-1-saeedm@mellanox.com>

From: Eran Ben Elisha <eranbe@mellanox.com>

When TX reporter was introduced, it took ownership over TX timeout error
handling. this introduced a regression in case TX reporter is not valid
(NET_DEVLINK is not set, or devlink_health_reporter_create failure).

Fix mlx5e_tx_reporter_timeout function so it can be called at all times.

In addition, remove a warning print that indicates that a TX timeout won't
be handled in case of no valid TX reporter.

Fixes: 7d91126b1aea ("net/mlx5e: Add tx timeout support for mlx5e tx reporter")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 .../ethernet/mellanox/mlx5/core/en/reporter_tx.c | 16 ++++++++++++++--
 .../net/ethernet/mellanox/mlx5/core/en_main.c    |  6 ------
 drivers/net/ethernet/mellanox/mlx5/core/en_tx.c  |  5 ++---
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
index e05b8fce8dbb..201ea73e3021 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -113,6 +113,18 @@ static int mlx5e_tx_reporter_err_cqe_recover(struct mlx5e_txqsq *sq)
 	return 0;
 }
 
+static int mlx5_tx_health_report(struct devlink_health_reporter *tx_reporter,
+				 char *err_str,
+				 struct mlx5e_tx_err_ctx *err_ctx)
+{
+	if (IS_ERR_OR_NULL(tx_reporter)) {
+		netdev_err(err_ctx->sq->channel->netdev, err_str);
+		return err_ctx->recover(err_ctx->sq);
+	}
+
+	return devlink_health_report(tx_reporter, err_str, err_ctx);
+}
+
 void mlx5e_tx_reporter_err_cqe(struct mlx5e_txqsq *sq)
 {
 	char err_str[MLX5E_TX_REPORTER_PER_SQ_MAX_LEN];
@@ -122,7 +134,7 @@ void mlx5e_tx_reporter_err_cqe(struct mlx5e_txqsq *sq)
 	err_ctx.recover  = mlx5e_tx_reporter_err_cqe_recover;
 	sprintf(err_str, "ERR CQE on SQ: 0x%x", sq->sqn);
 
-	devlink_health_report(sq->channel->priv->tx_reporter, err_str,
+	mlx5_tx_health_report(sq->channel->priv->tx_reporter, err_str,
 			      &err_ctx);
 }
 
@@ -160,7 +172,7 @@ int mlx5e_tx_reporter_timeout(struct mlx5e_txqsq *sq)
 		sq->channel->ix, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc,
 		jiffies_to_usecs(jiffies - sq->txq->trans_start));
 
-	return devlink_health_report(sq->channel->priv->tx_reporter, err_str,
+	return mlx5_tx_health_report(sq->channel->priv->tx_reporter, err_str,
 				     &err_ctx);
 }
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 878b3467e459..4f971f3d8ce7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -4173,12 +4173,6 @@ static void mlx5e_tx_timeout(struct net_device *dev)
 	struct mlx5e_priv *priv = netdev_priv(dev);
 
 	netdev_err(dev, "TX timeout detected\n");
-
-	if (IS_ERR_OR_NULL(priv->tx_reporter)) {
-		netdev_err_once(priv->netdev, "tx timeout will not be handled, no valid tx reporter\n");
-		return;
-	}
-
 	queue_work(priv->wq, &priv->tx_timeout_work);
 }
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
index c1334a8ac8f3..d5fadbd6577e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
@@ -519,9 +519,8 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
 					      &sq->state)) {
 				mlx5e_dump_error_cqe(sq,
 						     (struct mlx5_err_cqe *)cqe);
-				if (!IS_ERR_OR_NULL(cq->channel->priv->tx_reporter))
-					queue_work(cq->channel->priv->wq,
-						   &sq->recover_work);
+				queue_work(cq->channel->priv->wq,
+					   &sq->recover_work);
 			}
 			stats->cqe_err++;
 		}
-- 
2.20.1


  parent reply	other threads:[~2019-02-22 21:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 21:44 [pull request][net-next 0/9] Mellanox, mlx5 updates 2019-02-21 Saeed Mahameed
2019-02-22 21:44 ` [net-next 1/9] net/mlx5: Use read-modify-write when changing PCMR register values Saeed Mahameed
2019-02-22 21:44 ` [net-next 2/9] net/mlx5: Introduce tunnel entropy control in PCMR register Saeed Mahameed
2019-02-22 21:44 ` [net-next 3/9] net/mlx5e: Fix GRE key by controlling port tunnel entropy calculation Saeed Mahameed
2019-02-22 21:44 ` [net-next 4/9] net/mlx5e: Fix warn print in case of TX reporter creation failure Saeed Mahameed
2019-02-22 21:44 ` Saeed Mahameed [this message]
2019-02-22 21:44 ` [net-next 6/9] net/mlx5e: Fix return status of TX reporter timeout recover Saeed Mahameed
2019-02-22 21:44 ` [net-next 7/9] net/mlx5e: Fix mlx5e_tx_reporter_create return value Saeed Mahameed
2019-02-22 21:44 ` [net-next 8/9] net/mlx5: E-Switch, Add support for VEPA in legacy mode Saeed Mahameed
2019-02-22 21:44 ` [net-next 9/9] net/mlx5: Support ndo bridge_setlink and getlink Saeed Mahameed
2019-02-23 21:56 ` [pull request][net-next 0/9] Mellanox, mlx5 updates 2019-02-21 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=20190222214426.27833-6-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=eranbe@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /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