summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAchiad Shochat <achiad@mellanox.com>2015-11-03 08:07:19 +0200
committerDavid S. Miller <davem@davemloft.net>2015-11-03 10:41:50 -0500
commit01c196a2d3d1cfaab7d20879236e981104749510 (patch)
tree8a0b5fab06f0ea037f0fee7d7b2d4df13c6e2f1d /drivers
parenta1985740904342a884471348f6e038ee5d706c36 (diff)
downloadlinux-01c196a2d3d1cfaab7d20879236e981104749510.tar.bz2
net/mlx5e: Wait for RX buffers initialization in a more proper manner
Use jiffies rather than wait loop with msleep(). The wait loop didn't take into consideration time when the process was not executing. Signed-off-by: Achiad Shochat <achiad@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 9df6f9ae9bb5..0bab33c6cec0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -442,12 +442,12 @@ static void mlx5e_disable_rq(struct mlx5e_rq *rq)
static int mlx5e_wait_for_min_rx_wqes(struct mlx5e_rq *rq)
{
+ unsigned long exp_time = jiffies + msecs_to_jiffies(20000);
struct mlx5e_channel *c = rq->channel;
struct mlx5e_priv *priv = c->priv;
struct mlx5_wq_ll *wq = &rq->wq;
- int i;
- for (i = 0; i < 1000; i++) {
+ while (time_before(jiffies, exp_time)) {
if (wq->cur_sz >= priv->params.min_rx_wqes)
return 0;