summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroyuki Mikita <h.mikita89@gmail.com>2016-07-17 23:35:39 +0900
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-25 17:55:12 +0200
commitd43baa8503741a0df3feb890265084c22e3fd3ba (patch)
treeed522ce04ce14548191e6e304a5ac3854107abcb
parentc3acd92746c3cf5521e583d3a7a6c63d7980db3a (diff)
downloaddpdk-d43baa8503741a0df3feb890265084c22e3fd3ba.zip
dpdk-d43baa8503741a0df3feb890265084c22e3fd3ba.tar.gz
dpdk-d43baa8503741a0df3feb890265084c22e3fd3ba.tar.xz
timer: fix pending-list manipulation
This commit fixes incorrect pending-list manipulation when getting list of expired timers in rte_timer_manage(). When timer_get_prev_entries() sets pending_head on prev, the pending-list is broken. The next of pending_head always becomes NULL. In this depth level, it is not need to manipulate the list. Fixes: 9b15ba895b9f ("timer: use a skip list") Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com> Acked-by: Robert Sanford <rsanford@akamai.com>
-rw-r--r--lib/librte_timer/rte_timer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c
index 3dcdab5..7457d32 100644
--- a/lib/librte_timer/rte_timer.c
+++ b/lib/librte_timer/rte_timer.c
@@ -543,6 +543,8 @@ void rte_timer_manage(void)
/* break the existing list at current time point */
timer_get_prev_entries(cur_time, lcore_id, prev);
for (i = priv_timer[lcore_id].curr_skiplist_depth -1; i >= 0; i--) {
+ if (prev[i] == &priv_timer[lcore_id].pending_head)
+ continue;
priv_timer[lcore_id].pending_head.sl_next[i] =
prev[i]->sl_next[i];
if (prev[i]->sl_next[i] == NULL)