eal/bsd: support alarm API
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 26 Jun 2018 10:53:15 +0000 (11:53 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 13 Jul 2018 10:40:45 +0000 (12:40 +0200)
commit26021a71506780dde6e0cfcfe631f713419a477c
tree3f282954626e96e3ad8c80a223adbee5ed2e96f8
parent23150bd8d8a89452b8c424d7dc9f840620a5fe96
eal/bsd: support alarm API

Implement EAL alarm API support for FreeBSD. The implementation
is largely identical to that of Linux version, with one key
difference.

The alarm API is a little Linux-centric in that it is expecting
the alarm API to manage alarm timeouts without involvement of the
interrupt thread. This works on Linux because in Linux, there's
timerfd API which allows waiting for timer events on an fd.

On FreeBSD, however, there are no timerfd's, and timer events are
set up directly in kevent. There is no way to pass information from
the alarm API to the interrupt thread, so we also add a little
back-channel magic to get soonest alarm timeout from the alarm API.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/bsdapp/eal/eal_alarm.c
lib/librte_eal/bsdapp/eal/eal_alarm_private.h [new file with mode: 0644]
lib/librte_eal/bsdapp/eal/eal_interrupts.c