Skip to content

Commit 01c196a

Browse files
Achiad Shochatdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a198574 commit 01c196a

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,12 +442,12 @@ static void mlx5e_disable_rq(struct mlx5e_rq *rq)
442442

443443
static int mlx5e_wait_for_min_rx_wqes(struct mlx5e_rq *rq)
444444
{
445+
unsigned long exp_time = jiffies + msecs_to_jiffies(20000);
445446
struct mlx5e_channel *c = rq->channel;
446447
struct mlx5e_priv *priv = c->priv;
447448
struct mlx5_wq_ll *wq = &rq->wq;
448-
int i;
449449

450-
for (i = 0; i < 1000; i++) {
450+
while (time_before(jiffies, exp_time)) {
451451
if (wq->cur_sz >= priv->params.min_rx_wqes)
452452
return 0;
453453

0 commit comments

Comments
 (0)