From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0064.outbound.protection.outlook.com [104.47.37.64]) by dpdk.org (Postfix) with ESMTP id 131181B299 for ; Wed, 1 Nov 2017 09:27:10 +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=ycV7fplxnZQG4op+TKRu5Gls4SOWETWmmfWtvJ3Ahtw=; b=kT5hRZs6tspxLLFIkaOqYkyjdnL6642phs+/YH8vfmE6Mg7gH78aRlm58n6qpCnENQ1nC1FymbZ+oaPnvGJrgRo5VDggV0WI5cK0dO26S/Oj2gdVkaH/h8vRWN+TiTL0/hLO4zqlKGvrLCFd7p/yqOUH5OAnxVrowLF6eSt0Dus= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (106.201.40.78) by BN3PR07MB2515.namprd07.prod.outlook.com (10.167.4.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Wed, 1 Nov 2017 08:27:04 +0000 Date: Wed, 1 Nov 2017 13:56:44 +0530 From: Jerin Jacob To: "Tan, Jianfeng" Cc: Ferruh Yigit , Thomas Monjalon , Bruce Richardson , Sergio Gonzalez Monroy , dev@dpdk.org, Santosh Shukla Message-ID: <20171101082642.GA30967@jerin> References: <20171101010726.17781-1-ferruh.yigit@intel.com> <20171101040251.GA13569@jerin> <80719d01-7859-e6ac-ee1e-964a04357098@intel.com> <20171101065431.GA25152@jerin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [106.201.40.78] X-ClientProxiedBy: PN1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.144.33) To BN3PR07MB2515.namprd07.prod.outlook.com (10.167.4.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d2d3b40-f905-46bf-e3b1-08d5210256f1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(2017052603199); SRVR:BN3PR07MB2515; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2515; 3:HfixLjfUC+StmpHfZYOA7i3S2zWm8ooN39Y5PvhINF+iJmfzOY3AzFKB/NqkXd8pjVkA01CCaHi3LnVRIY3kXigf8KHx1RcUiwOpAlKHIwXQG4/PHTFzhpluxQovQk15RvUQiSHnj27aDCXefQrfaypkKgI2c99BpX1BSjKRy6GelaItxCXddRDF+l7mFhYQzDQ5oMiX7zbSpSYDVL4sNTzNmD2+Ib8URi9PIaeBv1KP0L+B03hfbn9eZYo8GB8g; 25:T4v1QYN2eTooBbE+F6+GLy9mKM8G77hP+Ps2bVFI9P0GgtCS0HiWDXrgHhO+4CLhvV/EptPctICei9LOmA2HCRUqfOago4ppQjrRXAXGpEye1StkGqhPuTxh1xrpfgmFtBSWyVAJmtlEYp+xvD59YQpskRS2niWQbVMB2ZxNYUuBCLQ+Pl0JLpyr0QnmBS4Cz6e5Xa6rKMg4xPzvkPxaasiawQghIkH9tpkUcG9I5y5s++2f00O+FD3qCkU/EjYv6NIAEH5HHKs+UD9V5CKwf63ClQwbcs+lM8NOUC+LjuMhW3CiWwzHaEzqzLJuh7Az5Juf54geOSQ6NnQiloGpCg==; 31:yd9cRf19gUClRxyTJKk0Zy9a52vGm7jQgvJ2K6ahed+6bNBYQK0to8s0micBuHZ1gj0C93HAHZWZbTZEuyGvYLft7DbwYaVLRsZIFB/X0gtfqJ6ag7uVpONt785KC6TYZq9LjI77TZR3MXNSxrlo/ULrYfNgi+10A4YVFhZzczsID8IdGOfTCNvRwIcs3lVIka026NAjeyz2y9dyfGGBGtn3tQBeeaZtK1rw5e4DE2w= X-MS-TrafficTypeDiagnostic: BN3PR07MB2515: X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2515; 20:NKS1p3tuM3DOuf+TL4bv/XKakBiMAJAeoozWvX8/TlPaWdXT7ZPGzRiOycnhCHzVMXrbUAsKmq/v/3dUT1mrCZKNnpinaU5YFCuAF10He3YHu7OdEU8GtLSdtvVWGRbnDpyF13Y9XOkeNDyQuc40nuogRhHGLVF6uufzoeMi6X+3TMVXJI/hjl8ix81fhFUtwlgIWxeL+bd2Umy4/Rn41fiRyu38DvemMZG+KvFbzT6q9WE8+CUbHuY2uf++XCQYx1irGkRdXqfIZXBtIFDUTPBqT2h/8w9009ShiTEaGWxQnWHo1oqZIeiWt+AphFzShpNqTiCFdf37bmzHnR9BdAoDXULm4/3x2c8d4/DqhfhvH4aoSmm0aiUcdppGdhm4skaNsZDO9yJZ77COtAzxPun6otylDK+0v+3paFdBapDlu1wiUoFO0p5LZ33xfEDs0FBNQg0JJzkR/faSV+O2dSTjLvRYCfYkE3pC17ytYklgFaFDoUDlMOVb6WRsOYp/dDIQynQR0an0zdv1pQYgj3e/f1plijmoChnazEsvZtRDdUz9rtJAXTp4ptuEaaG7hRKxBe9SVu8fH0ha3z57YAvwPRS3LEmDe4NIV8Zk3zc= X-Exchange-Antispam-Report-Test: UriScan:(190756311086443)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3231020)(100000703101)(100105400095)(10201501046)(93006095)(3002001)(6041248)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR07MB2515; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR07MB2515; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2515; 4:G3m891U42/LIaYGlR5pwHv1VOwrnbzV39D0Sa2rMzChhJCv3toU2I+o4tcpNbWLC3K3qp0617/u9iU28JkzafNDNAOnmbC1BWXCVJmenjOog10gcMpfe5+HBct+fNa1M5jnDNdf7+fPLJp+nxNyc5/MQlOUlVgfTiP19cgv3fRiHfI3S1D7OaUHZqxhsCy8K//VSWJYLZ8GYD4GN6l2riCMs0GclLSzm+tP/g/v+aXkiOG923HXGI7cWrnSGQK0IhOFn7uRhaTQ5exyzu8PXyTiiDok38aecfJr+7CbrykWGINzxrclA5rWR2Rb3VoIbkJiQMpgxs/8v6yJ/M+5Llg== X-Forefront-PRVS: 0478C23FE0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(24454002)(189002)(13464003)(6916009)(42882006)(25786009)(4326008)(2950100002)(23726003)(107886003)(53376002)(6246003)(6496005)(8936002)(8676002)(81156014)(81166006)(68736007)(2906002)(3846002)(6116002)(93886005)(53546010)(9686003)(16586007)(55016002)(54906003)(58126008)(1076002)(6306002)(97736004)(53936002)(316002)(33716001)(1720100001)(478600001)(47776003)(66066001)(54356999)(76176999)(5009440100003)(50986999)(229853002)(101416001)(50466002)(33656002)(966005)(106356001)(105586002)(72206003)(83506002)(5660300001)(6666003)(189998001)(16526018)(305945005)(7736002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR07MB2515; H:jerin; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR07MB2515; 23:WLtfkrhnZXqyvSG0f08drEK23B7pkSJZN88KtsX+x?= =?us-ascii?Q?k843jI+RrWQO9ftfhfRkWoDcAsQn1XEfQ1vbMPtBI0MPDGjSVQA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R4TEAwPj+Aq/ACqVXcpDQDsVSKA7hvPo02dGMpIAFDBJiPg6pbrLsfXdoZt90cs4AUnkAlpXch0mDO+QmHTURHSsgXklQHHB7c=; 24:uJYGAgLy7vlPsyfcFxwdel7dYPKh8WMzRpQo7U44GS7+uyz/Ongtst+3uWxsauEF/5a9/hwuanS3tdzW+40k7/efyesTm1FIKog8BOguURQ=; 7:qNPZSlLH9erDD6leRDnGf6YzeKlLgQl48EjDNhhBojutus7K/2ZBgnK5O7nXhVP2RctUr8xFw70wVurdLjru6bSBT9pyr2AK4Q/Tql18kBxMZ5YuJpSEKQSoINVMqoq+uOgNTPcDk0UQcFxifgTUEFpmplZ3Bm6zIXkWTXKKFtCjK08pAvlnp7rq2aLWfR2eBK8/5fIHYvkEUgn7+DGg7J/RspcLpFqMdDHo1Q/o8yzXDNRoFVrkziD1WARBaoDD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2017 08:27:04.0450 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d2d3b40-f905-46bf-e3b1-08d5210256f1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2515 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 08:27:11 -0000 -----Original Message----- > Date: Wed, 1 Nov 2017 15:39:01 +0800 > From: "Tan, Jianfeng" > To: Jerin Jacob , Ferruh Yigit > > CC: Thomas Monjalon , Bruce Richardson > , Sergio Gonzalez Monroy > , dev@dpdk.org, Santosh Shukla > > Subject: Re: [dpdk-dev] [PATCH] eal: disable IOVA mode detection by default > User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 > Thunderbird/45.8.0 > > > > On 11/1/2017 2:54 PM, Jerin Jacob wrote: > > -----Original Message----- > > > Date: Tue, 31 Oct 2017 23:21:18 -0700 > > > From: Ferruh Yigit > > > To: Jerin Jacob > > > CC: Thomas Monjalon , Bruce Richardson > > > , Sergio Gonzalez Monroy > > > , dev@dpdk.org, Jianfeng Tan > > > , Santosh Shukla > > > > > > Subject: Re: [dpdk-dev] [PATCH] eal: disable IOVA mode detection by default > > > User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 > > > Thunderbird/52.4.0 > > > > > > On 10/31/2017 9:02 PM, Jerin Jacob wrote: > > > > -----Original Message----- > > > > > Date: Wed, 1 Nov 2017 01:07:26 +0000 > > > > > From: Ferruh Yigit > > > > > To: Thomas Monjalon , Bruce Richardson > > > > > , Sergio Gonzalez Monroy > > > > > > > > > > CC: dev@dpdk.org, Ferruh Yigit , Jianfeng Tan > > > > > , Santosh Shukla > > > > > > > > > > Subject: [dpdk-dev] [PATCH] eal: disable IOVA mode detection by default > > > > > X-Mailer: git-send-email 2.13.6 > > > > > > > > > > Fix kernel crash with KNI because KNI requires physical addresses. > > > > The actual fix would be to make KNI IOMMU aware based on the DPDK mode. > > > > > > > > ie. On slow path, > > > > > > > > /* Get iommu domain for iova to physical addr conversion */ > > > > if (rte_eal_iova_mode() == RTE_IOVA_VA) > > > > kni->iommu_domain = iommu_get_domain_for_dev(dev); > > > > else > > > > kni->iommu_domain = NULL; > > > > > > > > On fast path, > > > > > > > > static inline u64 kni_iova_to_phys(struct ... *kni, dma_addr_t dma_addr) > > > > { > > > > /* Translation is installed only when IOMMU is present */ > > > > if (kni->iommu_domain) > > > > return iommu_iova_to_phys(kni->iommu_domain, dma_addr); > > > > return dma_addr; > > > > } > > > > > > > > > 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 > > > > > --- > > > > > Cc: Jianfeng Tan > > > > > Cc: Santosh Shukla > > > > > Cc: Thomas Monjalon > > > > > --- > > > > > config/common_base | 5 +++++ > > > > > lib/librte_eal/bsdapp/eal/eal.c | 4 ++++ > > > > > lib/librte_eal/linuxapp/eal/eal.c | 4 ++++ > > > > > 3 files changed, 13 insertions(+) > > > > > > > > > > diff --git a/config/common_base b/config/common_base > > > > > index 82ee75456..903e7685b 100644 > > > > > --- a/config/common_base > > > > > +++ b/config/common_base > > > > > @@ -107,6 +107,11 @@ CONFIG_RTE_MALLOC_DEBUG=n > > > > > CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n > > > > > # > > > > > +# Disabling PHYS_IOVA may crash kernel for KNI, use with caution > > > > > +# > > > > > +CONFIG_RTE_EAL_USE_PHYS_IOVA=y > > > > Defeat the purpose of all dynamic probing scheme. > > > > Either we can fix the KNI or revert the following patch for this release. > > > > > > > > http://dpdk.org/commit/f37dfab2 > > > This commit just enables IOVA VA mode for Intel drivers, that is how I can able > > > to observe the issue, but it is not the source of the problem. Reverting that > > > commit will not solve KNI crash with any other PMD that enables IOVA VA mode. > > I don't understand why a PMD needs to enable IOVA_VA if it can support IOVA_PA. > > IMO, IOVA_VA should be enabled only for those device it can WORK ONLY on > > IOVA_VA mode. > > IOVA_VA is also necessary if we don't want/have root privilege to run DPDK > app. OK. > > > Forget about KNI, If we set CONFIG_RTE_EAL_USE_PHYS_IOVA > > as y then the normal stuff wont work for if PMD can operate only in > > IOVA_VA mode(like octeontx). > > Yes, agreed. > > > Regarding the KNI crash, it can be avoid by first checking the exiting > > mode(rte_eal_iova_mode()). i.e since legacy driver like KNI need real > > physical address to work "now", it can grace full exit on the init time if > > mode == IOVA_VA; > > For the KNI crash, do we really need to correct the case: make those PMDs > (requires IOVA_VA) also work well with KNI? > - If no, we just need to report RTE_PCI_DRV_IOVA_AS_VA smartly. > - If yes, we shall make KNI work with VA. I would say "yes". But for this immediate release, I would say "no". > > Thanks, > Jianfeng >