X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl3fwd-power%2Fmain.c;h=48b9c85e1b440ffcdf4780e26482e64110b73991;hb=f4d1e19c293dc95073614f630ea729cf0bfb57b7;hp=13fd72d213e0d79183eb3d79ddee973cfc4fd38a;hpb=ea153cc853049c6f935693e48d2866782370a3fe;p=dpdk.git diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 13fd72d213..48b9c85e1b 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -824,17 +824,24 @@ power_freq_scaleup_heuristic(unsigned lcore_id, static int sleep_until_rx_interrupt(int num) { + /* + * we want to track when we are woken up by traffic so that we can go + * back to sleep again without log spamming. + */ + static bool timeout; struct rte_epoll_event event[num]; int n, i; uint16_t port_id; uint8_t queue_id; void *data; - RTE_LOG(INFO, L3FWD_POWER, - "lcore %u sleeps until interrupt triggers\n", - rte_lcore_id()); + if (!timeout) { + RTE_LOG(INFO, L3FWD_POWER, + "lcore %u sleeps until interrupt triggers\n", + rte_lcore_id()); + } - n = rte_epoll_wait(RTE_EPOLL_PER_THREAD, event, num, -1); + n = rte_epoll_wait(RTE_EPOLL_PER_THREAD, event, num, 10); for (i = 0; i < n; i++) { data = event[i].epdata.data; port_id = ((uintptr_t)data) >> CHAR_BIT; @@ -845,6 +852,7 @@ sleep_until_rx_interrupt(int num) " port %d queue %d\n", rte_lcore_id(), port_id, queue_id); } + timeout = n == 0; return 0; } @@ -1307,7 +1315,8 @@ start_rx: /** * start receiving packets immediately */ - goto start_rx; + if (likely(!is_done())) + goto start_rx; } } stats[lcore_id].sleep_time += lcore_idle_hint;