OSDN Git Service

net/mlx5e: Add a flush timeout define
authorAya Levin <ayal@mellanox.com>
Thu, 30 Apr 2020 15:50:49 +0000 (18:50 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 3 Jul 2020 04:05:16 +0000 (21:05 -0700)
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
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c

index 895d03d..2938553 100644 (file)
@@ -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);
index 5161a19..495a3e6 100644 (file)
@@ -29,7 +29,8 @@ out:
 
 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)
index b95dc15..6eb2971 100644 (file)
@@ -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)