summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-12-06 16:50:42 +0100
committerDave Barach <openvpp@barachs.net>2016-12-06 17:26:03 +0000
commitfc6e693d0a3e3518b7b8de270542d2b5f9a17150 (patch)
tree6c27d20d52453ec4aed364092e447e20e10189d8
parentd3eb90ecfc1711805deab241a63edd2da2203ef8 (diff)
dpdk: fix rte_delay_us callback issue
Introduced by recent commit. It causes initalization failure on many NICs. Change-Id: I409ebb8ca5ae29eb9d43438017a0d1ddddb472fc Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--vpp/vnet/main.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/vpp/vnet/main.c b/vpp/vnet/main.c
index bc73723c4a4..6dac33cb0e4 100644
--- a/vpp/vnet/main.c
+++ b/vpp/vnet/main.c
@@ -37,12 +37,7 @@ rte_delay_us_override (unsigned us)
/* Don't bother intercepting for short delays */
if (us < 10)
- {
-#if RTE_VERSION < RTE_VERSION_NUM(16, 11, 0, 0)
- rte_delay_us_block (us);
-#endif
- return 0;
- }
+ return 0;
/*
* Only intercept if we are in a vlib process.
@@ -72,6 +67,13 @@ rte_delay_us_override (unsigned us)
}
return 0; // no override
}
+
+static void
+rte_delay_us_override_cb (unsigned us)
+{
+ if (rte_delay_us_override (us) == 0)
+ rte_delay_us_block (us);
+}
#endif
static void
@@ -88,7 +90,7 @@ vpe_main_init (vlib_main_t * vm)
#if DPDK
#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0)
/* register custom delay function */
- rte_delay_us_callback_register ((void (*)) rte_delay_us_override);
+ rte_delay_us_callback_register (rte_delay_us_override_cb);
#endif
#endif
}