DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <anatoly.burakov@intel.com>
Subject: [dpdk-dev] [PATCH v2 2/2] bus/fslmc: clear the vfio group on error
Date: Mon, 15 Jan 2018 10:41:26 +0530	[thread overview]
Message-ID: <1515993086-22134-2-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1515993086-22134-1-git-send-email-hemant.agrawal@nxp.com>

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/fslmc/fslmc_vfio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c
index fb2f403..12b254a 100644
--- a/drivers/bus/fslmc/fslmc_vfio.c
+++ b/drivers/bus/fslmc/fslmc_vfio.c
@@ -634,12 +634,14 @@ fslmc_vfio_setup_group(void)
 	if (ret) {
 		FSLMC_VFIO_LOG(ERR, "VFIO error getting group status");
 		close(vfio_group.fd);
+		rte_vfio_clear_group(vfio_group.fd);
 		return ret;
 	}
 
 	if (!(status.flags & VFIO_GROUP_FLAGS_VIABLE)) {
 		FSLMC_VFIO_LOG(ERR, "VFIO group not viable");
 		close(vfio_group.fd);
+		rte_vfio_clear_group(vfio_group.fd);
 		return -EPERM;
 	}
 	/* Since Group is VIABLE, Store the groupid */
@@ -654,6 +656,7 @@ fslmc_vfio_setup_group(void)
 				"Error connecting container with groupid %d",
 				groupid);
 			close(vfio_group.fd);
+			rte_vfio_clear_group(vfio_group.fd);
 			return ret;
 		}
 	}
@@ -664,6 +667,7 @@ fslmc_vfio_setup_group(void)
 		FSLMC_VFIO_LOG(ERR, "Error getting device %s fd from group %d",
 			       g_container, vfio_group.groupid);
 		close(vfio_group.fd);
+		rte_vfio_clear_group(vfio_group.fd);
 		return ret;
 	}
 	container_device_fd = ret;
-- 
2.7.4

  reply	other threads:[~2018-01-15  5:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07 10:28 [dpdk-dev] [PATCH 01/2] vfio: expose clear group function for internal usages Hemant Agrawal
2017-12-07 10:28 ` [dpdk-dev] [PATCH 02/2] bus/fslmc: clear the vfio group on error Hemant Agrawal
2018-01-12 15:27 ` [dpdk-dev] [PATCH 01/2] vfio: expose clear group function for internal usages Burakov, Anatoly
2018-01-12 16:36 ` Thomas Monjalon
2018-01-14 13:05   ` Hemant Agrawal
2018-01-15  5:11 ` [dpdk-dev] [PATCH v2 1/2] " Hemant Agrawal
2018-01-15  5:11   ` Hemant Agrawal [this message]
2018-01-16 23:43   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515993086-22134-2-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).