[dpdk-dev,1/3] eal: fix keep alive header for C++
Commit Message
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@6wind.com>
---
lib/librte_eal/common/include/rte_keepalive.h | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
Comments
On 05/02/2016 17:06, Thomas Monjalon wrote:
> 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@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
@@ -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];