From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by dpdk.org (Postfix) with ESMTP id D8DC55A13 for ; Wed, 18 Mar 2015 16:19:18 +0100 (CET) Received: by oigv203 with SMTP id v203so38970573oig.3 for ; Wed, 18 Mar 2015 08:19:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Rx4woU+BTIAC6d6qiDaUuA6e2oYJu9YxnyMYB3G9fiw=; b=PYqC8vKW7Fiwnlla7CY6Oc6cMs2DObW3lk3KEBYiTb4oh0wlPAIghScJxnO8/euQQZ MFyoupVz1DYeiQghb3kAx7ZUhdTgBWT0uOzpyoyJ29pR7+iUqEUgm/Xwr7MWwDWJudcU htJA0wBuFbfj6ldR0vvUn/o5FXpFounPleCNEF4CZHnFNNVTZyy6bVkSDc9J6ztqrabh e/E6dJa/EF8cxLi/PfvLw89k1j/QKKeiLDsBIAEHCiMfIgG0Jr1tPfA9odIDB0r8lirV RYHxiYOs6YIMmluC4ybZZikaYKZfJo8CpjkSxT+7t5/wQin++xqsQG/1eMzzIhzTul+x fz4g== X-Gm-Message-State: ALoCoQmPBK6az3tnmxY62PomA3lT+3ODmkOcPOstjz2VPSIan7i/UjnsOeSrnWNa8jSI2TH0mpk+ MIME-Version: 1.0 X-Received: by 10.202.108.84 with SMTP id h81mr14558150oic.90.1426691958381; Wed, 18 Mar 2015 08:19:18 -0700 (PDT) Received: by 10.76.34.35 with HTTP; Wed, 18 Mar 2015 08:19:18 -0700 (PDT) In-Reply-To: <1426584645-28828-3-git-send-email-mukawa@igel.co.jp> References: <1426155474-1596-4-git-send-email-mukawa@igel.co.jp> <1426584645-28828-1-git-send-email-mukawa@igel.co.jp> <1426584645-28828-3-git-send-email-mukawa@igel.co.jp> Date: Wed, 18 Mar 2015 16:19:18 +0100 Message-ID: From: David Marchand To: Tetsuya Mukawa Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 2/6] eal: Close file descriptor of uio configuration 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: , X-List-Received-Date: Wed, 18 Mar 2015 15:19:19 -0000 On Tue, Mar 17, 2015 at 10:30 AM, Tetsuya Mukawa wrote: > When pci_uio_unmap_resource() is called, a file descriptor that is used > for uio configuration should be closed. > > Signed-off-by: Tetsuya Mukawa > --- > lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > index 9cdf24f..b971ec9 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > @@ -459,8 +459,14 @@ pci_uio_unmap_resource(struct rte_pci_device *dev) > > /* close fd if in primary process */ > close(dev->intr_handle.fd); > - > dev->intr_handle.fd = -1; > + > + /* close cfg_fd if in primary process */ + if (dev->intr_handle.uio_cfg_fd >= 0) { > + close(dev->intr_handle.uio_cfg_fd); > + dev->intr_handle.uio_cfg_fd = -1; > + } > + > dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN; > } > #endif /* RTE_LIBRTE_EAL_HOTPLUG */ > Hum, why check for < 0 value ? There is no such check for intr_handle.fd and I can see no reason why we should behave differently. -- David Marchand