32 static int read_config_file(
void);
36 for (
int i = 0; i < EM_ODP_MAX_TIMERS; i++) {
38 tmrs->timer[i].idx = i;
39 tmrs->timer[i].tmo_pool = ODP_POOL_INVALID;
40 tmrs->timer[i].odp_tmr_pool = ODP_TIMER_POOL_INVALID;
42 tmrs->ring_tmo_pool = ODP_POOL_INVALID;
43 tmrs->shared_tmo_pool = ODP_POOL_INVALID;
44 tmrs->ring_reserved = 0;
48 tmrs->num_ring_create_calls = 0;
50 odp_ticketlock_init(&tmrs->timer_lock);
52 if (read_config_file() < 0)
70 if (tmrs && tmrs->ring_tmo_pool != ODP_POOL_INVALID) {
71 if (odp_pool_destroy(tmrs->ring_tmo_pool) != 0)
73 tmrs->ring_tmo_pool = ODP_POOL_INVALID;
79 static int read_config_file(
void)
86 EM_PRINT(
"EM-timer config:\n");
91 conf_str =
"timer.shared_tmo_pool_enable";
94 EM_LOG(EM_LOG_ERR,
"Config option '%s' not found.\n", conf_str);
98 em_shm->opt.timer.shared_tmo_pool_enable = bval;
99 EM_PRINT(
" %s: %s\n", conf_str, bval ?
"true" :
"false");
104 if (
em_shm->opt.timer.shared_tmo_pool_enable) {
105 conf_str =
"timer.shared_tmo_pool_size";
107 if (unlikely(!ret)) {
108 EM_LOG(EM_LOG_ERR,
"Config option '%s' not found.\n", conf_str);
113 EM_LOG(EM_LOG_ERR,
"Bad config value '%s = %d'\n", conf_str, val);
117 em_shm->opt.timer.shared_tmo_pool_size = val;
118 EM_PRINT(
" %s: %d\n", conf_str, val);
124 conf_str =
"timer.tmo_pool_cache";
126 if (unlikely(!ret)) {
127 EM_LOG(EM_LOG_ERR,
"Config option '%s' not found.\n", conf_str);
132 EM_LOG(EM_LOG_ERR,
"Bad config value '%s = %d'\n", conf_str, val);
136 em_shm->opt.timer.tmo_pool_cache = val;
137 EM_PRINT(
" %s: %d\n", conf_str, val);
142 conf_str =
"timer.ring.timer_event_pool_size";
144 if (unlikely(!ret)) {
145 EM_LOG(EM_LOG_ERR,
"Config option '%s' not found.\n", conf_str);
150 EM_LOG(EM_LOG_ERR,
"Bad config value '%s = %d'\n", conf_str, val);
154 em_shm->opt.timer.ring.timer_event_pool_size = val;
155 EM_PRINT(
" %s: %d\n", conf_str, val);
160 conf_str =
"timer.ring.timer_event_pool_cache";
162 if (unlikely(!ret)) {
163 EM_LOG(EM_LOG_ERR,
"Config option '%s' not found.\n", conf_str);
168 EM_LOG(EM_LOG_ERR,
"Bad config value '%s = %d'\n", conf_str, val);
172 em_shm->opt.timer.ring.timer_event_pool_cache = val;
173 EM_PRINT(
" %s: %d\n", conf_str, val);