DPDK  21.11.8
rte_keepalive.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2015-2016 Intel Corporation.
3  */
4 
11 #ifndef _KEEPALIVE_H_
12 #define _KEEPALIVE_H_
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include <rte_config.h>
19 #include <rte_memory.h>
20 
21 #ifndef RTE_KEEPALIVE_MAXCORES
22 
25 #define RTE_KEEPALIVE_MAXCORES RTE_MAX_LCORE
26 #endif
27 
28 enum rte_keepalive_state {
29  RTE_KA_STATE_UNUSED = 0,
30  RTE_KA_STATE_ALIVE = 1,
31  RTE_KA_STATE_MISSING = 4,
32  RTE_KA_STATE_DEAD = 2,
33  RTE_KA_STATE_GONE = 3,
34  RTE_KA_STATE_DOZING = 5,
35  RTE_KA_STATE_SLEEP = 6
36 };
37 
47  void *data,
48  const int id_core);
49 
62  void *data,
63  const int id_core,
64  enum rte_keepalive_state core_state,
65  uint64_t last_seen
66  );
67 
72 struct rte_keepalive;
73 
83 struct rte_keepalive *rte_keepalive_create(
85  void *data);
86 
92 void rte_keepalive_dispatch_pings(void *ptr_timer, void *ptr_data);
93 
101 void rte_keepalive_register_core(struct rte_keepalive *keepcfg,
102  const int id_core);
103 
112 void
113 rte_keepalive_mark_alive(struct rte_keepalive *keepcfg);
114 
124 void
125 rte_keepalive_mark_sleep(struct rte_keepalive *keepcfg);
126 
141 void
142 rte_keepalive_register_relay_callback(struct rte_keepalive *keepcfg,
144  void *data);
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* _KEEPALIVE_H_ */
void(* rte_keepalive_relay_callback_t)(void *data, const int id_core, enum rte_keepalive_state core_state, uint64_t last_seen)
Definition: rte_keepalive.h:61
void rte_keepalive_mark_sleep(struct rte_keepalive *keepcfg)
void rte_keepalive_register_relay_callback(struct rte_keepalive *keepcfg, rte_keepalive_relay_callback_t callback, void *data)
void(* rte_keepalive_failure_callback_t)(void *data, const int id_core)
Definition: rte_keepalive.h:46
void rte_keepalive_dispatch_pings(void *ptr_timer, void *ptr_data)
struct rte_keepalive * rte_keepalive_create(rte_keepalive_failure_callback_t callback, void *data)
void rte_keepalive_mark_alive(struct rte_keepalive *keepcfg)
void rte_keepalive_register_core(struct rte_keepalive *keepcfg, const int id_core)