diff options
author | Pavel Kotucek <pkotucek@cisco.com> | 2016-11-28 09:02:23 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-12-06 12:22:44 +0000 |
commit | d335dac3e2fe9704a9686f53017e17d4b5ba9ed7 (patch) | |
tree | 4a1f0f90f462e8ed1d2a34a4dfe15795df7e1272 | |
parent | a9b2d5831eae036205f69cd539167936d2a180cf (diff) |
dpdk: add rte_delay_us_callback
Converted DPDK16.07 "Allow-applications-to-override-rte_delay_us" patch
to of callback in DPDK16.11
Change-Id: I6c802e3ea8f817e5df591166b1e0a42f5f835a71
Signed-off-by: Pavel Kotucek <pkotucek@cisco.com>
-rw-r--r-- | vpp/vnet/main.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/vpp/vnet/main.c b/vpp/vnet/main.c index 32332cb6618..bc73723c4a4 100644 --- a/vpp/vnet/main.c +++ b/vpp/vnet/main.c @@ -37,7 +37,12 @@ rte_delay_us_override (unsigned us) /* Don't bother intercepting for short delays */ if (us < 10) - return 0; + { +#if RTE_VERSION < RTE_VERSION_NUM(16, 11, 0, 0) + rte_delay_us_block (us); +#endif + return 0; + } /* * Only intercept if we are in a vlib process. @@ -79,6 +84,13 @@ vpe_main_init (vlib_main_t * vm) /* Turn off network stack components which we don't want */ vlib_mark_init_function_complete (vm, srp_init); + +#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); +#endif +#endif } /* |