From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 988CE58EF for ; Fri, 20 Mar 2015 02:54:36 +0100 (CET) Received: by padcy3 with SMTP id cy3so92913778pad.3 for ; Thu, 19 Mar 2015 18:54:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=MykRhjH33iCV+VdIX3GhWxhrRBq1ohqnQ9Y55auDQ3I=; b=Cm+rBUV1jvuvXX7Haj/Cedi2zYHf5D/Bebi9rq65e1aCLxl29QHNXBYuKlVKb43QAq QTOFtP3OlL2BLwgD0khsYGbFEGWRcXX6r7MAuBN7NGb+xKlJRXljhPQ6TFEqgMRYk5xz vWWIAVOW8z2l2Rc3Hi0S7M0li2FGdjDNDiOS11XB57KLzPxPq8UiR80mj4uqkgkIOPZZ 2on0Nqg3p2fIq/lKCYMh/uQ/54k4knqTREJNOpi3kceU+Xxdrvxk/r2SeH1vdl8trY0A gl0qoQIKDw+L+a9w1ry9q8C7X52lA4bO5c9ijISbF2FLqElllo/L++wrIPzm8Qdzcno8 D8ZA== X-Gm-Message-State: ALoCoQlIhHzux1Mf+hjwJBOQpEoKRrlY5+29CwPkbCH0dxnCOIzntjWjTkSamlQzOphU47+iluL7 X-Received: by 10.70.95.137 with SMTP id dk9mr70799135pdb.20.1426816475914; Thu, 19 Mar 2015 18:54:35 -0700 (PDT) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id l2sm5066136pdb.81.2015.03.19.18.54.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 18:54:35 -0700 (PDT) Message-ID: <550B7DDD.8020100@igel.co.jp> Date: Fri, 20 Mar 2015 10:54:37 +0900 From: Tetsuya Mukawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "Iremonger, Bernard" , "dev@dpdk.org" 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> <8CEF83825BEC744B83065625E567D7C2049F3B56@IRSMSX108.ger.corp.intel.com> In-Reply-To: <8CEF83825BEC744B83065625E567D7C2049F3B56@IRSMSX108.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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: Fri, 20 Mar 2015 01:54:37 -0000 On 2015/03/20 1:04, Iremonger, Bernard wrote: >> -----Original Message----- >> From: Tetsuya Mukawa [mailto:mukawa@igel.co.jp] >> Sent: Tuesday, March 17, 2015 9:31 AM >> To: dev@dpdk.org >> Cc: Iremonger, Bernard; Richardson, Bruce; Tetsuya Mukawa >> Subject: [PATCH 2/6] eal: Close file descriptor of uio configuration >> >> When pci_uio_unmap_resource() is called, a file descriptor that is use= d 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_ea= l/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 */ > Hi Tetsuya, > > Should there be a check for the primary process before closing both of = the these files? Hi Bernard, Yes, the check is done like below. (But it doesn't appear in this patch.) void pci_uio_unmap_resource(struct rte_pci_device *dev) { struct mapped_pci_resource *uio_res; struct mapped_pci_res_list *uio_res_list =3D RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list); if (dev =3D=3D NULL) return; /* find an entry for the device */ uio_res =3D pci_uio_find_resource(dev); if (uio_res =3D=3D NULL) return; /* secondary processes - just free maps */ if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) return pci_uio_unmap(uio_res); TAILQ_REMOVE(uio_res_list, uio_res, next); (snip) /* close fd if in primary process */ close(dev->intr_handle.fd); dev->intr_handle.fd =3D -1; (snip) } Regards, Tetsuya > Regards, > > Bernard. > >> close(dev->intr_handle.fd); >> - >> dev->intr_handle.fd =3D -1; >> + >> + /* close cfg_fd if in primary process */ >> + if (dev->intr_handle.uio_cfg_fd >=3D 0) { >> + close(dev->intr_handle.uio_cfg_fd); >> + dev->intr_handle.uio_cfg_fd =3D -1; >> + } >> + >> dev->intr_handle.type =3D RTE_INTR_HANDLE_UNKNOWN; } #endif /* >> RTE_LIBRTE_EAL_HOTPLUG */ >> -- >> 1.9.1