path: root/drivers/net/i40e
diff options
authorIlya Maximets <>2018-10-10 17:12:20 +0300
committerFerruh Yigit <>2018-10-26 22:14:06 +0200
commitfd61c749dbb2224d1e988085340c22ab9c985243 (patch)
treece4ca3a3bb721289084b15ed8141c0cf4c83e65f /drivers/net/i40e
parenta51639cc720aa17922d4b479e9961169f3a36c64 (diff)
drivers/net: use sleep delay by default for Intel NICs
NICs uses different delays up to a second during their configuration. It makes no sense to busy-wait so long wasting CPU cycles and preventing any other threads to execute on the same CPU core. These busy polling are the rudiments that came from the kernel drivers where you can not sleep in interrupt context, but as we're in userspace, we're able and should sleep to allow other threads to run. Delays never called on rx/tx path, so this should not affect performance. Signed-off-by: Ilya Maximets <> Reviewed-by: Ferruh Yigit <>
Diffstat (limited to 'drivers/net/i40e')
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h
index 9d6ee4d..8a2d82a 100644
--- a/drivers/net/i40e/base/i40e_osdep.h
+++ b/drivers/net/i40e/base/i40e_osdep.h
@@ -205,9 +205,9 @@ struct i40e_spinlock {
#define i40e_memcpy(a, b, c, d) rte_memcpy((a), (b), (c))
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
-#define DELAY(x) rte_delay_us(x)
-#define i40e_usec_delay(x) rte_delay_us(x)
-#define i40e_msec_delay(x) rte_delay_us(1000*(x))
+#define DELAY(x) rte_delay_us_sleep(x)
+#define i40e_usec_delay(x) DELAY(x)
+#define i40e_msec_delay(x) DELAY(1000 * (x))
#define udelay(x) DELAY(x)
#define msleep(x) DELAY(1000*(x))
#define usleep_range(min, max) msleep(DIV_ROUND_UP(min, 1000))