DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] timer: fix incorrect pending-list manipulation
@ 2016-07-17 14:35 Hiroyuki Mikita
  2016-07-22 22:05 ` Sanford, Robert
  0 siblings, 1 reply; 4+ messages in thread
From: Hiroyuki Mikita @ 2016-07-17 14:35 UTC (permalink / raw)
  To: rsanford; +Cc: dev

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.

Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
---
 lib/librte_timer/rte_timer.c | 2 ++
 1 file changed, 2 insertions(+)

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)
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] timer: fix incorrect pending-list manipulation
  2016-07-17 14:35 [dpdk-dev] [PATCH] timer: fix incorrect pending-list manipulation Hiroyuki Mikita
@ 2016-07-22 22:05 ` Sanford, Robert
  2016-07-25 15:16   ` Hiroyuki Mikita
  0 siblings, 1 reply; 4+ messages in thread
From: Sanford, Robert @ 2016-07-22 22:05 UTC (permalink / raw)
  To: Hiroyuki Mikita, dev, Thomas Monjalon



On 7/17/16 10:35 AM, "Hiroyuki Mikita" <h.mikita89@gmail.com> wrote:

>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.
>
>Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
>---
> lib/librte_timer/rte_timer.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>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)
>-- 
>2.7.4
>

Acked-by: Robert Sanford <rsanford@akamai.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] timer: fix incorrect pending-list manipulation
  2016-07-22 22:05 ` Sanford, Robert
@ 2016-07-25 15:16   ` Hiroyuki Mikita
  2016-07-25 15:50     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Hiroyuki Mikita @ 2016-07-25 15:16 UTC (permalink / raw)
  To: Sanford, Robert; +Cc: dev, Thomas Monjalon

Fixes: 9b15ba895b9f ("timer: use a skip list")

2016-07-23 7:05 GMT+09:00 Sanford, Robert <rsanford@akamai.com>:
>
>
> On 7/17/16 10:35 AM, "Hiroyuki Mikita" <h.mikita89@gmail.com> wrote:
>
>>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.
>>
>>Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
>>---
>> lib/librte_timer/rte_timer.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>>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)
>>--
>>2.7.4
>>
>
> Acked-by: Robert Sanford <rsanford@akamai.com>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] timer: fix incorrect pending-list manipulation
  2016-07-25 15:16   ` Hiroyuki Mikita
@ 2016-07-25 15:50     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-07-25 15:50 UTC (permalink / raw)
  To: Hiroyuki Mikita; +Cc: Sanford, Robert, dev

2016-07-26 00:16, Hiroyuki Mikita:
> Fixes: 9b15ba895b9f ("timer: use a skip list")
> 
> >>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.
> >>
> >>Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
> >
> > Acked-by: Robert Sanford <rsanford@akamai.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-25 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-17 14:35 [dpdk-dev] [PATCH] timer: fix incorrect pending-list manipulation Hiroyuki Mikita
2016-07-22 22:05 ` Sanford, Robert
2016-07-25 15:16   ` Hiroyuki Mikita
2016-07-25 15:50     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).