Change dpdk input node fixed-sleep units to usec

Change-Id: I94e8737cad9222d24602db4ad03bf43c12c62b79
Signed-off-by: Dave Barach <dave@barachs.net>
This commit is contained in:
Dave Barach
2017-03-08 10:41:47 -05:00
committed by Damjan Marion
parent bb152882fb
commit c6ec8f3924
3 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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) \

View File

@ -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)
{