All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Aya Levin <ayal@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 02/12] net/mlx5e: Add a flush timeout define
Date: Thu,  2 Jul 2020 21:08:22 -0700	[thread overview]
Message-ID: <20200703040832.670860-3-saeedm@mellanox.com> (raw)
In-Reply-To: <20200703040832.670860-1-saeedm@mellanox.com>

From: Aya Levin <ayal@mellanox.com>

During queue's recovery, driver waits for flush. The flush timeout is
set to 2 seconds. Add a define for this value for the benefit of RX and
TX reporters.

Signed-off-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/health.h      | 1 +
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 3 ++-
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/health.h b/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
index 895d03d56c9d..2938553a7606 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/health.h
@@ -33,6 +33,7 @@ void mlx5e_reporter_rq_cqe_err(struct mlx5e_rq *rq);
 void mlx5e_reporter_rx_timeout(struct mlx5e_rq *rq);
 
 #define MLX5E_REPORTER_PER_Q_MAX_LEN 256
+#define MLX5E_REPORTER_FLUSH_TIMEOUT_MSEC 2000
 
 struct mlx5e_err_ctx {
 	int (*recover)(void *ctx);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
index 5161a1954577..495a3e6bf82b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
@@ -29,7 +29,8 @@ static int mlx5e_query_rq_state(struct mlx5_core_dev *dev, u32 rqn, u8 *state)
 
 static int mlx5e_wait_for_icosq_flush(struct mlx5e_icosq *icosq)
 {
-	unsigned long exp_time = jiffies + msecs_to_jiffies(2000);
+	unsigned long exp_time = jiffies +
+				 msecs_to_jiffies(MLX5E_REPORTER_FLUSH_TIMEOUT_MSEC);
 
 	while (time_before(jiffies, exp_time)) {
 		if (icosq->cc == icosq->pc)
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 b95dc15f23b9..6eb2971231d8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -5,7 +5,8 @@
 
 static int mlx5e_wait_for_sq_flush(struct mlx5e_txqsq *sq)
 {
-	unsigned long exp_time = jiffies + msecs_to_jiffies(2000);
+	unsigned long exp_time = jiffies +
+				 msecs_to_jiffies(MLX5E_REPORTER_FLUSH_TIMEOUT_MSEC);
 
 	while (time_before(jiffies, exp_time)) {
 		if (sq->cc == sq->pc)
-- 
2.26.2


  parent reply	other threads:[~2020-07-03  4:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03  4:08 [pull request][net-next 00/12] mlx5 updates 2020-07-02 Saeed Mahameed
2020-07-03  4:08 ` [net-next 01/12] net/mlx5e: Change reporters create functions to return void Saeed Mahameed
2020-07-03  4:08 ` Saeed Mahameed [this message]
2020-07-03  4:08 ` [net-next 03/12] net/mlx5e: Remove redundant RQ state query Saeed Mahameed
2020-07-03  4:08 ` [net-next 04/12] net/mlx5e: Align RX/TX reporters diagnose output format Saeed Mahameed
2020-07-03  4:08 ` [net-next 05/12] net/mlx5e: Move RQ helpers to txrx.h Saeed Mahameed
2020-07-03  4:08 ` [net-next 06/12] net/mlx5e: Add helper to get RQ WQE's head Saeed Mahameed
2020-07-03  4:08 ` [net-next 07/12] net/mlx5e: Add helper to get the RQ WQE counter Saeed Mahameed
2020-07-03  4:08 ` [net-next 08/12] net/mlx5e: Rename reporter's helpers Saeed Mahameed
2020-07-03  4:08 ` [net-next 09/12] net/mlx5e: Enhance CQ data on diagnose output Saeed Mahameed
2020-07-03  4:08 ` [net-next 10/12] net/mlx5e: Add EQ info to TX/RX reporter's diagnose Saeed Mahameed
2020-07-03  4:08 ` [net-next 11/12] net/mlx5e: Enhance ICOSQ data on RX " Saeed Mahameed
2020-07-03  4:08 ` [net-next 12/12] net/mlx5e: Enhance TX timeout recovery Saeed Mahameed
2020-07-03 19:33 ` [pull request][net-next 00/12] mlx5 updates 2020-07-02 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=20200703040832.670860-3-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=ayal@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --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 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.