vfio: revert interrupt eventfd setup at probe
authorNithin Dabilpuram <ndabilpuram@marvell.com>
Tue, 23 Jul 2019 08:04:17 +0000 (10:04 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 23 Jul 2019 10:00:14 +0000 (12:00 +0200)
commit33543fb3b655f0b093bd9fa88f5fafddd18190ba
treeba962f43cacf8da5c8979a18d552b713b274c196
parentf0f96b472ca72ede5cda905b38c0dd95d1948363
vfio: revert interrupt eventfd setup at probe

This reverts commit 89aac60e0be9ed95a87b16e3595f102f9faaffb4.
"vfio: fix interrupts race condition"

The above mentioned commit moves the interrupt's eventfd setup
to probe time but only enables one interrupt for all types of
interrupt handles i.e VFIO_MSI, VFIO_LEGACY, VFIO_MSIX, UIO.
It works fine with default case but breaks below cases specifically
for MSIX based interrupt handles.

* Applications like l3fwd-power that request rxq interrupts
  while ethdev setup.
* Drivers that need > 1 MSIx interrupts to be configured for
  functionality to work.

VFIO PCI for MSIx expects all the possible vectors to be setup up
when using VFIO_IRQ_SET_ACTION_TRIGGER so that they can be
allocated from kernel pci subsystem. Only way to increase the number
of vectors later is first free all by using VFIO_IRQ_SET_DATA_NONE
with action trigger and then enable new vector count.

Above commit changes the behavior of rte_intr_[enable|disable] to
only mask and unmask unlike earlier behavior and thereby
breaking above two scenarios.

Fixes: 89aac60e0be9 ("vfio: fix interrupts race condition")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Shahed Shaikh <shshaikh@marvell.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
drivers/bus/pci/linux/pci_vfio.c
lib/librte_eal/linux/eal/eal_interrupts.c