From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0052.outbound.protection.outlook.com [104.47.40.52]) by dpdk.org (Postfix) with ESMTP id 1011B1B1BE for ; Wed, 11 Oct 2017 08:42:57 +0200 (CEST) Received: from BN6PR03CA0024.namprd03.prod.outlook.com (10.168.230.162) by DM5PR03MB2700.namprd03.prod.outlook.com (10.168.197.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 11 Oct 2017 06:42:56 +0000 Received: from BN1AFFO11FD019.protection.gbl (2a01:111:f400:7c10::137) by BN6PR03CA0024.outlook.office365.com (2603:10b6:404:23::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Wed, 11 Oct 2017 06:42:56 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD019.mail.protection.outlook.com (10.58.52.79) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Wed, 11 Oct 2017 06:42:55 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v9B6gqfH031131; Tue, 10 Oct 2017 23:42:53 -0700 From: Hemant Agrawal To: , CC: Date: Wed, 11 Oct 2017 12:12:18 +0530 Message-ID: <1507704138-17237-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507375221-16271-1-git-send-email-hemant.agrawal@nxp.com> References: <1507375221-16271-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131521777762393067; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(376002)(346002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(53936002)(106466001)(47776003)(105606002)(16586007)(97736004)(110136005)(5003940100001)(76176999)(356003)(68736007)(50986999)(85426001)(81156014)(48376002)(8936002)(33646002)(8676002)(305945005)(50466002)(50226002)(104016004)(81166006)(4326008)(2906002)(6666003)(189998001)(69596002)(498600001)(86362001)(77096006)(575784001)(316002)(2950100002)(5660300001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2700; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD019; 1:ZK4i0oRFof2c9ptIDMO2OudC4Qgtl8lV68fiB+d9s7RyHTHOZTe28vg6o7VabHfdtoEs/DTVqhfCOcXmUbb5BCIQsuffvZOJs6NBCbLXnSqubfywBwFx9c+3IauEnUOa MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40682635-d2a4-4d86-50e3-08d510734e25 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:DM5PR03MB2700; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2700; 3:rm7kQ2bfNHkpV4OSRFoonOts6fkPz33p8+h/XVu45COV6OC7BFNDQ9clN7vdqVJZMHF9U0Kki3XIpc0f6xD1z6nV9zCBer8aE5GIKX5TT7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yzHzx7qqMq6b8ZYFXTTxA6NT9TGp1iKuKINcQhauo5RpEev1ZbdjR7Y5QkXiM1bleMg6z6y3UTZxcvhe/vuRL7s1T2p+kg26KykD4DzOpLvzu+dRRr0ggWJX0gkEdnO89fE7IuE= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6096035)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123563025)(20161123556025)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB2700; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB2700; X-Forefront-PRVS: 0457F11EAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2700; 23:hZPb6g3kQdg3NdD1nfwwh/v40ZLscGQRl6xIr9Ipf?= =?us-ascii?Q?8VKhwTWFcI14wsjy/rcLKHT+CJ4wIFRB4u+bMAc9liLAYTdPkSkMQNcgfvC8?= =?us-ascii?Q?IAbMUgfkU0zvksjn9I+GR2ey8JMro5rNIPDDpYIl8BudtAlaU8bEZquOHttx?= =?us-ascii?Q?VRVdChUA5cjCLDUTw04hTUJlIceJzuBc7EhRL3ZlyJbuFNM65oOVPpSutusY?= =?us-ascii?Q?2Eg4xxDBdcwS6GbLS1MUGPIc+T6kuB5XemRaIk6nqIK3ML3EaKOzVuG9AaWU?= =?us-ascii?Q?V1zDpLByAvGd9sp4hLprVutTmKYOyQlSP67pSH74cyllEe8Zjp22LSrFvFze?= =?us-ascii?Q?EvShnAyAZX2X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z4QIdHbhWR/f3FOeLIFO1dyE1LKyFy1eEcOSZmIBBK5GCODHssrCbXEoevEcRCPeM5YuqUL9LJHc3oIrkCY4JcXv25I+7B1c4bFHoYnNPKYqs9BSuK3m528cLZ2G0I/+gLYp48ldC4w6RaG6Y8Yf+9NBz2p/u/mlgNOCu790Wj/cMCN6nyRSB3EBorbgfj8qu6cxepHUZLavXePmeFbCnigoeAQKPN/UafCqVA3f3/X4Au1AwhKgTx07Ve54nGMshjPNFi2v2GJr+mK2N16mdo+4tbIg==; 5:5WRr3WW6ZrEY/YgVp+IBg8A/xhk0ApLVxBrp75ZVxxyUW29sDlMTuXOaWuIOaZL9i6kcdgTVW54c8cRksGhSmfCxEfJRmLy9CTV4LUYBAlnKwhmW0oSUv3JJJCMigsf0aii182vqFUwu41a7fI/6hVbI6dGmjVBR1169JD6TosY=; 24:3Lw81D2YH2ftQb0dVcrIO6edl3kgca0jhmeY50987fioEUbjkYHOqZZAlQPuX/nJuHgln8XXLiVYeqqmeTmjI2wZVmTB/akTXdJKbZ7rSok=; 7:/6CrKOMhf3ZcspBwXTfpHTSvZNMXnkbo8WIJfu3OFKuifUHQCf5wvcHeJigI0coqZ8M0MhUfJClYdRYLhISi3NIGNnznZfbgEkSJxbL4ai0ThYhRPPbfBZoY73CVpdgI9WSSaX7whW90gENDov07I5mi2bHW8LgQ+burX8s3BFCPl6SibKl5TbpkaoNLYD0ACkAvVLMYbmHmcNPGitdK5tJuVDjbzsebwopiZrxosRI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2017 06:42:55.8961 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2700 Subject: [dpdk-dev] [PATCH v3] eal: enable vfio independent of PCI bus 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: Wed, 11 Oct 2017 06:42:58 -0000 VFIO may be used by buses other than PCI. This patch enables the VFIO on the basis of vfio root presence. Since vfio_enable should be called only once, pci_vfio_enable is also removed. A debug print is added in case vfio_pci module is not present. Signed-off-by: Hemant Agrawal --- v3: changed the vfio enable for vfio root instead of pci v2: enabled VFIO, independent of no-pci flag as suggested by Thomas removed fslmc specific vfio enable lib/librte_eal/linuxapp/eal/eal.c | 8 ++++++-- lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 6 ------ lib/librte_eal/linuxapp/eal/eal_vfio.c | 2 +- lib/librte_eal/linuxapp/eal/eal_vfio.h | 1 - 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index ec37c52..e0aceba 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -710,9 +710,13 @@ static int rte_eal_vfio_setup(void) { int vfio_enabled = 0; + if (vfio_enable("vfio")) + return -1; + vfio_enabled = vfio_is_enabled("vfio"); + if (!internal_config.no_pci) { - pci_vfio_enable(); - vfio_enabled |= pci_vfio_is_enabled(); + if (!pci_vfio_is_enabled()) + RTE_LOG(DEBUG, EAL, "vfio pci modules not loaded\n"); } if (vfio_enabled) { diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c index aa9d96e..fc84705 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c @@ -661,12 +661,6 @@ pci_vfio_ioport_unmap(struct rte_pci_ioport *p) } int -pci_vfio_enable(void) -{ - return vfio_enable("vfio_pci"); -} - -int pci_vfio_is_enabled(void) { return vfio_is_enabled("vfio_pci"); diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.c b/lib/librte_eal/linuxapp/eal/eal_vfio.c index b32cd09..ebb71f0 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.c +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.c @@ -489,7 +489,7 @@ vfio_enable(const char *modname) /* inform the user that we are probing for VFIO */ RTE_LOG(INFO, EAL, "Probing VFIO support...\n"); - /* check if vfio-pci module is loaded */ + /* check if vfio module is loaded */ vfio_available = rte_eal_check_module(modname); /* return error directly */ diff --git a/lib/librte_eal/linuxapp/eal/eal_vfio.h b/lib/librte_eal/linuxapp/eal/eal_vfio.h index 26ea8e1..4bab363 100644 --- a/lib/librte_eal/linuxapp/eal/eal_vfio.h +++ b/lib/librte_eal/linuxapp/eal/eal_vfio.h @@ -207,7 +207,6 @@ int vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd); int vfio_enable(const char *modname); int vfio_is_enabled(const char *modname); -int pci_vfio_enable(void); int pci_vfio_is_enabled(void); int vfio_mp_sync_setup(void); -- 2.7.4