From patchwork Tue Mar 8 10:50:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 11199 Return-Path: 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 B04383238; Tue, 8 Mar 2016 11:51:01 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5D91A3195 for ; Tue, 8 Mar 2016 11:51:00 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 08 Mar 2016 02:50:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,556,1449561600"; d="scan'208";a="904825362" Received: from sie-lab-212-120.ir.intel.com (HELO silpixa00394367.ir.intel.com) ([10.237.212.120]) by orsmga001.jf.intel.com with ESMTP; 08 Mar 2016 02:50:57 -0800 From: Harry van Haaren To: remy.horton@intel.com Date: Tue, 8 Mar 2016 10:50:39 +0000 Message-Id: <1457434240-13707-3-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457434240-13707-1-git-send-email-harry.van.haaren@intel.com> References: <1456140362-3771-1-git-send-email-harry.van.haaren@intel.com> <1457434240-13707-1-git-send-email-harry.van.haaren@intel.com> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH v4 2/3] eal: add keepalive core register timestamp X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch sets a timestamp on each lcore when it is registered for keepalive. This causes the first values read by the monitor to show time since the core was registered, instead of the delta between 0 and the timestamp counter. Signed-off-by: Harry van Haaren Acked-by: Remy Horton --- lib/librte_eal/common/rte_keepalive.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/rte_keepalive.c b/lib/librte_eal/common/rte_keepalive.c index bd1f16b..56df0b1 100644 --- a/lib/librte_eal/common/rte_keepalive.c +++ b/lib/librte_eal/common/rte_keepalive.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright 2015 Intel Shannon Ltd. All rights reserved. + * Copyright(c) 2015-2016 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,6 +38,7 @@ #include #include #include +#include struct rte_keepalive { /** Core Liveness. */ @@ -139,8 +140,10 @@ rte_keepalive_create(rte_keepalive_failure_callback_t callback, void rte_keepalive_register_core(struct rte_keepalive *keepcfg, const int id_core) { - if (id_core < RTE_KEEPALIVE_MAXCORES) + if (id_core < RTE_KEEPALIVE_MAXCORES) { keepcfg->active_cores[id_core] = 1; + keepcfg->last_alive[id_core] = rte_rdtsc(); + } }