From: Stephen Hemminger Date: Wed, 29 Apr 2015 15:15:45 +0000 (-0700) Subject: vfio: set eventfd non-blocking and not inherited X-Git-Tag: spdx-start~9231 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=21a0cf353539131bf7f879a8d5d17374401dff0b;p=dpdk.git vfio: set eventfd non-blocking and not inherited Set internal event file descriptor to be non-block and not inherited across exec. This prevents accidental hangs and passing in another thread. Signed-off-by: Stephen Hemminger Acked-by: Anatoly Burakov --- diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index aea1fb1249..426953ab4f 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -294,7 +294,7 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd) } /* set up an eventfd for interrupts */ - fd = eventfd(0, 0); + fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); if (fd < 0) { RTE_LOG(ERR, EAL, " cannot set up eventfd, " "error %i (%s)\n", errno, strerror(errno));