Message ID | 1468766139-29545-1-git-send-email-h.mikita89@gmail.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 96D4D5693; Sun, 17 Jul 2016 16:35:55 +0200 (CEST) Received: from mail-pa0-f67.google.com (mail-pa0-f67.google.com [209.85.220.67]) by dpdk.org (Postfix) with ESMTP id 2DDEC5690 for <dev@dpdk.org>; Sun, 17 Jul 2016 16:35:54 +0200 (CEST) Received: by mail-pa0-f67.google.com with SMTP id hh10so9376877pac.1 for <dev@dpdk.org>; Sun, 17 Jul 2016 07:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=I7F4RopZvjN3MCTVzNd0Aqh1sFJXUFBrsCh7mwV5aqU=; b=CHG6GROT8L2J7+KK0UHw8yk8GcJPRZVV0dgOIqdqX6s7B4sLY5M11CFNshmwJTFDe1 3AsItd0ggrrys+3HUMiAvALWEuCE8Y1TQlqFjSQckxngh1ToA4GOeKNCBg8yazb1jOuJ atPYcBTUO1GAF1W3hEZmF3qBQhFHYX6kc+qUaZASq4euPnqi7erH4zkTrF8BkmC9gOfC UMhZJwt1QTCtw2DW/yvlzllkliyh2Qa2WVWkioXP/p9O5VUdbsrD7SgjR+xOHKHT2YvG SGI/jn+NIc0pxwKFvinXQhYKmXCr1etortUFX2pkPllfzDJCIRq3mwxWuOXfZQ6RqTNJ idnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=I7F4RopZvjN3MCTVzNd0Aqh1sFJXUFBrsCh7mwV5aqU=; b=CVOVxRZ80cSiif/njgXudphcRnPdfg2jQ4leA8lTHf8Nr2EZtrAzlYFHxb4B/V73cX mnFWUwekOQK8h1LaNTEUmWGlhJQ0Y+CF3z6gHzbFrvTL6bGGoynu0z2pCEE4PhJpJXS7 tOnwYvrYVj2a5E+n9cAMQMNX1jJL1V1VabmCfyKtrS9Cujfa8ZYs+8X1LF9IHENOsGKJ o/Rp7wAURMwmmI3jr7kd6MgTdBlfA+jr0nDZYNwcUnpAeQGmDcdQjoj/1pgSOok5w7mR ht9efJPGe4NMIwmph0uO/JvLShrs7aFPhFWZbm8sdFzDriPdidi4pyxG2L5g3J7zSeRy YTMw== X-Gm-Message-State: ALyK8tJh43ZQrEFAjS7tT3aIj1xwN8pEdsJ3t/aC+ArMleOGCVIMufFDEq5hyNrwZRYa1Q== X-Received: by 10.66.229.9 with SMTP id sm9mr1313930pac.138.1468766153398; Sun, 17 Jul 2016 07:35:53 -0700 (PDT) Received: from localhost.localdomain (183.180.67.214.ap.gmobb-fix.jp. [183.180.67.214]) by smtp.gmail.com with ESMTPSA id g3sm1611236pal.9.2016.07.17.07.35.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 Jul 2016 07:35:52 -0700 (PDT) From: Hiroyuki Mikita <h.mikita89@gmail.com> To: rsanford@akamai.com Cc: dev@dpdk.org Date: Sun, 17 Jul 2016 23:35:39 +0900 Message-Id: <1468766139-29545-1-git-send-email-h.mikita89@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] timer: fix incorrect pending-list manipulation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Hiroyuki Mikita
July 17, 2016, 2:35 p.m. UTC
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(+)
Comments
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>
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> >
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
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)