Message ID | 1468776950-32693-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 472CB2BD3; Sun, 17 Jul 2016 19:36:03 +0200 (CEST) Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by dpdk.org (Postfix) with ESMTP id A70A81DB1 for <dev@dpdk.org>; Sun, 17 Jul 2016 19:36:01 +0200 (CEST) Received: by mail-pf0-f194.google.com with SMTP id g202so10030180pfb.1 for <dev@dpdk.org>; Sun, 17 Jul 2016 10:36:01 -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=AfSUQLbkYZkCBLARAxu1d5W0Rp8iPwaRyDZqx2JynhU=; b=D1cEDS8WPRf0DLQ4JI8FTFHERql5Gk/Pmb9972fzVr/hpuoBv/aLTwK4yI3C/MJbTY QpAGrr3QtKKBr7/TFzRgyanpoIZgcnn8uH0dqeF3jB7gJjj/zUzRDLv+YiD3iWBdvlc1 0o7Th0/DlJndmDVbvdZvrMuJ/xvXl/13NPyBNwVVxH8/Ooizkx6YeRBf25U/fyuZelBF 3XE3udP7XEO+flCCR4qs3I54f3iR8pthWVFafVhQzlFBwSv6nMIVEdtiLUOZoS6C3bTc AHTdaZUO+Tv0szkuUcJO9bxrpEtz8z71PMlf9iqWvOlYRwYiWSnAwZblAo4S0VL5jrZD W6pA== 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=AfSUQLbkYZkCBLARAxu1d5W0Rp8iPwaRyDZqx2JynhU=; b=WiM6hjuoYDbsuxj54HzGc0EEvcAojO0HE8rwyE8vqo5svSNuisU58GjcseID87/E4d eMWMPFdHoFvOJ5PYF9Crq4Bv8/FoY61o+8Yhw23bSCOFRhcH8pNnv/YWCjwAtNh3IcGT HdXJnGPeXEFKhf0z1e8iucI/Px8fy+potDmZ6X2iqjO8zsR+hWWh80OOiPCtCjK1ETp0 rE38MKlrz7JGtBYvC2UG9CDdtPr9J3tuOAwOM2z5i0qQRGOILIGnyQKWGjqcBwpnsExx DZY8jBCzR+tXVD1HQWF/5sJYJP+pn36SauEYhXXx/prsG9i2BoOeG0DhSAjXgpkTuthO ikJw== X-Gm-Message-State: ALyK8tJOr0tjBjlL3G3aWt7K1jCdtqXhp55gANo2FSyfFwqOB9IKfXBulJHanghVqacpJg== X-Received: by 10.98.210.69 with SMTP id c66mr16404896pfg.71.1468776961014; Sun, 17 Jul 2016 10:36:01 -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 d5sm828494pfa.44.2016.07.17.10.35.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 Jul 2016 10:36:00 -0700 (PDT) From: Hiroyuki Mikita <h.mikita89@gmail.com> To: rsanford@akamai.com Cc: dev@dpdk.org Date: Mon, 18 Jul 2016 02:35:50 +0900 Message-Id: <1468776950-32693-1-git-send-email-h.mikita89@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] timer: remove unnecessary timer add call 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, 5:35 p.m. UTC
When timer_set_running_state() fails in rte_timer_manage(),
the failed timer is put back on pending-list.
In this case, another core tries to reset or stop the timer.
It does not need to be on pending-list
Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
---
lib/librte_timer/rte_timer.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Comments
On 7/17/16 1:35 PM, "Hiroyuki Mikita" <h.mikita89@gmail.com> wrote: >When timer_set_running_state() fails in rte_timer_manage(), >the failed timer is put back on pending-list. >In this case, another core tries to reset or stop the timer. >It does not need to be on pending-list > >Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com> >--- > lib/librte_timer/rte_timer.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > >diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c >index 3dcdab5..94878d3 100644 >--- a/lib/librte_timer/rte_timer.c >+++ b/lib/librte_timer/rte_timer.c >@@ -562,10 +562,9 @@ void rte_timer_manage(void) > pprev = &tim->sl_next[0]; > } else { > /* another core is trying to re-config this one, >- * remove it from local expired list and put it >- * back on the priv_timer[] skip list */ >+ * remove it from local expired list >+ */ > *pprev = next_tim; >- timer_add(tim, lcore_id, 1); > } > } > >-- >2.7.4 > Acked-by: Robert Sanford <rsanford@akamai.com>
Fixes: a4b7a5a45cf5 ("timer: fix race condition") 2016-07-23 7:06 GMT+09:00 Sanford, Robert <rsanford@akamai.com>: > > > On 7/17/16 1:35 PM, "Hiroyuki Mikita" <h.mikita89@gmail.com> wrote: > >>When timer_set_running_state() fails in rte_timer_manage(), >>the failed timer is put back on pending-list. >>In this case, another core tries to reset or stop the timer. >>It does not need to be on pending-list >> >>Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com> >>--- >> lib/librte_timer/rte_timer.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> >>diff --git a/lib/librte_timer/rte_timer.c b/lib/librte_timer/rte_timer.c >>index 3dcdab5..94878d3 100644 >>--- a/lib/librte_timer/rte_timer.c >>+++ b/lib/librte_timer/rte_timer.c >>@@ -562,10 +562,9 @@ void rte_timer_manage(void) >> pprev = &tim->sl_next[0]; >> } else { >> /* another core is trying to re-config this one, >>- * remove it from local expired list and put it >>- * back on the priv_timer[] skip list */ >>+ * remove it from local expired list >>+ */ >> *pprev = next_tim; >>- timer_add(tim, lcore_id, 1); >> } >> } >> >>-- >>2.7.4 >> > > Acked-by: Robert Sanford <rsanford@akamai.com> >
2016-07-26 00:15, Hiroyuki Mikita: > Fixes: a4b7a5a45cf5 ("timer: fix race condition") > > > >>When timer_set_running_state() fails in rte_timer_manage(), > >>the failed timer is put back on pending-list. > >>In this case, another core tries to reset or stop the timer. > >>It does not need to be on pending-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..94878d3 100644 --- a/lib/librte_timer/rte_timer.c +++ b/lib/librte_timer/rte_timer.c @@ -562,10 +562,9 @@ void rte_timer_manage(void) pprev = &tim->sl_next[0]; } else { /* another core is trying to re-config this one, - * remove it from local expired list and put it - * back on the priv_timer[] skip list */ + * remove it from local expired list + */ *pprev = next_tim; - timer_add(tim, lcore_id, 1); } }