When built in a C++ application, the keepalive include fails: rte_keepalive.h:142:41: error: ?ALIVE? was not declared in this scope keepcfg->state_flags[rte_lcore_id()] = ALIVE; ^
Fixes: 75583b0d1efd ("eal: add keep alive monitoring") Signed-off-by: Thomas Monjalon <thomas.monjalon at 6wind.com> --- lib/librte_eal/common/include/rte_keepalive.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/librte_eal/common/include/rte_keepalive.h b/lib/librte_eal/common/include/rte_keepalive.h index 02472c0..3418c60 100644 --- a/lib/librte_eal/common/include/rte_keepalive.h +++ b/lib/librte_eal/common/include/rte_keepalive.h @@ -60,18 +60,21 @@ typedef void (*rte_keepalive_failure_callback_t)( const int id_core); +enum rte_keepalive_state { + ALIVE = 1, + MISSING = 0, + DEAD = 2, + GONE = 3 +}; + /** * Keepalive state structure. * @internal */ struct rte_keepalive { /** Core Liveness. */ - enum { - ALIVE = 1, - MISSING = 0, - DEAD = 2, - GONE = 3 - } __rte_cache_aligned state_flags[RTE_KEEPALIVE_MAXCORES]; + enum rte_keepalive_state __rte_cache_aligned + state_flags[RTE_KEEPALIVE_MAXCORES]; /** Last-seen-alive timestamps */ uint64_t last_alive[RTE_KEEPALIVE_MAXCORES]; -- 2.7.0