summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Cohen <eli@mellanox.com>2018-08-09 01:23:53 +0200
committerDavid S. Miller <davem@davemloft.net>2018-08-09 04:34:55 +0200
commit269d26f47f6f7d4275b0e225c9ee80cf4a31aa8c (patch)
treecd48df3febdd05b0f84c512c1993797c6f221dc7
parentnet/mlx5: Unexport functions that need not be exported (diff)
downloadlinux-269d26f47f6f7d4275b0e225c9ee80cf4a31aa8c.tar.xz
linux-269d26f47f6f7d4275b0e225c9ee80cf4a31aa8c.zip
net/mlx5: Reduce command polling interval
Use cond_resched() instead of usleep_range() to decrease the time between polling attempts thus reducing overall driver load time. Below is a comparison before and after the change, of loading eight virtual functions. Before: real 0m8.785s user 0m0.093s sys 0m0.090s After: real 0m5.730s user 0m0.097s sys 0m0.087s Signed-off-by: Eli Cohen <eli@mellanox.com> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/cmd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
index f498c7730c5b..fe4ac40dbade 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
@@ -211,7 +211,7 @@ static void poll_timeout(struct mlx5_cmd_work_ent *ent)
ent->ret = 0;
return;
}
- usleep_range(5000, 10000);
+ cond_resched();
} while (time_before(jiffies, poll_end));
ent->ret = -ETIMEDOUT;