[dpdk-dev] [PATCH] vfio: eventfd should be non-block and not inherited

Stephen Hemminger stephen at networkplumber.org
Wed Apr 29 17:15:45 CEST 2015


Set internal event file descriptor to be non-block and not
inherited across exec.  This prevents accidental hangs and
passing in anothr thread.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 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 aea1fb1..426953a 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.1.4



More information about the dev mailing list