From patchwork Mon Jan 15 05:11:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 124467 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp557052lje; Sun, 14 Jan 2018 21:12:39 -0800 (PST) X-Google-Smtp-Source: ACJfBosGCwK9Sh2RD5TXnLIB+SwYOtWU3XNEdkWBkAwUj1dxBKiVYjhYmwVtheiBY/gBngUG8yZF X-Received: by 10.223.157.20 with SMTP id k20mr425354wre.275.1515993159690; Sun, 14 Jan 2018 21:12:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515993159; cv=none; d=google.com; s=arc-20160816; b=R+Qmn565wnfzIz9e8cZWVS+PcLPhcHbpIaJaimEclEZO+XD2paRN2wZFZN4etSYo4O THR5xdAeIVMRofOTk2zy62kjRB4G13AyJ9Ql01AESDYCGENWg8D0i6rKwR6eoLSjV4P7 dPZ3HBqPnBW22UsAfehswPQD36Tg0CuLa8EsXnmr3xW2oMe4aXMXmu5eq5Ugh2fjQ0sL K/GFjNpCXeeTU+Ae2Va8m4FPb7VFJ6+LNZa3yYINBfGM/PH8RxyuMpc7DYs0Uloxq92d ePpl3LWzMdVVsHrbyq8mKHr0NSwFh0wMp0vxg3OqNFRWqtpw9SN+j9Rrx2rUfAZNP4V5 vn9Q== 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=i7mhhS+YJoZb3A29J0qeVd1HgkqomEJ0W8bOdEQGN9c=; b=H84sik7vsy0A717J6ffgc8mnbZ5STJfg+CowjSB20vkgQ5WoGatzJzccXllKIPT4Hw Ve1u66CFmKtZLUAIe8G7rLRoSKTwislpO0JaUctDziRdkm40lLe7PrqNz+9H0Snf7K4t udMeoMoycmh51+ALRUxjt5SJkP/fIcSTGy7FN806VqSLEYy6Epj4pJrQUxccQMgKi2nR OCO8kO4syN9eOvPIlw1DqTfk9rEiDsYrhl06fsZndWcIMA0GlQ4perWBFqk0WKyAJxgp kD+iX1CMxwtaVa0fuFL50G8w7xX+hgA/xeA1uQhvtbq4T5izczo0fAz0bbsd/1VARILO oFQw== 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 z9si2231224wmb.143.2018.01.14.21.12.39; Sun, 14 Jan 2018 21:12:39 -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 577E131FC; Mon, 15 Jan 2018 06:12:38 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0073.outbound.protection.outlook.com [104.47.36.73]) by dpdk.org (Postfix) with ESMTP id 4F4072BF3 for ; Mon, 15 Jan 2018 06:12:37 +0100 (CET) Received: from BLUPR0301CA0028.namprd03.prod.outlook.com (10.162.113.166) by CY4PR03MB2694.namprd03.prod.outlook.com (10.173.43.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Mon, 15 Jan 2018 05:12:35 +0000 Received: from BN1BFFO11OLC004.protection.gbl (2a01:111:f400:7c10::1:156) by BLUPR0301CA0028.outlook.office365.com (2a01:111:e400:5259::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Mon, 15 Jan 2018 05:12:35 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.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 BN1BFFO11OLC004.mail.protection.outlook.com (10.58.145.15) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Mon, 15 Jan 2018 05:12:35 +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 w0F5CWCj013440; Sun, 14 Jan 2018 22:12:33 -0700 From: Hemant Agrawal To: CC: , Date: Mon, 15 Jan 2018 10:41:25 +0530 Message-ID: <1515993086-22134-1-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: 131604667553826395; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39380400002)(376002)(346002)(39860400002)(2980300002)(1109001)(1110001)(3190300001)(339900001)(199004)(189003)(50466002)(5660300001)(54906003)(59450400001)(316002)(16586007)(51416003)(76176011)(305945005)(106466001)(48376002)(47776003)(356003)(2351001)(77096006)(498600001)(97736004)(85426001)(68736007)(104016004)(2906002)(86362001)(4326008)(53936002)(575784001)(6916009)(105606002)(81156014)(81166006)(8676002)(8936002)(50226002)(2950100002)(6666003)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2694; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC004; 1:ICaqCq0nsMWjXY4aRu25X3j6i3XyVcj1sTZkNjN/YvsXa88RP0zjzMyw3rLgjikaAegeTC11D0hFPzLtT5z9DWNUPR32DFZ/+od9DkDJv20jEd/qUd9Luw5GX/3JP7LL MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 099be65b-3c9d-48b5-465b-08d55bd696cb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:CY4PR03MB2694; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 3:3b586011ElCOC2Bxx8QSIlPZ1vbquet/NPIoG19Db8cQzNUOrEuHEE3931cLEQm4DufDRRssfch+40JM8+d+t9HZLVPtTM6DcWaifC8+O5nnJUIftjLmYFu6hONiTlxdgDFhxa/R4SfdLacDNzaup/zDpbClPD/R5jLHBlkYVFva5ARMGWd4Zxdf6d2XQkFEbmv0BTrlZcHrJYV4y6rrkL7tzjpNegMBbVcBr6jzPB7Nbv0T4s0yTDIR5xRxOfa9WCAs0sk+4+yL8PmDXwEZEweJddgtgeyStJBoA/Jqs7FeJPS6WJ27STp3Ni9b2Oe8tKSV3Mh5fjEhDpJjXrW7t/yQzDN0gbK1t09wcPineZY=; 25:qasgbT7AWtXqg76RcZ8++YA90TSXM0s1W2/jBnk94/IULWi3cyoYMRa/oMkqsbTx8VksSlS4GR9/poR/ITAoeK77Zf+qS3kaIAHsjgnp0sRzLOj0Sp2TMvFv1XJ77ZrxUVnquDPZhka4WPdMcRyeh5msIAzXpC/kcGWAKc/bLw9LDLLj8LP+ETIZK7iGPYi87V2dMpNga4HkxKzjHJKpxVhAg329lnqePq3moMSL0n1z2O14qMvRC5hEixXrOKgIWbuZJmAg/qkRMNPYbEc4M5xRTVz5EAQB2R5nJPFFx4zf3SZzIUxRs9D9CKvQrIpQnMw004tumw/P9VNDaKuRvA== X-MS-TrafficTypeDiagnostic: CY4PR03MB2694: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 31:KHxlKE0ZixjrqQKcfV3+Nz/y0lnd7kpJ1lkmHoDO9j5Zo1f00psUGmAafv/+yrDYh2s+dMy6OnTr6BpDvKOzRXglgjvDlRdTZKyl4zjL+dd/yxsUG3rv6U2o0I8Kh/XwsV+RK67TMtCzjAF9Xw6gyXH+hZXvptqJxxq00GDwCkro763jLp00dh/f15vH6HvotI7WDBgfLl5jOTOG6y0f/lQRFlKj74qIXzjCgzrNfoM=; 4:AzwzyF3jFmgxadTfdW4XdoTcqYwsBPA1BAR04GJU+Yb7Vbv4CE+tN+qTqgQ9/9/23o385F5dLkurojLvuLGX3q3atplxhsPywDGhOgLzsD/P7XKf0EjoEe3FaEsGcga/q6i5xPgctXGY3uvSp0WgSUVfO/B60gEytmp/+rQec4VsmYFsXAr4iYNkG1sgrmHsLaXdYUASFEcXKLi4+swjYoniUY8KCLkyNdHWuNRSnJUOPFg2jlZ0Ub6z/mv5GMqG4JgJW7mbFZFETVlCegyWXVltiJG9dc8cuPwC1Bc5uNeA9rK6CE0JrCV8tFJ8os6GXBl9WNEd1KciOqEPbp3gQyJhywyy6FPgwzeyiAcEZMQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(3231023)(944501161)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(20161123561025)(20161123556025)(20161123559100)(20161123565025)(201708071742011); SRVR:CY4PR03MB2694; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY4PR03MB2694; X-Forefront-PRVS: 0553CBB77A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2694; 23:HUPBOa6iCauqB8bc+TI33Bt9+McgWQhVm5qe1WzRP?= dLNStUeq9nRhGxUOYuwGGQzs6XADvf98Ysqsq0YjnzH6ceMHQm3oxF55xH7PbL9w1cAUSSBHtfN5+YpOjZwDBUMRS8caGTIZsUB5FcM/KV1o19E5sB2+A+RTfkkw8bK/wG//utVxjqqQxFk7QvZ9IE4eOUgvePM/a2N/4AKfB+ZDdFUmlfnbAsnad42/Bj7V6bYxfR1CRWAcxBdMjN04aAMdc6DpkR8QrRh201uYU4/S28aT1mqN9hrwVEjjB/BTvkxmi9Tl+wCS7jRewJlh59RXlMrXhkp5SDPscJnm3bWPXsllO9PHiB0Oz6SH8HNmJum3zO44icWYxXrFtDPVK///mewGVLpkjdV2nQP7QiBDtWapru8sMLLNT3b1oS6NhMV9g3CiLhQUNoHL0ZLOK01fyQTzZ/afDAjF1ksceU+RRlZ64UEpPX3tEkGWJuOH0KDpLEoIeNTeaD3Lt2uQPNGw4Prfk0aIr9YB05IgVCJdxEQTKaWLyRmWwsyjk+Zn1+YEewQrStji7IO+JinRj+pZu+AO+Uh6CouL7IlqN00Sn+uOv7tFELMD+DoIxM9xep/ri9yi8cFBr7I+OKXwbmRXsZcMcTtfP4xRu0QRp5/utzoolzQ8RaYobNCz0/LxazU9zDSToZsPNlgxmEaFKc41y2ifiS3d6oCHVeT7LRoPHe9eC2gtmWwCZNyPky/HfwGXmrDpg/woz8UBQQbHWEEADKYIiRvAE6b9LrNp6jD9H7I81eGuBHjP8u4erjZGnhqMTTbGRI3Grhi1+I6uRMizK3CKrLnLD35B+nL1kbBU6kCdf8m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O+PDpF+BUr1epItKNlOGjOSgni9SjsMmrGtd9YL47fN8SS3EUY2tuWHiM7w0j2sEM7vOXAeESbujGJG/Y5HCCej7CEyTWH/pEttNZxrKDlXNC06O5sX+sEbsXS58YCYW8lmGOhhMQYD5zOo6+SevQi3IVZSX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2018 05:12:35.2110 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 099be65b-3c9d-48b5-465b-08d55bd696cb 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: CY4PR03MB2694 Subject: [dpdk-dev] [PATCH v2 1/2] vfio: expose clear group function for internal usages 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" other vfio based module e.g. fslmc will also need to use the clear_group call. So, exposing it and renaming it to *rte_vfio_clear_group* Signed-off-by: Hemant Agrawal Acked-by: Anatoly Burakov --- lib/librte_eal/bsdapp/eal/eal.c | 5 +++++ lib/librte_eal/common/include/rte_vfio.h | 4 ++++ lib/librte_eal/linuxapp/eal/eal_vfio.c | 18 +++++++++--------- lib/librte_eal/linuxapp/eal/eal_vfio.h | 4 ---- lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c | 2 +- lib/librte_eal/rte_eal_version.map | 1 + 6 files changed, 20 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 369a682..7239243 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -778,3 +778,8 @@ int rte_vfio_noiommu_is_enabled(void) { return 0; } + +int rte_vfio_clear_group(int vfio_group_fd) +{ + return 0; +} diff --git a/lib/librte_eal/common/include/rte_vfio.h b/lib/librte_eal/common/include/rte_vfio.h index a69c4ff..daa0dbd 100644 --- a/lib/librte_eal/common/include/rte_vfio.h +++ b/lib/librte_eal/common/include/rte_vfio.h @@ -148,6 +148,10 @@ int rte_vfio_is_enabled(const char *modname); */ int rte_vfio_noiommu_is_enabled(void); +/* remove group fd from internal VFIO group fd array */ +int +rte_vfio_clear_group(int vfio_group_fd); + #endif /* VFIO_PRESENT */ #endif /* _RTE_VFIO_H_ */ diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 681eab5..5371ec2 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -197,7 +197,7 @@ vfio_group_device_count(int vfio_group_fd) } int -clear_group(int vfio_group_fd) +rte_vfio_clear_group(int vfio_group_fd) { int i; int socket_fd, ret; @@ -300,12 +300,12 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, RTE_LOG(ERR, EAL, " %s cannot get group status, " "error %i (%s)\n", dev_addr, errno, strerror(errno)); close(vfio_group_fd); - clear_group(vfio_group_fd); + rte_vfio_clear_group(vfio_group_fd); return -1; } else if (!(group_status.flags & VFIO_GROUP_FLAGS_VIABLE)) { RTE_LOG(ERR, EAL, " %s VFIO group is not viable!\n", dev_addr); close(vfio_group_fd); - clear_group(vfio_group_fd); + rte_vfio_clear_group(vfio_group_fd); return -1; } @@ -319,7 +319,7 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, RTE_LOG(ERR, EAL, " %s cannot add VFIO group to container, " "error %i (%s)\n", dev_addr, errno, strerror(errno)); close(vfio_group_fd); - clear_group(vfio_group_fd); + rte_vfio_clear_group(vfio_group_fd); return -1; } @@ -341,7 +341,7 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, " %s failed to select IOMMU type\n", dev_addr); close(vfio_group_fd); - clear_group(vfio_group_fd); + rte_vfio_clear_group(vfio_group_fd); return -1; } ret = t->dma_map_func(vfio_cfg.vfio_container_fd); @@ -350,7 +350,7 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, " %s DMA remapping failed, error %i (%s)\n", dev_addr, errno, strerror(errno)); close(vfio_group_fd); - clear_group(vfio_group_fd); + rte_vfio_clear_group(vfio_group_fd); return -1; } } @@ -366,7 +366,7 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, RTE_LOG(WARNING, EAL, "Getting a vfio_dev_fd for %s failed\n", dev_addr); close(vfio_group_fd); - clear_group(vfio_group_fd); + rte_vfio_clear_group(vfio_group_fd); return -1; } @@ -378,7 +378,7 @@ rte_vfio_setup_device(const char *sysfs_base, const char *dev_addr, strerror(errno)); close(*vfio_dev_fd); close(vfio_group_fd); - clear_group(vfio_group_fd); + rte_vfio_clear_group(vfio_group_fd); return -1; } vfio_group_device_get(vfio_group_fd); @@ -438,7 +438,7 @@ rte_vfio_release_device(const char *sysfs_base, const char *dev_addr, return -1; } - if (clear_group(vfio_group_fd) < 0) { + if (rte_vfio_clear_group(vfio_group_fd) < 0) { RTE_LOG(INFO, EAL, "Error when clearing group for %s\n", dev_addr); return -1; diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.h b/lib/librte_eal/linuxapp/eal/eal_vfio.h index b34d5d0..359589e 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.h +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h @@ -148,10 +148,6 @@ vfio_get_group_no(const char *sysfs_base, int vfio_get_group_fd(int iommu_group_no); -/* remove group fd from internal VFIO group fd array */ -int -clear_group(int vfio_group_fd); - int vfio_mp_sync_setup(void); #define SOCKET_REQ_CONTAINER 0x100 diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c b/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c index 9b474dc..7cc3c15 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c @@ -304,7 +304,7 @@ vfio_mp_sync_thread(void __rte_unused * arg) continue; } - ret = clear_group(vfio_data); + ret = rte_vfio_clear_group(vfio_data); if (ret < 0) vfio_mp_sync_send_request(conn_sock, SOCKET_NO_FD); diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 3fa1e13..7088b72 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -205,6 +205,7 @@ DPDK_18.02 { rte_hypervisor_get; rte_hypervisor_get_name; + rte_vfio_clear_group; } DPDK_17.11; From patchwork Mon Jan 15 05:11:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 124468 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp557073lje; Sun, 14 Jan 2018 21:12:46 -0800 (PST) X-Google-Smtp-Source: ACJfBovCh5NvImOkYC3p6uLBHidrq8bqZUY1oZwbU/gSGuqJL8hGLxC8ug3od/300gyHZZD9J5Pt X-Received: by 10.223.162.138 with SMTP id s10mr28231144wra.239.1515993166453; Sun, 14 Jan 2018 21:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515993166; cv=none; d=google.com; s=arc-20160816; b=bNyptwEFjAo0FYzSrhzDu7N5FLTxBGelaoOfL4lf+Vo4j52HUsYkAk+3pIiqmQqZbe n6hNsUz7JmV0Sp+8B9TtdI4xoJqzOxpt08vCu+4VIrlJjZjZtTnC7KA9rYyNiVPKLlQ4 eidys1hNqAplLP6jB5n0xzXch/HvTKzCSb7u7y/KqLtze2Ij4YN4ZmJo+3h0N+iCTeDy SCd7HN7w3vN9vsnukB8A026FDBotYdzQ7z27w/XNX9ndJ2YmcK3j1g3NPSdfnpk8poT+ 5suPnPPccEbo4BNEIBojB1PYmVZtoHos2eM8pZ1D2lJG6irpkwG5OMPeKESHg6MRQBYs D0/g== 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=2m3vKP2PDQE4lnvi8yF5pC6/kLZJ5qWWCgEYndoE1FQ=; b=X1/uaZNufMbw1XhpBHCCsYq0J71FwXFl0uTFI8jmjv4vQof1dwCVGz2e/y6ItXfH1h x1Q4gCKyo8gTLgT1D5KXscfwp3wQGxLRXoUPRmimGMFvP2RsPSqhT7VMZvanl5rWcMEe yfnUeidNZsOidAfimFZlGaK3RtpYA+OvWrM9n4v7rOn2SMecQ1UNUKYBDcR+VZ7HXJfD AKMz70OSN40EcZQw0R7jkJ2RD39Ax4JFADHpvI3O6j9eqwB4vl8q0HnPQHIWcvzHRYww k9NL86fNwDwtgbEwlmRzFKIt/m5vWzMn39Dpufw4xZFszeQotd/6cIlWNQcXtZWep94k 4tRg== 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 u65si5792746wmd.233.2018.01.14.21.12.46; Sun, 14 Jan 2018 21:12:46 -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 A4F4371B3; Mon, 15 Jan 2018 06:12:41 +0100 (CET) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0042.outbound.protection.outlook.com [104.47.34.42]) by dpdk.org (Postfix) with ESMTP id C2E1F71B3 for ; Mon, 15 Jan 2018 06:12:39 +0100 (CET) Received: from CY1PR03CA0026.namprd03.prod.outlook.com (10.174.128.36) by MWHPR03MB2702.namprd03.prod.outlook.com (10.168.207.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Mon, 15 Jan 2018 05:12:38 +0000 Received: from BL2FFO11FD032.protection.gbl (2a01:111:f400:7c09::190) by CY1PR03CA0026.outlook.office365.com (2603:10b6:600::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Mon, 15 Jan 2018 05:12:37 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.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 BL2FFO11FD032.mail.protection.outlook.com (10.173.160.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Mon, 15 Jan 2018 05:12:36 +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 w0F5CWCk013440; Sun, 14 Jan 2018 22:12:35 -0700 From: Hemant Agrawal To: CC: , Date: Mon, 15 Jan 2018 10:41:26 +0530 Message-ID: <1515993086-22134-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515993086-22134-1-git-send-email-hemant.agrawal@nxp.com> References: <1512642493-14609-1-git-send-email-hemant.agrawal@nxp.com> <1515993086-22134-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131604667571148373; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(39380400002)(346002)(2980300002)(1109001)(1110001)(3190300001)(339900001)(189003)(199004)(104016004)(76176011)(2950100002)(106466001)(498600001)(2351001)(36756003)(51416003)(50226002)(81166006)(6666003)(356003)(81156014)(8676002)(2906002)(6916009)(105606002)(86362001)(305945005)(85426001)(5660300001)(8936002)(77096006)(97736004)(316002)(54906003)(53936002)(68736007)(47776003)(16586007)(4326008)(50466002)(48376002)(59450400001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2702; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD032; 1:Ib0ERIcoc59bjDq14RQ1oAunUNtFOy8MUEiIy1ibtKJpv8gB95q2X8FS5LKOyMP+jq2CHk6yoDAh/T63AELpBfTWxxOPEnEGl2F59lihfBULgiPPsLOizsHNozDO0NwZ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 850ff77f-4f84-4dc1-9655-08d55bd697d3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:MWHPR03MB2702; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 3:57nAAtzTROvfjStHBRFFHBaGKFRXhYjzG+tGwxvp8ASlkRTbmYn3wiylcZfzNvW3z9uudVadRRnH3BssXK0HLSqhnrZcLjpE4sfziOJptjHKj6Imr+NmZFRP2ZZukzbDJuObF2Uk1jK9x8jbbumPrMvmZyuyoU7inWyu5CzTl1va+UUzJ4ALGYvla0hqXxN+ehhDzIPqXQVBHLJ935LpYWadMF2YoY8LNBBKmdP/qBxYIwbQ1zubXIh5XCzdVoJIW+6nkN4YxqbgRhpXZB4gV0fn2hfWKu2lkxhMxgMxULweSam34Ld/r7lVfoVrRNyOZ2eTGMqdfgO2ClCHbfq+LDpSXGlwuMn5UtyrAwekXcY=; 25:SLGbjG/1hIGoKx4bMefAer6b+dl3NcsteXfbuXwosGnPrbTUwoHbc9PA6RZ2ZWBRP/hq6jlrbR5QxWqy6JBHHiGEabsjr6EAdyJ9LcGhQkWrzlb0IRtyVrwMxJos2hUvsVE1vmhiEDnoKgw8XqIHn2qxJzPIB7YCz/0r/tmjj7WXjFRLng4SXz8fwYfx7CoJ2rePrToImft+fIktp01wczj03fZkgcyLPWiYBa3Uj0lJVMmINilq0TU6NfSzoN/yzhbusNOTBykpk+biJ1nIkxITIMNbhTFxZEC04JICL6FzS6wcHl9GM8XVSnhDXiyBcjNxqbRlTq3gTzu7AXa6bA== X-MS-TrafficTypeDiagnostic: MWHPR03MB2702: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 31:EMDP9dycFORTHPw6e95mDKo5d3i2QNHvpqTFqx9ub0rPIZR6CJGZr5PN0BemyCoeUX4cDicRS5d1HnTPjUTrepegry7EnUYvct3bwnJbLyjWdK4E1xfI54ycbL0z7LlEWXknQ+PCfe6pe+7L/vaqvBOve7s1dYsg+faCYrqFSrWmvvJsb0oRfipjtt6vqj7mxmMJYj/dc+lGBk+q1FNgKJvkP3oo52b4vLFodoacIEA=; 4:gaKwrDy0V5jcTdDxxKj1oCh8dBkXsKdypsRfGUshfScrtl7yYiZskTywiJjr2OGxA4B8iuU8bEVCYEptNyeH130b3JeaPwCXpYZOmMyYQgWHosDtokjpoGl70OaRrKWMWJD9kjtulUTPnw1gmz563jE5cH/BoKD5IvxnIZakiG0Q8R+6M35+YblszglsIMjl0yzai+vjXqdMmUuRK5LF3eXJx683d9JBKNIHeSPtiFu0l8+6NcKwE4NAEmO+EFCWqoDMX1KlAsjMwFkeLJSTZ0djGxkAcVxds0oiw7ZICGS8uLhGSd+37uQIjhRSf5vM 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)(10201501046)(3231023)(944501161)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123556025)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(20161123559100)(20161123563025)(20161123561025)(20161123565025)(201708071742011); SRVR:MWHPR03MB2702; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2702; X-Forefront-PRVS: 0553CBB77A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2702; 23:b2MN6wF/99U8qpeUk+oycJjChAUxBGLhgkTejo4dt?= gOjRnR6WqIKFiRkIr0+jlW1Bh4otMgh6ZXN9CQwfSvFj12tI7CaFVhUtyVNb/9/6lJve4SbnFf3klSrJzPixBqoae/hMzN0EjbQABIs86I6CGWwIHlIMwh4jEqm9gE7c4B10W67H7OxbmXpNSiuSlJUblbEC3/K2HVaCkII039dDIkFj6mG+eNStn2K7wgyPr7yicDQ2x0+A5b6ZS5GI1IbQPakXl2kqn20ak5pR6GzEr94NRru7GUAkvoWJzKKfwVd+xdyA8FwMHzdVzTmaqhcrfi4nbOfGMt9WooSAN9CF7+eR1GDD+IKx0cYtE8HROfmK0Q/RVvoT79PdVNMDGNT+nxUhe1nCwFof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gjoUJyS/rEs85LiwntSbZ4RjlgOXzqQDs=; 5:h8z3KyUdDhSWspzHmF80eO6R+DacVEmjtOix8TNlLBXKcEYVoQl2NErWU3zcccPfcXJ9c+vl+Tv3lDusdvJVnLH64dQ1K1oX4P6wxT5xFOteiQOCDbisrWo+LnXZhagXkLPi7grPVacPrFbJ3dg070feiv9ynn98IFgLYO7hxWA=; 24:ngPn7hRLzqFEIVoVpfeuvdi+s3IHzDVnVOITjPcdg8MOJnRIubWjxFl6dxraieqmYT2XF/V3KJomo60ZN/UTaG9YfUduC/cD2kO6gjdz0NA=; 7:05pbtFk+DhuVzeSpDhrblBi17FLjNCLLUdOfJUzOEtTcEKtPA+np7cI/9U1tUc6r3pZ/bRdY53iabdGY8wvVkWAvCqWPWvK7RNnnb6/5U1lsHHHbhdSb6s2kEeHiPq43BGdX+4FLNW/0/ftn1g0cUw4Jxkl/L9hOEg50QZqIgEUjNFvXm8y8PRrSrraINRL6+678+ptVInDc3I6m2vzL1JPtZyIw8OVI5xuPvH2W/AN1TAZ93Apc6TuyRwFk0P5s SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2018 05:12:36.9588 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 850ff77f-4f84-4dc1-9655-08d55bd697d3 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: MWHPR03MB2702 Subject: [dpdk-dev] [PATCH v2 2/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 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;