From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0056.outbound.protection.outlook.com [104.47.40.56]) by dpdk.org (Postfix) with ESMTP id 1AC111B21D for ; Wed, 1 Nov 2017 12:06:21 +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=UJc96oITxvm56MpnUNMuy+2c//X0hF71fa/R2Hhk6Yk=; b=OzmLIHYrMrLQeiKfT8c3RV+yotIeL0XjZv4Iw0YFNIX0rsAAn9E6AjkZd7Bgv+odj5ahk4R+EaEz/v3FkRywSQvcwF/mIN0GDrWFoGA4mXKQUFuEneX1ewHoyWR975ErYLmGcPhOEcTkWG7Wd50gHgwhfoGYyI67laupt8lChHg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from [192.168.0.104] (103.76.56.167) by MWHPR07MB3103.namprd07.prod.outlook.com (10.172.95.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Wed, 1 Nov 2017 11:06:16 +0000 To: Thomas Monjalon , Ferruh Yigit , jerin.jacob@caviumnetworks.com Cc: Bruce Richardson , Sergio Gonzalez Monroy , dev@dpdk.org, Jianfeng Tan References: <20171101010726.17781-1-ferruh.yigit@intel.com> <79461063.5rUd41U7jB@xps> From: santosh Message-ID: Date: Wed, 1 Nov 2017 16:36:05 +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: <79461063.5rUd41U7jB@xps> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [103.76.56.167] X-ClientProxiedBy: PN1PR01CA0104.INDPRD01.PROD.OUTLOOK.COM (10.174.144.20) To MWHPR07MB3103.namprd07.prod.outlook.com (10.172.95.9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7af70501-df77-4bb1-fe23-08d5211893c6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603199); SRVR:MWHPR07MB3103; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3103; 3:j8Xhese71rH2VVZ4o3mVfri+LiGpC81vLIWMHU+FASdUOrXNqYucBma7YatyohLZT/hGN3WpospFvH8YxqK+HJW0e8goEluF2ZS/zwLDsTFhC8kEhCyQrh7G5wJ39ub0lCRuOrII+34L4299doPqsh2cfHmZuhDrUX7QiXMhBvEdcOSJAZzVXFDzJ7tIo1OL9ZyKbJinH6ySLRRKmABwYQrSAkjk/bfevrlS5RB0ifEL2Tf63AtHQ7mTmNGW5VGl; 25:LhLcweqKaa+5+RpPssI83lTkhmDzJzbmD0qcKw5kkqutPIB0oUdIk99bdnN5HDOsFGZtxwOBwbYijbrDhBeJryHX2cStc25A+2Il6viGfXC0fRp0nYx0nTTNa4Op4D4I0Z/WD6n7OJIaNGIPp3lLIOXczk9Z3MnbjN6BsSVjnjE/ypZxjqrlJq0Do2K4QQGP+Pls3WFHlsEvXNX0RRlnoT4yAWpp+OZp+QysKJo2qURQoRyLcGFrVFg+I8rwV8qJ5MrKcj6ZVBREwE0oG1Un6JDHj66/WDTLo8LP+f+Y6zJm0z16cH3y+Kuvm1LSz39CK6AVniwOhqYi+sKBn07lWw==; 31:7FEEncO6zcmIH91dAO20qjzlUhM4hWsDxGgo0qVr96axJh//F9qt2u9+eeXGjaN1TM8xrG8XnvX8VXHa4yPBI/LDJjVL43pCGYFYCtgiRUz/Ktriy7/H5eYZb1AdFDrkKhgN9AH13+8fl/DV63pgrtWZv0qgZqZjsqsssBDNDw0NiOClK+eMmMAaxyurHAEkHSQhXfFFZ35ORcoO6EfjM2Y3ede66Lf9HYOVX96vsB8= X-MS-TrafficTypeDiagnostic: MWHPR07MB3103: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3103; 20:Y04eqRa8ToXKi/9AsZ6RdEm8rA9409dc4xSbBu0Ir/9Pu+3fov3Fzt5tH+vVzxko6kPvKsjyCnUMOgs/2leo+6UxNTw/1dwKuBIiVgR+hySwEbV6xwhg30+6579X5fZOLFi5p3gIkU/C6pOA1peTeoAbPon3GxicpTSCdTIxijS1P56hvWEZcGRu17zwLActSZ8K3oFf0HWWZNGsaotTqHIbWsqAjHNtc9g4htvuff7vyP7NJoASX96IkgtaEU7lbwecH8LUXp4OK2o59oL7Xgr1PNhF4dFI0/GjueUH2vvcgwZcfOI5TynHM2epUhnzCXNadvuVPHjh80j8pWX88zjN+Nw2CeYDapoTPJlycNdBM7J1CZTpry7edo69zTuAFiswFlDizMLfUdW3ZQGExCGHWCvb3BtCiR7JtsrO6pkqOre0B4h6KZc71dWnAy7Vre/+WLrG4AC2sRbRP9348t0V2vlkL8mh2pvugSsEVafz1Swl5tMLUUnA41I02wpcjpQ4viNLEfEiCQIlDlZB4BuowD305jXJ1OiuvqOxql/QhswZvy8eMyxnkt1MjUjHmac8MnzKyFYLqknwfBiSPJGIypxWETLxW2GavJWwQSY=; 4:CxPWHJUz/bFEuAKaYNCK1F+heUzSxVG2YZYQRyG6phqKUDnNjbl0kuhWMTP5ycgrWc4oE+wHR3yLSS4tzhNAsnRDtKEEaposQdhSXAuj/rRhpCbVuTLtZi0jOzrbUhvjMPGJi43mUeCsT9ZeARnvlT3ieIk+ZYkVd0VzBxe80tQ2u63p1sUZrj0N49WeINS1M5XdYJtBwbh3220wBBahU4rNcLCkCGzovHxUL4sKUYaFNdVxaJtRbJp+mEj34OO38ZwAHOOz5ANlLf9Sr2teTekoU9L9jOZbSAVGXBHAQ4xlqlEFQGAgJytVLpeiVtis X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3231020)(100000703101)(100105400095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123564025)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR07MB3103; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR07MB3103; X-Forefront-PRVS: 0478C23FE0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6049001)(346002)(376002)(24454002)(189002)(199003)(316002)(54906003)(110136005)(50466002)(65956001)(2906002)(54356999)(97736004)(66066001)(50986999)(5660300001)(86152003)(81166006)(76176999)(106356001)(65826007)(16576012)(6246003)(68736007)(25786009)(58126008)(6666003)(53936002)(2950100002)(230700001)(42882006)(6636002)(83506002)(23676003)(81156014)(105586002)(31696002)(117156002)(229853002)(77096006)(33646002)(6486002)(16526018)(4326008)(189998001)(6116002)(7736002)(47776003)(305945005)(36756003)(65806001)(72206003)(8676002)(478600001)(101416001)(90366009)(31686004)(64126003)(3846002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3103; H:[192.168.0.104]; 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?B?MTtNV0hQUjA3TUIzMTAzOzIzOlE2bGx0L1BWeWd1ODV2MThFLzkzNUtmTExO?= =?utf-8?B?OTNWTGJnUitpMlZOcGVBWWV0WFhaNkt2Q0dDSER1UXIzTTVZTEFVVzBWMytW?= =?utf-8?B?b0Jzd3hKdkpScmFacEZsSjZSdm1MWEZUYU9lcDF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PT0=?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3103; 6:tZMwgl2qO1rY4vgH4lKkoTRmZX319mIq+vWTn+lx7y0CE0Sm6Q56P/kqCbgFeaO1WH5Cl8Mw9msprId0dEt9gdj1E9Mh7R5qA84qvaqsBdb9t+f7LGdr8wgsN7g8BEFRnlzIb54V8vQMbyig2sh0OguBi90nbe7Gd9OXrTJ96xDL6xiDTJRb1WIDpo0wFWjqKd7qGa7vF1sXv5Y5I0hMoYQC52jnFj7AoaPgRdGa/3a6YhXCChwcBi6Oq2KbRe+zTWk3WcSdae5LY5r6Q/viE2QvTAVOroAXqqG1s160wXOmwUlZ1FLBRv21Trp9UL8tMSsXlvToAF8pdsZPeC0g4fObdD9aV5zoaoafvJlRImI=; 5:8QlOsAXY71wwTNmPFOghAtCv2WNF0kid9bbS4J+76SxoIqH/v3r1Mm8CAFk2nqAxiMfGy9AXbX3cwfb2+TvLv6C6vJX7bVAsdo3m5T7oIS/2UQ1GakSjg+IxM72TZLtDjDw3FIqeYe4awJlay6G9K3GkPB5MXp0qFUmKgHNukp8=; 24:fpvZJIQDdARA0vsFx6Xe0LFbEFRanqJOEEmFwCYeSZ3NH/SKwcAs/aC+6MmqS1UWNvX/zuSA9alcj00PS6V6MauMgRF9hGi4gsqYJlS39PM=; 7:KLsyIEcnZE+AW47aTYELMWgfQhDLq/Enb3A8zHcuwGiCL0oQ2oP/XEmhpOOgLBmVeeexKaWKqr/52+YVVDcsQo7rVfJ6TbMoEEQUTdRgakSpxGpjR/stXrdrbjqv2LEoWFYypvpm/nBU+RbMPG9xUFTs+WG6mRrtAugA0H2SVBJBF3Z2BF2OvijFE4Fv/iFpT7psRchMLoeUgrPJjC5teqKVLjejbYyt00oapw+v/4IuI+MbEMSpOXWUBP2cv4hP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2017 11:06:16.4391 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7af70501-df77-4bb1-fe23-08d5211893c6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3103 Subject: Re: [dpdk-dev] [PATCH] eal: disable IOVA mode detection by default 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, 01 Nov 2017 11:06:22 -0000 On Wednesday 01 November 2017 04:01 PM, Thomas Monjalon wrote: > 01/11/2017 02:07, Ferruh Yigit: >> Fix kernel crash with KNI because KNI requires physical addresses. >> >> A config option introduced to disable IOVA mode detection and to set it >> to physical address by default. Disabling config option will enable IOVA >> mode detection. >> >> When there is no intension to use KNI, it is safe to enable detection. >> >> Config option disable IOVA mode detection by default to be sure only who >> is aware of result enable it. >> >> Fixes: 72d013644bd6 ("mem: honor IOVA mode in malloc virt2phy") >> >> Signed-off-by: Ferruh Yigit >> --- >> +#ifdef RTE_EAL_USE_PHYS_IOVA >> + rte_eal_get_configuration()->iova_mode = RTE_IOVA_PA; >> +#else >> /* autodetect the iova mapping mode (default is iova_pa) */ >> rte_eal_get_configuration()->iova_mode = rte_bus_get_iommu_class(); >> +#endif > I don't understand why you are adding a compile-time option. > I think it should be an EAL option --use-phys-addr. > The opposite option may be required to force VA: --use-virt-addr. > And if there is no option given, we fallback to autodetect. > We can improve the autodetect by checking whether rte_kni.ko is loaded. IMO, we could introduce a rule for kni in iova autodetection(/for linux case) such away that: if cat /proc/modules has rte_kni entry then use default iova=pa mode. so +1 to your proposition Thomas. > Opinions?