vfio: eventfd should be non-block and not inherited
PATCH 1/1 vfio: eventfd should be non-block and not inherited
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 <[email protected]>
--- lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +1 -1
@@ -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));
Signature · 1 line
2.1.4
A message that is not in the archive (sent off-list or not yet received): 1430320545-16638-1-git-send-email-stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public.gmane.org
Burakov, Anatoly
Acked-byQuoted 22 lines
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 <[email protected]>--- lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +1
-1@@ -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, "
Quoted 4 lines
"error %i (%s)\n", errno,
strerror(errno));
--
2.1.4
Acked-by Anatoly Burakov <[email protected]>
Thomas Monjalon
AppliedQuoted 6 lines
Quoted 4 lines
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 <[email protected]>Acked-by Anatoly Burakov <[email protected]>
Applied, thanks