net/mlx5: Reduce command polling interval
authorEli Cohen <eli@mellanox.com>
Wed, 8 Aug 2018 23:23:53 +0000 (16:23 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Aug 2018 02:34:55 +0000 (19:34 -0700)
commit269d26f47f6f7d4275b0e225c9ee80cf4a31aa8c
treecd48df3febdd05b0f84c512c1993797c6f221dc7
parentd1fd79f34f2d56f969472d7285ea5239ab7b7bf0
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>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c