From 685e865495d24681db75b63f00ed68279fc7844f Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Tue, 8 Mar 2016 10:50:39 +0000 Subject: [PATCH] keepalive: set timestamp on core registration 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 bd1f16bf67..56df0b1f62 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(); + } } -- 2.20.1