eal: add ack interrupt API
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Tue, 23 Jul 2019 08:04:18 +0000 (10:04 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 23 Jul 2019 10:00:22 +0000 (12:00 +0200)
commita159730c2f3ae3fdabc52c20565470a9d8abd98a
tree9b2e2f35346de6caf45734b25d897ed26095d5cf
parent33543fb3b655f0b093bd9fa88f5fafddd18190ba
eal: add ack interrupt API

Add new ack interrupt API to avoid using
VFIO_IRQ_SET_ACTION_TRIGGER(rte_intr_enable()) for
acking interrupt purpose for VFIO based interrupt handlers.
This implementation is specific to Linux.

Using rte_intr_enable() for acking interrupt has below issues

 * Time consuming to do for every interrupt received as it will
   free_irq() followed by request_irq() and all other initializations
 * A race condition because of a window between free_irq() and
   request_irq() with packet reception still on and device still
   enabled and would throw warning messages like below.
   [158764.159833] do_IRQ: 9.34 No irq handler for vector

In this patch, rte_intr_ack() is a no-op for VFIO_MSIX/VFIO_MSI interrupts
as they are edge triggered and kernel would not mask the interrupt before
delivering the event to userspace and we don't need to ack.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Shahed Shaikh <shshaikh@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
lib/librte_eal/common/include/rte_interrupts.h
lib/librte_eal/freebsd/eal/eal_interrupts.c
lib/librte_eal/linux/eal/eal_interrupts.c
lib/librte_eal/rte_eal_version.map