diff mbox

[dpdk-dev,v4,2/5] eal: Close file descriptor of uio configuration

Message ID 1432014898-3543-3-git-send-email-mukawa@igel.co.jp (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Tetsuya Mukawa May 19, 2015, 5:54 a.m. UTC
When pci_uio_unmap_resource() is called, a file descriptor that is used
for uio configuration should be closed.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Stephen Hemminger May 19, 2015, 4:02 p.m. UTC | #1
On Tue, 19 May 2015 14:54:55 +0900
Tetsuya Mukawa <mukawa@igel.co.jp> 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 <mukawa@igel.co.jp>
> ---
>  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 5d3354d..34316b6 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
> @@ -464,8 +464,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 */

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
diff mbox

Patch

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
index 5d3354d..34316b6 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
@@ -464,8 +464,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 */