Message ID | 3a029ac2-2b6b-b0c2-a577-967b6feba0c9@caviumnetworks.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E46601B396; Thu, 2 Nov 2017 04:59:01 +0100 (CET) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0050.outbound.protection.outlook.com [104.47.32.50]) by dpdk.org (Postfix) with ESMTP id 86BFB1B349 for <dev@dpdk.org>; Thu, 2 Nov 2017 04:58:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=yuUUR/wz/2ljnMxQJokdTFwi92LU0WQ4xtRi+l6nPog=; b=H8W46WbLO7HkneLTclpUlGED3vCGVa9rkFxLnZOZvh02lq9a8+WKxSvFiSeiB8arwLtxAt8BKdMedo02pr+Oxm5Gk7tR0Zj+tvNphcLpIj0897Q12K412hcoD2Qp1nwnRXNOapyu7dXu54nksw0KlcUHdd3WyelIBR4UJixlFuw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [IPv6:2401:4900:1988:5bfe:f07a:915d:ad:cabd] (2401:4900:1988:5bfe:f07a:915d:ad:cabd) by MWHPR07MB3104.namprd07.prod.outlook.com (10.172.95.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Thu, 2 Nov 2017 03:58:53 +0000 To: Ferruh Yigit <ferruh.yigit@intel.com>, Thomas Monjalon <thomas@monjalon.net>, Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com> Cc: dev@dpdk.org, Jianfeng Tan <jianfeng.tan@intel.com>, Jerin Jacob <jerin.jacob@caviumnetworks.com> References: <20171102000600.85309-1-ferruh.yigit@intel.com> From: santosh <santosh.shukla@caviumnetworks.com> Message-ID: <3a029ac2-2b6b-b0c2-a577-967b6feba0c9@caviumnetworks.com> Date: Thu, 2 Nov 2017 09:28:24 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171102000600.85309-1-ferruh.yigit@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [2401:4900:1988:5bfe:f07a:915d:ad:cabd] X-ClientProxiedBy: PN1PR01CA0113.INDPRD01.PROD.OUTLOOK.COM (10.174.144.29) To MWHPR07MB3104.namprd07.prod.outlook.com (10.172.95.10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c952821-e2d3-4c15-41bd-08d521a60aca X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603199); SRVR:MWHPR07MB3104; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3104; 3:w7R02Yf7IuYOA5x0BBqH6W2Nr20DR51r6J8DddjI8jBUEL9Kab9cL4kUE0ztlk4D/405AkA1+XDtkKosrDq59vpJ5y14TlW7x3R50CTZrQ121L5Gy+FM+qzyQz56BXRlspYM7R+pyzbCW8EJBQgSZMO3W13EQmY6aYqrTjM9rH6qdA4fQhKe8dqt2CVr6iIsqyYkA+GrZWmVBbYzUCYy5x+7kOPm6FEoGDosfNyWE8RkHmS/+c/BLlad5qvCyW2O; 25:1M7ysAlBh3X6v1qXex80pAeoaY8STB3xVutmRg23z2M+uUWaJeimz2HMRL9ta+V/31prUvEp47m3prZALuXGleM5jnjnxcVqJg6pddI2RSh2XcJP3f3iaKQgBk4swi8WSQMI37wC0pYaiRawQXZXzUg6vvoihalZhArA/Pvs/AyUBaX+boc25iUqWnARReZWJw2Gjfebuy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g=; 4:HtwMHcuVzEDylpEDjAWi1ogAY7vbP4JF/nKJ/52A0LySu8nV9J3U5QCpyuxT6hc/n9yDQiaOPRQZ4/f0NJrWO+BAyhAIX2hOG/vHYqNB+TMgS6Pj03qlPRmJIqyYegQEmApGEOv9EkEtYc3afRQp69PBJPEqQxcytuCSdL42JfXKUR2Ku1FNFLsoUUCkg9LEp72DE0l3EGeq00PrMGxAxF8+2p/e3YrCKsYhKdyWyLinJ/C5e/Clh2rmxAIxdxyendsM2GZKMygiRsOHY0OAV9BtW5907A5KekTuaL8wX4sSGM82K1yl9gYrYwXdxw31 X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: <MWHPR07MB310438B3F2DB7F47D87925BCEA5C0@MWHPR07MB3104.namprd07.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(3231020)(93006095)(10201501046)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3104; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3104; X-Forefront-PRVS: 047999FF16 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(24454002)(189002)(199003)(229853002)(2906002)(7736002)(316002)(25786009)(305945005)(6246003)(107886003)(4326008)(8676002)(1706002)(53936002)(53376002)(36756003)(54906003)(58126008)(6116002)(110136005)(50466002)(64126003)(97736004)(23676003)(230700001)(101416001)(5660300001)(76176999)(54356999)(65826007)(6666003)(65806001)(72206003)(81166006)(189998001)(478600001)(65956001)(68736007)(81156014)(105586002)(8936002)(86152003)(33646002)(106356001)(6306002)(83506002)(31686004)(31696002)(6486002)(2950100002)(966005)(47776003)(42882006)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3104; H:[IPv6:2401:4900:1988:5bfe:f07a:915d:ad:cabd]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BMWHPR07MB3104=3B23=3A4Bxz?= =?utf-8?q?+evPI9GLAOnDbgEvKzyoY+CL+seBP14QI8VwrTRtQ9prf0CSrP4iTxQo?= =?utf-8?q?b4At5F8uzwwHYQRcW1RiBdmRrnblMIMGOv+cORoYfkFW393cEp7itoA6?= =?utf-8?q?QqcIVrdMRmm/bPLRgm+/QJsAdrn7RBp86AOfBaajnRGHIJyiOCGvxwh+?= =?utf-8?q?jPYN/zQvgH1xpJEnmiadTPeCpeflQTJ43PPXIwMrGR5/tYDL4OmBzZk7?= =?utf-8?q?CXSuTb8X2qp5Ic76lXKALVMYEBRN0WrozkQtQREaA5rFC9gkaJBkuFZx?= =?utf-8?q?niZuS8od22XitWh9eX4f/MB603pNo/8vd1mrc/v51ephcWs1J0Gq8Ylp?= =?utf-8?q?M2wF5WDYh+8ieKsvlffNGDtuhl9oQl9dg1bXeVLX2Q3KEOJ6XX85ztF8?= =?utf-8?q?pF+V/5irD2d/NxtpZjcekk/XSf7embjheeDrC0VOFljc/n5/sRDLMSx9?= =?utf-8?q?M4wFa8/9WbCjTfIYHKoq6FWXGHJiYA9clanmrmHeYtvJiIwGCE0d5c2R?= =?utf-8?q?GqJxtBSIQY49p396G57U0Ir10qP3wdQzTpHWCuSzZ8D2+HcWi8QY9eiC?= =?utf-8?q?zgr70ucnfgbIFSjnVJhOYZXymfm+7tbtKhyK45PPEX1wn//R9fJTAada?= =?utf-8?q?cy5n2uroiWhop+xbWyjFqWX88x/q4wd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fR2Zac7MKtqLfa/tVkdZdimaV+H6ukBTmALb5JKfLS+qvzqpbr6hSnkpyEuH2zA6rrPb3/via4GKjXzaMGmCnr2g7SXaShXFRewD/30zF5Ovp6cn7v66IJ3SlxPBHj/X1cVkmWSqmv2JSuhYo7TrDL0zSpBM0=; 5:c6tt4SZPFLsN1NLtlIIkkRISBdLJe65Gm8VaqZ1z0/t5J7sPt/oCHuDYyf+LaM1KrSS2qGSRvbpOKJ2uuQ0K6QEY3/5vfQ3Ozs0yGQL9YfNJ0bpXQsK0+4QKO+GW0zWO+gtCxiizCve60fBJaurOyjhBCdXGbM5+sOMbI77Nb9A=; 24:qFSMI7y3/LMQcJsLVMdEB45JoTYGhQO3FZFohG/iCVXh1zC8b2IK6cUOtDO3w38nqEeF5vd9hZtclA2cCuQoAIsyUvhjV8FFdqZsPSW5ESQ=; 7:PtFRFVIBB9hORMKeE9R8qtDnYTzHYAoFcntq/ZJh1mCmDikFceSAfH24gU/fSUIg77xpZ+kF4tFHvwWrm6KcLC6s3QT/AfFpAVu+T9aIphFxzf7SjOMAZXHPeq+YGjqewhElsu5kvCrtzPB2fKXwIkzUM2hjGjjDjjZwI4qniOSLXWdML5Nzo29ijttosrH1EZM/fSA3HCBsWoG6qxLFq/8LsenBBXASk86hbatkHq2gLyGuOTNTSuIYa7L+N7C2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2017 03:58:53.8201 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c952821-e2d3-4c15-41bd-08d521a60aca X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3104 Subject: Re: [dpdk-dev] [PATCH] eal: force IOVA PA mode if KNI module inserted X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | warning | coding style issues |
ci/Intel-compilation | success | Compilation OK |
Commit Message
Santosh Shukla
Nov. 2, 2017, 3:58 a.m. UTC
Hi Ferruh, On Thursday 02 November 2017 05:36 AM, Ferruh Yigit wrote: > Fix kernel crash with KNI because KNI requires physical addresses. > > When IOVA VA mode used, memzones and mbufs physical address fields > contain virtual addresses. But KNI relies on these fields to enable > kernel access for buffers. Those fields having virtual address cause > crash in kernel. > > This is a workaround until KNI fixed properly to work with virtual > addresses. > > Fixes: 72d013644bd6 ("mem: honor IOVA mode in malloc virt2phy") > > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> > --- > Cc: Jianfeng Tan <jianfeng.tan@intel.com> > Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com> > Cc: Santosh Shukla <santosh.shukla@caviumnetworks.com> > Cc: Thomas Monjalon <thomas@monjalon.net> > > This patch superseded following one: > http://dpdk.org/dev/patchwork/patch/31071/ > --- > lib/librte_eal/linuxapp/eal/eal.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c > index 017c402ed..29912a4e5 100644 > --- a/lib/librte_eal/linuxapp/eal/eal.c > +++ b/lib/librte_eal/linuxapp/eal/eal.c > @@ -808,6 +808,15 @@ rte_eal_init(int argc, char **argv) > /* autodetect the iova mapping mode (default is iova_pa) */ > rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class(); > > + /* Workaround for KNI which requires physical address to work */ > + if (rte_eal_get_configuration()->iova_mode == RTE_IOVA_VA && > + rte_eal_check_module("rte_kni") == 1) { > + rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA; > + RTE_LOG(WARNING, EAL, > + "Some devices want iova as va but pa will be used because.. " > + "KNI module inserted\n"); > + } > + > if (internal_config.no_hugetlbfs == 0 && > internal_config.process_type != RTE_PROC_SECONDARY && > eal_hugepage_info_init() < 0) { Rather checking for KNI module at linuxapp/eal, I was suggesting to move KNI detection code in bus layer like below: It builds but I haven;t tested, can you please give it a try. Thanks.
Comments
On 11/1/2017 8:58 PM, santosh wrote: > Hi Ferruh, > > > On Thursday 02 November 2017 05:36 AM, Ferruh Yigit wrote: >> Fix kernel crash with KNI because KNI requires physical addresses. >> >> When IOVA VA mode used, memzones and mbufs physical address fields >> contain virtual addresses. But KNI relies on these fields to enable >> kernel access for buffers. Those fields having virtual address cause >> crash in kernel. >> >> This is a workaround until KNI fixed properly to work with virtual >> addresses. >> >> Fixes: 72d013644bd6 ("mem: honor IOVA mode in malloc virt2phy") >> >> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> >> --- >> Cc: Jianfeng Tan <jianfeng.tan@intel.com> >> Cc: Jerin Jacob <jerin.jacob@caviumnetworks.com> >> Cc: Santosh Shukla <santosh.shukla@caviumnetworks.com> >> Cc: Thomas Monjalon <thomas@monjalon.net> >> >> This patch superseded following one: >> http://dpdk.org/dev/patchwork/patch/31071/ >> --- >> lib/librte_eal/linuxapp/eal/eal.c | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c >> index 017c402ed..29912a4e5 100644 >> --- a/lib/librte_eal/linuxapp/eal/eal.c >> +++ b/lib/librte_eal/linuxapp/eal/eal.c >> @@ -808,6 +808,15 @@ rte_eal_init(int argc, char **argv) >> /* autodetect the iova mapping mode (default is iova_pa) */ >> rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class(); >> >> + /* Workaround for KNI which requires physical address to work */ >> + if (rte_eal_get_configuration()->iova_mode == RTE_IOVA_VA && >> + rte_eal_check_module("rte_kni") == 1) { >> + rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA; >> + RTE_LOG(WARNING, EAL, >> + "Some devices want iova as va but pa will be used because.. " >> + "KNI module inserted\n"); >> + } >> + >> if (internal_config.no_hugetlbfs == 0 && >> internal_config.process_type != RTE_PROC_SECONDARY && >> eal_hugepage_info_init() < 0) { > > Rather checking for KNI module at linuxapp/eal, I was suggesting to move > KNI detection code in bus layer like below: I was thinking same at first, but later was not sure about add this check into bus related file, kni module check is so unrelated with pci.c . Also this is not part of a regular process of detecting iova mode, which putting into rte_pci_get_iommu_class() will look like it is. Instead this is a workaround and we are overwriting the result of regular method for this special case, so I think putting this into linux eal.c level after detection is good for stressing the workaround. So lets not spoil the logic in rte_pci_get_iommu_class() with kni module checks. > > diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c > index cdf8106..971586c 100644 > --- a/drivers/bus/pci/linux/pci.c > +++ b/drivers/bus/pci/linux/pci.c > @@ -586,11 +586,13 @@ rte_pci_get_iommu_class(void) > bool is_vfio_noiommu_enabled = true; > bool has_iova_va; > bool is_bound_uio; > + bool has_kni; > > is_bound = pci_one_device_is_bound(); > if (!is_bound) > return RTE_IOVA_DC; > > + has_kni = rte_eal_check_module("rte_kni"); > has_iova_va = pci_one_device_has_iova_va(); > is_bound_uio = pci_one_device_bound_uio(); > #ifdef VFIO_PRESENT > @@ -598,7 +600,7 @@ rte_pci_get_iommu_class(void) > true : false; > #endif > > - if (has_iova_va && !is_bound_uio && !is_vfio_noiommu_enabled) > + if (has_iova_va && !is_bound_uio && !has_kni && !is_vfio_noiommu_enabled) > return RTE_IOVA_VA; > > if (has_iova_va) { > @@ -607,6 +609,9 @@ rte_pci_get_iommu_class(void) > RTE_LOG(WARNING, EAL, "vfio-noiommu mode configured\n"); > if (is_bound_uio) > RTE_LOG(WARNING, EAL, "few device bound to UIO\n"); > + if (has_kni) > + RTE_LOG(WARNING, EAL, "Some devices want iova as va but pa will be used because.." > + "KNI module inserted\n"); > } > > return RTE_IOVA_PA; > It builds but I haven;t tested, can you please give it a try. > > Thanks. >
diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index cdf8106..971586c 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -586,11 +586,13 @@ rte_pci_get_iommu_class(void) bool is_vfio_noiommu_enabled = true; bool has_iova_va; bool is_bound_uio; + bool has_kni; is_bound = pci_one_device_is_bound(); if (!is_bound) return RTE_IOVA_DC; + has_kni = rte_eal_check_module("rte_kni"); has_iova_va = pci_one_device_has_iova_va(); is_bound_uio = pci_one_device_bound_uio(); #ifdef VFIO_PRESENT @@ -598,7 +600,7 @@ rte_pci_get_iommu_class(void) true : false; #endif - if (has_iova_va && !is_bound_uio && !is_vfio_noiommu_enabled) + if (has_iova_va && !is_bound_uio && !has_kni && !is_vfio_noiommu_enabled) return RTE_IOVA_VA; if (has_iova_va) { @@ -607,6 +609,9 @@ rte_pci_get_iommu_class(void) RTE_LOG(WARNING, EAL, "vfio-noiommu mode configured\n"); if (is_bound_uio) RTE_LOG(WARNING, EAL, "few device bound to UIO\n"); + if (has_kni) + RTE_LOG(WARNING, EAL, "Some devices want iova as va but pa will be used because.." + "KNI module inserted\n"); } return RTE_IOVA_PA;