summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-03-08 10:41:47 -0500
committerDamjan Marion <dmarion.lists@gmail.com>2017-03-08 16:40:21 +0000
commitc6ec8f39240a166a7e04a7834a28107b6353b46a (patch)
treefd2c086b30a017333d0d63e1be51a681ef8ecc74 /src/plugins
parentbb152882fbdeb730d47a08a77287c30b74b92407 (diff)
Change dpdk input node fixed-sleep units to usec
Change-Id: I94e8737cad9222d24602db4ad03bf43c12c62b79 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/dpdk/device/dpdk.h4
-rwxr-xr-xsrc/plugins/dpdk/device/init.c2
-rw-r--r--src/plugins/dpdk/device/node.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/dpdk/device/dpdk.h b/src/plugins/dpdk/device/dpdk.h
index 2a1a6205..092c7dca 100644
--- a/src/plugins/dpdk/device/dpdk.h
+++ b/src/plugins/dpdk/device/dpdk.h
@@ -380,8 +380,8 @@ typedef struct
f64 link_state_poll_interval;
f64 stat_poll_interval;
- /* Sleep for this many MS after each device poll */
- u32 poll_sleep;
+ /* Sleep for this many usec after each device poll */
+ u32 poll_sleep_usec;
/* convenience */
vlib_main_t *vlib_main;
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 0130c0e9..85ecde25 100755
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -1354,7 +1354,7 @@ dpdk_config (vlib_main_t * vm, unformat_input_t * input)
tmp = format (0, "--no-pci%c", 0);
vec_add1 (conf->eal_init_args, tmp);
}
- else if (unformat (input, "poll-sleep %d", &dm->poll_sleep))
+ else if (unformat (input, "poll-sleep %d", &dm->poll_sleep_usec))
;
#define _(a) \
diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c
index ccbfd2f2..2120069e 100644
--- a/src/plugins/dpdk/device/node.c
+++ b/src/plugins/dpdk/device/node.c
@@ -533,12 +533,12 @@ static inline void
poll_rate_limit (dpdk_main_t * dm)
{
/* Limit the poll rate by sleeping for N msec between polls */
- if (PREDICT_FALSE (dm->poll_sleep != 0))
+ if (PREDICT_FALSE (dm->poll_sleep_usec != 0))
{
struct timespec ts, tsrem;
ts.tv_sec = 0;
- ts.tv_nsec = 1000 * 1000 * dm->poll_sleep; /* 1ms */
+ ts.tv_nsec = 1000 * dm->poll_sleep_usec;
while (nanosleep (&ts, &tsrem) < 0)
{