From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by dpdk.org (Postfix) with ESMTP id 0FA5C3796 for ; Tue, 24 Mar 2015 19:33:19 +0100 (CET) Received: by pdnc3 with SMTP id c3so1555684pdn.0 for ; Tue, 24 Mar 2015 11:33: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:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=a2RVeUWvRZxq2HPbSBkjbPoZsOcZUNrF5t1F6FdBDCU=; b=a98GThxV0JdkFvOKszYl42KrFq9Yi9sadCh/cqsxcFBt0ms3uYN42v0zbeM1xR7yg7 SsEAow3FJjjbwfNbaHBwPWRpuYBuzUDv/OohVal9TvX9+1Y98v4RvdqLn0HhAq0u/3QK GATu3XWOmlGAWnYAy0k4tFWZTfkupzXYWD8yEEI3C04KmyrX/Zi9hUoT9II2f0PLabg7 UwETa8PgEpyrS0yEzqXryTexJvEzfmYcQFAvgM+7nP67nyQKULwbfhS2JFaGJQLENKip lUY9Oa8L5r6ULdwOsrPBsJDxlCa7P6ncVQmfm1GZppVpN8vRG1mvdyXQvC0Q/wO98Wj4 1c1w== X-Gm-Message-State: ALoCoQlp4eV0sKxG+9lPQXSziyrw3lcAnHqLNySl/rIe1lnepXNAje8ZF8uKq6RMEmd7tOqdzwuC X-Received: by 10.68.131.225 with SMTP id op1mr10003426pbb.86.1427221998230; Tue, 24 Mar 2015 11:33:18 -0700 (PDT) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id nj5sm51845pdb.35.2015.03.24.11.33.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 11:33:17 -0700 (PDT) Date: Tue, 24 Mar 2015 11:33:21 -0700 From: Stephen Hemminger To: Tetsuya Mukawa Message-ID: <20150324113321.789c96a1@urahara> In-Reply-To: <1427170717-13879-3-git-send-email-mukawa@igel.co.jp> References: <1426584645-28828-7-git-send-email-mukawa@igel.co.jp> <1427170717-13879-1-git-send-email-mukawa@igel.co.jp> <1427170717-13879-3-git-send-email-mukawa@igel.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 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: Tue, 24 Mar 2015 18:33:19 -0000 On Tue, 24 Mar 2015 13:18:33 +0900 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 | 6 +++++- > 1 file changed, 5 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..f0277be 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c > @@ -459,8 +459,12 @@ 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 */ > + 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 */ For the Qlogic/Broadcom driver it needed the config fd handle, and I added generic config space access functions.