From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0057.outbound.protection.outlook.com [104.47.37.57]) by dpdk.org (Postfix) with ESMTP id 3EA5229CA for ; Thu, 7 Dec 2017 11:29:13 +0100 (CET) Received: from BN6PR03CA0017.namprd03.prod.outlook.com (10.168.230.155) by BN6PR03MB2691.namprd03.prod.outlook.com (10.173.144.10) 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:11 +0000 Received: from BL2FFO11OLC011.protection.gbl (2a01:111:f400:7c09::164) by BN6PR03CA0017.outlook.office365.com (2603:10b6:404:23::27) 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 BL2FFO11OLC011.mail.protection.outlook.com (10.173.160.157) 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:15 +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 vB7AT6d8001484; Thu, 7 Dec 2017 03:29:07 -0700 From: Hemant Agrawal To: CC: , Date: Thu, 7 Dec 2017 15:58:12 +0530 Message-ID: <1512642493-14609-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131571161561453627; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(336005)(376002)(346002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(50466002)(86362001)(97736004)(36756003)(8676002)(105606002)(81166006)(81156014)(33646002)(356003)(305945005)(51416003)(85426001)(6666003)(48376002)(5660300001)(8656006)(498600001)(6916009)(16586007)(2906002)(316002)(4326008)(47776003)(104016004)(53936002)(8936002)(54906003)(106466001)(50226002)(68736007)(77096006)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2691; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC011; 1:fmwU+Y1QoG+KYM0nzF18ESBXzUrT3ZkW9gZrzTDNVu0SBChiC3ngbv1+AU9AIdGH0h3y5rVIaOjmWZsAnTjwt+m5s9JaMLi7K2qJ6sH5PLWbWCrZR7MhJkksJZMTSU+u MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c301e85-290c-4603-543b-08d53d5d5e05 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603286); SRVR:BN6PR03MB2691; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2691; 3:hc56jX+9/t3QbHewPB3wzYeMAz9OVAZCC8WhZkOd06HPq4ssPeqvHWQXvjAO4D72CLo1S3ZLdOmBy6VaS2PUYQ0WVMk75cTinlRVxg6R3Olasd7PqEn59B5WZE3Sep/8iuoHZyWhtU8SQPSTAt2wbmvdxfJtuPcfiMVAPtgqkwaYPeO4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GD5wt8gb5CjRua7+LWIWIQJP4IVfbMkehZTvAqut6yumNN5wKERxTbcX/wNpLHIeef/0K5ZXjpZ9clzGwx X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231022)(6055026)(6096035)(20161123561025)(20161123563025)(20161123556025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123559100)(20161123565025)(201708071742011); SRVR:BN6PR03MB2691; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2691; X-Forefront-PRVS: 05143A8241 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2691; 23:0o3BRFjVz2OfZHd0H5Gx5WTBbGJBha5CKK0IWcfyr?= =?us-ascii?Q?3GGdfTuymFltCfPh2WJp4Bmi09CLOUSJNMuBpfqDn8BpB2F/+TmZWkMq5dU9?= =?us-ascii?Q?0sZTy2JkdRAG9KsGn+jOroZfagApVqR1gbMWjbPf5EmyZpjKAlwZr4elEMES?= =?us-ascii?Q?YW2Q4UeoDn7qUd2vnB4vVZxPPGGxU9O+u09slWvTiR6v6xGzXkksTHFRnUBz?= =?us-ascii?Q?icAXswUlKaB5esNx/Hy3EC6F7GsB8zCKpeK1nc4o80PVbBfE5IJY9f9ueDBp?= =?us-ascii?Q?jaJYz3EP3LHgO/I/CHX7A4mxfa7yf/GAa7OFZnS0p2C4dE4X+bXlVWSrpQct?= =?us-ascii?Q?b37l1p7eQ1vcZX/J2nM0+pz1w+76gf8ClLaRV0ujMo2lUEauxMAsbViui+/K?= =?us-ascii?Q?4UyshegD7dI21SZ9ikLlwy3PT9Y39gWJ9eC/gc02B1/yA3o8Rpzj43uyZ0Oy?= =?us-ascii?Q?bGvAlgPxO6REM21USYawVUe2+FhWbTQTGpdnX2Qdh1yYrvWMxr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VHQfKRULJ8DXM4SVJfHgRbxc3YVbT3l1KmeFZ8Mr9U=; 5:zhdGqH+YoErzetpQLS65mPyTkiUqrVaQsn29CTqOO+zZKDXWDVjAOXLCb8FOlu8JhV1h0Ps0r3kjghzI0liSGFXv/sj+W+B+XZ8dVxW/HiYJQn/9gjKs9GydOAd1gfMakMC7cryRXrbi7MtGdPqyLS47O5Xgsn5z8sm2XyPEo0U=; 24:kIwEjAi1gbL+0j1WSzdXpQDqKjFDT4pa0QqQuYw7eyl5yGDgGKA3WZTmmO/PzzIT/oJjGBaFr+RW2H3zENQZSBBp1Zv/SKqF0z8illhE5Do=; 7:UuEOvZ7N7rhaBNpqa3P3563A+FchmkRsSRfFF4saLwPzA5kOwQw+GPG+cBSbyXBumR7fPO2xFVO1/rtYzET9vEXGfqbkqKkpcuaLYhEu2JGBVRCvaFxHc7NBj2iF9DJwEz7sKKdIGUBPq9k8x96tFKj56B/HqNgztyUlhM0beZJjAgPbHp1ZRXwdfXZMVIxvgRlUvAgltmO/FY0Vb12GoeUIN2u0UmxEdDKdvqOL4g5C1DOCv88l1CGI2NRuyOpt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2017 10:29:15.1313 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c301e85-290c-4603-543b-08d53d5d5e05 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: BN6PR03MB2691 Subject: [dpdk-dev] [PATCH 01/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: , X-List-Received-Date: Thu, 07 Dec 2017 10:29:13 -0000 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 --- lib/librte_eal/linuxapp/eal/eal_vfio.c | 18 +++++++++--------- lib/librte_eal/linuxapp/eal/eal_vfio.h | 2 +- lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c | 2 +- lib/librte_eal/rte_eal_version.map | 7 +++++++ 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index 58f0123..76184d1 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -226,7 +226,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; @@ -329,12 +329,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; } @@ -348,7 +348,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; } @@ -370,7 +370,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); @@ -379,7 +379,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; } } @@ -395,7 +395,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; } @@ -407,7 +407,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); @@ -467,7 +467,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 ba7892b..12e38cc 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.h +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h @@ -179,7 +179,7 @@ vfio_get_group_fd(int iommu_group_no); /* remove group fd from internal VFIO group fd array */ int -clear_group(int vfio_group_fd); +rte_vfio_clear_group(int vfio_group_fd); int vfio_mp_sync_setup(void); 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 b53ed7e..e32f2e3 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c @@ -333,7 +333,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 f4f46c1..5af887b 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -236,3 +236,10 @@ EXPERIMENTAL { rte_service_start_with_defaults; } DPDK_17.11; + +DPDK_18.02 { + global: + + rte_vfio_clear_group; + +} DPDK_17.11; \ No newline at end of file -- 2.7.4