Search code examples
clinuxasynchronouslinux-kerneldpdk

How can I make DPDK timers work really asynchronously?


DPDK timers are declared as asynchronous in doc. But in this example we have LCORE-workers (per CPU core) which need to check timer status in busy loop synchronously (calling rte_timer_manage() for some reason)

Is there a way to handle timer (run callback function) really asynchronously? E.g. rte_reset() timer in LCORE and then handle it inside control thread asynchronously on another CPU core (by signal, interrupt or whatever?)


Solution

  • Is there a way to handle timer (run callback function) really asynchronously?

    Short answer - nope.
    DPDK timers are asynchronous only in the sense that they will fire at a time given by the rte_timer_reset() function, but not at a guaranteed point while code execution. So from the code handling point of view they are synchronous because callbacks can only be executed at specific points in your code - rte_timer_manage() calls.