eal/freebsd: fix queuing duplicate alarm callbacks
authorMit Matelske <mit@pt.net>
Wed, 20 Nov 2019 20:10:56 +0000 (14:10 -0600)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 25 Mar 2020 12:56:13 +0000 (13:56 +0100)
commitbcf789da7335b80e792ba926b5a95a12fa2e1e9a
tree33c29f1f029b50943666c0ab073a127a7ec42402
parenta7f895740caa04ed3674ad5b054268d862bed83f
eal/freebsd: fix queuing duplicate alarm callbacks

The source callback list grows infinitely when more than alarm
is queued.

This fix recognizes that an alarm interrupt in FreeBSD should never
have more than one callback on its list, so if
rte_intr_callback_register() is called with an interrupt handle type
of RTE_INTR_HANDLE_ALARM, so if such an interrupt type already has a
non-empty list, then a new callback is not created, but the kevent
timer is restarted properly.

Fixes: 23150bd8d8a8 ("eal/bsd: add interrupt thread")
Cc: stable@dpdk.org
Signed-off-by: Mit Matelske <mit@pt.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/freebsd/eal/eal_interrupts.c