From patchwork Wed Apr 29 15:15:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 4505 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 0A65DC8DC; Wed, 29 Apr 2015 17:15:51 +0200 (CEST) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by dpdk.org (Postfix) with ESMTP id 147E8C8D0 for ; Wed, 29 Apr 2015 17:15:49 +0200 (CEST) Received: by pdea3 with SMTP id a3so30952431pde.3 for ; Wed, 29 Apr 2015 08:15:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WttZ9r1xxSJsyty0+by5Q9m9CzLOufV/jSsyGAzzXf4=; b=WqRWawAobMlQtlYVJQsdoLRFSHZ22OEaLMlzNsENSVmAC4rgFImndCwDBpGgg1/tUw phgOF/UanOtICTUt0sPWqb71HBEqsDtv2P4+xi6CTd0PtQIFbqkqx4a5m8Ys5tX7boyW pc6sgD0/Jqee+XBkvBO1eaETKQnuyb3T8rzOwr/fT3/Cew+HFE0K1IgVsI0cTJDWJkRY clZ5S8bMh21j1k8TuSU3/xVAd5XSnVAndnaRu2qISMAwDoeZN/d2nZ4qSrIfEvFEC9e5 spJlP0ZifSgXN2hELMvOsunQoStgcrvg4sxDXf4haqWNEF3pj5z+HkYrs/fA8ACqSBE1 qhjQ== X-Gm-Message-State: ALoCoQnOvDCaqsbNZ4I4LEJJEGDJ5p9+i6dRkQWOJZhwOdPKSBUAoLFjuB6aVCE7nOsabXXTTFol X-Received: by 10.66.250.106 with SMTP id zb10mr42958218pac.36.1430320548279; Wed, 29 Apr 2015 08:15:48 -0700 (PDT) Received: from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id sm7sm25944047pac.45.2015.04.29.08.15.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Apr 2015 08:15:47 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Date: Wed, 29 Apr 2015 08:15:45 -0700 Message-Id: <1430320545-16638-1-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] vfio: eventfd should be non-block and not inherited X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 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 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));