From 21a0cf353539131bf7f879a8d5d17374401dff0b Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 29 Apr 2015 08:15:45 -0700 Subject: [PATCH] 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 --- lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- 2.20.1