From patchwork Thu Dec 7 10:28:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 120947 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8177115qgn; Thu, 7 Dec 2017 02:29:25 -0800 (PST) X-Google-Smtp-Source: AGs4zMZotAbP5+G+meRodDISLzPKfjZGtKk3Aa5DqcvFyXZIyNpNftroLn2RiTaM9eo/RwgQbjOy X-Received: by 10.223.129.247 with SMTP id 110mr21354887wra.208.1512642565113; Thu, 07 Dec 2017 02:29:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512642565; cv=none; d=google.com; s=arc-20160816; b=TBglZ6o8gZyUiIOtOA/UMKD19sfvXO6AVyEhy/VpWVy9Es+N1dbDBUfzfpHwJMZZrA LvKO591b+FN0ag9SqhVlVHFwO4dpWcHhX3PJoVrDNNS5tqAbHVCpUG+Z6OmAfn5/t+28 pAFbgbHGLf+MM9YVsu9ptq92Oz0QXukdRoPZGIl/3s94USb0PicYfgM2bftR99VCJ7Tk 0RJIjXVIgCnN7izGb37bqaql6Qon396Vb7grAlbHBqAiW/uAfO0ZyIJJw7ijse2qBw4D KMLyaHoK27DRKRx60puO7ATP2pMplyoxpsjvVIJMK2fz2CSIkRS9fMaCNVdSczCaol2r mREw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=IPlxrsF6U0o+L0DUgVWc2IO0wG0O4HgwVIAAdKzh9hE=; b=0eDJBZJXOklqWYJNKhD/eLLmKoQKeGUilFhxm/LIeXTSl/kmAxYq5y0+5HPStUiSxM NzRw7fsrPsWL2ZwhlilxU9SRXUYqbuGudlkYFcpdbwDwm8YlGEJPaY3dITD2hDa4Ph0q zeB9tpKqM4ehXYcO17gP4Uhh/qWYz/TZZcRwV7h7aFB549YugIla2f26ncuOZ1p/U1yN Xdu/hu8qvte7umlpZIX/K2hGckeOUfXZjioi17kMO1FyNC0vP2vytBVN9iPzE0mDT2lm NlBE4cbXd+IyVt83S/5MEaDmhAkcrI3QfjZb6rUcNJNPqB2k77TXBTTzvgw4JczXfsrS KjsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id v106si3905250wrb.513.2017.12.07.02.29.24; Thu, 07 Dec 2017 02:29:25 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8CA147CFD; Thu, 7 Dec 2017 11:29:15 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0051.outbound.protection.outlook.com [104.47.40.51]) by dpdk.org (Postfix) with ESMTP id 742DA2B89 for ; Thu, 7 Dec 2017 11:29:13 +0100 (CET) Received: from BN6PR03CA0084.namprd03.prod.outlook.com (10.164.122.150) by CY1PR03MB2361.namprd03.prod.outlook.com (10.166.207.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 7 Dec 2017 10:29:12 +0000 Received: from BL2FFO11FD012.protection.gbl (2a01:111:f400:7c09::124) by BN6PR03CA0084.outlook.office365.com (2603:10b6:405:6f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Thu, 7 Dec 2017 10:29:11 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD012.mail.protection.outlook.com (10.173.161.18) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.239.4 via Frontend Transport; Thu, 7 Dec 2017 10:29:11 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vB7AT6d9001484; Thu, 7 Dec 2017 03:29:09 -0700 From: Hemant Agrawal To: CC: , Date: Thu, 7 Dec 2017 15:58:13 +0530 Message-ID: <1512642493-14609-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512642493-14609-1-git-send-email-hemant.agrawal@nxp.com> References: <1512642493-14609-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131571161516284138; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(7966004)(39860400002)(376002)(346002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(50466002)(48376002)(2950100002)(2351001)(106466001)(97736004)(85426001)(2906002)(105606002)(4326008)(76176011)(356003)(6916009)(53936002)(316002)(51416003)(86362001)(104016004)(305945005)(47776003)(81156014)(54906003)(8936002)(8656006)(6666003)(33646002)(5660300001)(498600001)(77096006)(68736007)(8676002)(50226002)(16586007)(36756003)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2361; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD012; 1:chrEVn2atM5uAzGz8fE/q1hQPqqmcPkrJYeOSsLSj7gFGQDp7/RX03iDVK27SP8b7akv8Z/ianuvaoV+7eJG/iQmrzzbeqPxoB+EIbdoSpC2+D+fIusT/kfwAzp9wro6 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1bd7abd-3568-408c-b789-08d53d5d5b51 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603286); SRVR:CY1PR03MB2361; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2361; 3:jKun3PWd86OkdQDjay1SfTyn/AAgRISZKAX00rAV9hRO1HVV1F2CKEy7SvpPDRGIFGJ3OoNmwua52WY504YZEpIanT2MxzNwQkLXp/zxVwnUBmSZqybu5ojtQITun0yOMga6jliB07kHis7+8txpI95a28yJSBJ2nEALOrb560mD5tz1mVRU8DPBQzFzMvGoiix5HnjloE+8cRAT+Gr4POlnIRGrH7ZnNNTyNE96Sn6S/Kq1KMNn8ARpHlBx3FUqAUH7VJH/DSkd5f00KXclUMv8P025gk0Kbarg/VR1lBMt44WfRsPWYO2bioYBSN/Cto+PrtmbdsZ4FMwRwTq3S0GxtYoBkt6IJSioaQjr3AU=; 25:KqQAiwSSfb0kggDduugB59ThUVCpkz1BlvMr0JJYoVGzaIIvN5Fsdtr7Z3YujFgmuezrO1yemoa3k+9tfDBaTRVnT0otuvc/oUHUE7iWWIhHqnPGOloV+q+wnlsbuVwBkih1XxMD/Vyj8Yt2FSu61xZBhTbbruLs1+GwmMLHrjhq3wucH/eGmrPpGnRt8CwMwA/sc0iDophgEfV6O16HkwH3d7q9Z7ZBK/3OotTtBro0SlWcPQU2oV/+7LXag/dmIHn3VTBVaZ4l7ZagkkVqzEMRzyYJ8TUkWvxqZDfj+7VwENiaPURVvbcVwFuy7ACCLbq7j52A5Ret+W1YmaeWmg== X-MS-TrafficTypeDiagnostic: CY1PR03MB2361: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2361; 31:M+DbmTY3K5xvAFzIVbkHZLBZleN4AaCiAXfg6jnaHiHhsZctCyocKSBzTC115HavDRQJ/IB53pxFZpEyBzPqfET4u6BS+CpFOBvFdQjkfdBxEEfD342rZBsB+hejXMrKmHuX4YtK91FzAol9qIyTimWTrYIJmAP2UwYiQbJ1nUa4hOogEHnYiIxqTHmWpruVr/eBaTJ74BJNQqz4KY1TvCwnhKSfdASxMaF8DSHljLQ=; 4:rCiFvPiOpCuvedmYZKe9RkjuY++TuIXxoVsgfTtM0hp6J0Pdxpwm40sxmSx27Mr9RgnqScsPAYRkeF4r4+z0kWc+iwPYw0dpMGMWgoG71TVPnSJOxYeeEpbC2N0Ng17J2psVO96aL58FcIrIshR0QgwFR3W+89fd3Pqn5M0XqnNF+QYFLSoHkwIoAmS7kOwfzh27GlClRkBh8od5efAwt9cVXcWAO3/nYbTR8A1zrAyueLITbGtbC0JlFZBsXexKl76QNQvricauUQ/KShxlcHfmDDLuRJNr4cgcguLnWxzp/C7mrkMs8xPV9wZmThjw X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231022)(6055026)(6096035)(20161123556025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123561025)(20161123559100)(20161123565025)(20161123563025)(201708071742011); SRVR:CY1PR03MB2361; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2361; X-Forefront-PRVS: 05143A8241 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2361; 23:B33vp+4MJ/TvqJ2FiYigZTJHBuwdHE8fZVTaFhm/N?= U8uQPpfan5M2gD6otN5R+4FuPwNrMrEM71nMcZW3zrLNcZcVt780ABByPmteI3RppS7oZMVdKmrNQ6a7D8xlwsY0ZTcej9PUoK/EgD7PvynjzzgRgqVMiTPLmLh9vcLwj38ghsKLyY+PPFh/AqwOVMBXsYKaifJue2xpno8LkPffqMMEF/W0H1oLMgKnIVf1nmzmmF8LjIn0SVkV0MfhEr2/9GVixgNz1SKSGGpSWpO0bYwWjqZJv6vU4HG0A+pxLticJRXaEIL6p7Q9Q6ysnReh7EFem6M4K3IiN9I0hWTesHWa0oT0V9Yy0kdlJ5jX8BDci8flN0tVkD6HETuGIV6LkVrGPiiI2nJ5Ui0UE2voDWWyOoF+0OxfwFgWttcSeWy2xcdoJgsoC96gYpUdqBr03Vhgj/wU9TFvRA8FQEaLAisIM0fobQrCXTAb019AGmLwBpAbdN9FwlOekWIierePYy0xVpAlaLOnMzGKHQeBIbnajB1uhtZGCMDBiXgWpxcOj1TL0lSItTrdAzw9deAJCqM1dKuKxQQyWeoZrTT2YWRzAFtn0Bb1ns2LFznN+S6zupXR06OJF9fJ0lEDbxrSB9iSEQQgVqHSTMTLNwjRshXVUQI+OSSB7W+bC4hwRtN3YuVcMqdY9nD4E7NjMUyGgCgcRJb2MoKOrItYWVK+rH5K/E77yQdyG4bYRsx2W1+t+8ECCF5icCaG0MiYaVLcIidav2Wp5j8ZPpfHyqP1frEv5xOfn4+LNitsold0xKqr6TcBc0ITdcXDDqaVTf4w411QeR02o5r/Z+VhIX20F3VN2rGQiZ1r5wXnl2oxKMHUTRt5Tm0vhAGHDlze65H4najfdHkcpWgKSWUKDvhV9jF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ug3Bu762pwyfQXb7X2lPfLs0+8RxLoGghWt3AaN5q/FlbOYpBO8qOHYZ7ip4PdN8IWS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2017 10:29:11.4568 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1bd7abd-3568-408c-b789-08d53d5d5b51 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2361 Subject: [dpdk-dev] [PATCH 02/2] bus/fslmc: clear the vfio group on error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_vfio.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.7.4 diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 7831201..25c87ad 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -660,12 +660,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 */ @@ -680,6 +682,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; } } @@ -690,6 +693,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;