Lines Matching defs:timer

12 	struct bpf_timer timer;
69 static int timer_cb1(void *map, int *key, struct bpf_timer *timer)
72 * Once via array timer callback and once via lru timer callback
76 /* *key == 0 - the callback was called for array timer.
77 * *key == 4 - the callback was called from lru timer.
83 /* rearm array timer to be called again in ~35 seconds */
84 if (bpf_timer_start(timer, 1ull << 35, 0) != 0)
109 * element and force deletion of this timer
116 * which means that key/timer memory was reused
122 /* check that the timer was removed */
123 if (bpf_timer_cancel(timer) != -EINVAL)
153 * doesn't leak timer memory.
171 /* re-arm the timer again to execute after 1 usec */
172 bpf_timer_start(&val->timer, 1000, 0);
190 if (bpf_timer_cancel(&val->timer) != -EDEADLK)
193 /* delete this key and this timer anyway.
203 if (bpf_timer_start(&val->timer, 1000, 0) != -EINVAL)
211 if (bpf_timer_cancel(&val->timer) != -EDEADLK)
214 /* delete this key and this timer anyway.
231 if (bpf_timer_init(&val->timer, &hmap, CLOCK_BOOTTIME) != 0)
233 bpf_timer_set_callback(&val->timer, timer_cb2);
234 bpf_timer_start(&val->timer, 1000, 0);
238 if (bpf_timer_init(&val->timer, &hmap_malloc, CLOCK_BOOTTIME) != 0)
240 bpf_timer_set_callback(&val->timer, timer_cb2);
241 bpf_timer_start(&val->timer, 1000, 0);
256 bpf_timer_init(&val->timer, &hmap, CLOCK_BOOTTIME);
257 /* update the same key to free the timer */
263 bpf_timer_init(&val->timer, &hmap_malloc, CLOCK_BOOTTIME);
264 /* update the same key to free the timer */
268 * don't leak timer memory.
274 bpf_timer_init(&val->timer, &hmap, CLOCK_BOOTTIME);
279 bpf_timer_init(&val->timer, &hmap, CLOCK_BOOTTIME);
286 bpf_timer_init(&val->timer, &hmap_malloc, CLOCK_BOOTTIME);
291 bpf_timer_init(&val->timer, &hmap_malloc, CLOCK_BOOTTIME);
296 /* callback for absolute timer */
297 static int timer_cb3(void *map, int *key, struct bpf_timer *timer)
302 bpf_timer_start(timer, bpf_ktime_get_boot_ns() + 1000,
305 /* Re-arm timer ~35 seconds in future */
306 bpf_timer_start(timer, bpf_ktime_get_boot_ns() + (1ull << 35),
317 struct bpf_timer *timer;
321 timer = bpf_map_lookup_elem(&abs_timer, &key);
322 if (timer) {
323 if (bpf_timer_init(timer, &abs_timer, CLOCK_BOOTTIME) != 0)
325 bpf_timer_set_callback(timer, timer_cb3);
326 bpf_timer_start(timer, bpf_ktime_get_boot_ns() + 1000,