From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0051.outbound.protection.outlook.com [104.47.33.51]) by dpdk.org (Postfix) with ESMTP id D6B7B3250 for ; Fri, 2 Jun 2017 06:25:05 +0200 (CEST) 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=6vLhSHfv/GWtcnSO3zfWs8vzVSLTbiel9g8MGhsaHgo=; b=e9Pmeyg3O1gV5NGDfwztQoTIbwU/8bnv7o4DRHmtjOmiO2+/C39RAmenuJLlcH/p87tsQ5/PpEeJN/Xo+OWIJ2SaBY9eR4/L7+NgHVkBYsUY4cjqPF75e7/8OZ0xyCRUpwNk/7TwWYiUgK01Y2tY6LoUoQL/GXeH2dWzmQcwuOE= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from [192.168.0.105] (103.76.56.167) by CY4PR07MB3093.namprd07.prod.outlook.com (10.172.115.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Fri, 2 Jun 2017 04:25:02 +0000 To: thomas@monjalon.net, dev@dpdk.org References: <20170524161101.22863-1-santosh.shukla@caviumnetworks.com> Cc: jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com From: santosh Message-ID: <79f1e8ae-d2cc-e49e-a17d-73c7185b26f8@caviumnetworks.com> Date: Fri, 2 Jun 2017 09:54:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170524161101.22863-1-santosh.shukla@caviumnetworks.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [103.76.56.167] X-ClientProxiedBy: BMXPR01CA0011.INDPRD01.PROD.OUTLOOK.COM (10.174.214.149) To CY4PR07MB3093.namprd07.prod.outlook.com (10.172.115.7) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR07MB3093: X-MS-Office365-Filtering-Correlation-Id: 27302705-db41-4327-1cf8-08d4a96f5787 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY4PR07MB3093; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3093; 3:7RSToRk6lq8IHcowD8OURQPQZc/6UPdbR/XeBDlmdAL5JWg2q4eU8PvZN2Yz1MkAhJfnJf/3n14Ct6hk3Zs8dbeZceHzqX0XNV7qT9YjE5zOF6RfTuyx/fhQS5KtPahzmAKU4/IkS/e9YA8/SgOFRdChmmvOIBdHj2vPdjduN5gvb9HuqFnUXzrf5Ge0q8gZ5CgOFLB5BmJOKOQTBK2+G3rydSm2e/IlcBoL4tvvCJnkivUEfcmA3PRE+3F4gYd+DTxZnIBpzBciradAd/QKX82osaqJC7jcssrHcTAamBMfI/idnwtGLhlMBhRTwVEkavQEEH8rNFhWPwPQxSzDSQ==; 25:lnirDXL6j/5KtYaexsfkf/RTKLyNHMn/9he2yrKKkNFeUcwAD2PIxs4RMLTWR97efwHtFCBm+cFW1wO37K5S/9QryMnJwKOUYS4XgGr33G7Ib/tAA9VT3/8fygYvDCZDq8whYlU9dlBLABVRm176faaqN3Sl3O3eesElCL22S2QRBOZZ31QsZD3EgVNpqJcRHdUQOKjU9al0xqwlSmwi6alkA4qXXg4EviS9Y9IBiRFYO/tE5zLIF8GuNSUIgHK46bVThwBvPPgDWnqGiEh3hoXDkQcgOi4IoGpyW87QlHZpsK+gjZ+K1K235KjZfFfjkZaqq/emLGeQbRINIqPNghVilgEZd1ZISGFzNxLix0mFu13UFzXULEtuevs7F04JqeLM6lkhts4ydi+kvD2UUvW3cQ5k6N5MctGbEaI7rxT34cDMKvTgDwzMGcJ/igcwdG20T8WruI3JPVm7ZuPa4mTWsdFI1MEkmOrTUnBpd9s= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3093; 31:gOXD6OJeMinrh8Vfdy3cHTndqtEhEAm7FOx84hISC/eQoZo4lUvkAAb7p72MKmMD+t2/JYmIIH/NbWEWo61v9TuUxT5bGQ1QAxTUBaUv7xr+BjXs4NFgIh/VxhxPUuVkoN5xQG6SCJN2tA2xzQY/FJahQjP7Hq8X6HbRPgNBXfAfW+vyiWvqOQhYadZa/xfwEYhSjcKoDkCZrTxbeNzzgZz2ljw73Q8FdU8jHXZ6im0uS+1Q4ByXG4swN/J7/yBSgMv7Sp5LfGjptAf8neMgeg==; 20:ZAlDFoP60+eAkMqkmDkSak0MiD00YXirVVaCao1NvDQBWSlWS4fwZ69EWCZof33o9rHkSZYYXtYKXqu9wdRCBOV4IKUwep4SqpyxWVrL3pLbV3Xj9GgvIjisK2RCF2TUcRsyZCLoKe2d9SavUKgDlJF5d0zGZE35tFQfHsfi/lv4grw3QZeakfiyQCQRAMnucaV+T8VvfsnIQJA7TlRn1joCAgLcqa/XeCYUmvXONF6ttBJkItDKCKKeJQFL+ecPUCw4q3blI3qYPpNe7c60a4kk5durQsdlKsV/kuJDH8Ze5Yyrg2HjbqkkxRkHbBfVI+rLlY6sR6VmXZrlTRxbaIO9nWc7v+snj9aGRwxhZ0WNXFBu6QQU1MovGDcW4VPP4iiUPCbfzYoDHa+W3/1VGvVFZHSzFnxJnzah6bUuMoM0b2hzpVsaTTsnrzMFVsHHTJRh0WAxUwhiM8Tu8a8qAN0J7cgAglHL54N+6iG4qEuUkRHAEEee4c9rnucKQzkPbGJT6ezEocJhteU7t5cXTYo8D0BVnqnts6ZLybxFhiQ1+aj4d90zeEpIKpw6a3fD7YcpitZyVfwkDbYLHzsGHTjblq5Hf1JcXqoK6kj8SQ8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(100000703101)(100105400095)(3002001)(10201501046)(6041248)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3093; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3093; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY4PR07MB3093; 4:6/M81cJ73gE1rZJ53WQmC8cvKh/3UKjXt1h2Fg?= =?Windows-1252?Q?7h1uRkyJ8lxDY/Kc8TkxFhQZIPPz6d+FerFO093HbBtV/2eQxrHMC2IJ?= =?Windows-1252?Q?6KgdRkyXpJMM0smJ6M02Wped3Pb+5qfazbBUgxNJ0dg6HdNhvIE5fOu/?= =?Windows-1252?Q?2dWVjnfQmUxOq9czlGGIh4S6xBr6spzW7RUbfSL3SisHuP365i3+4/Lh?= =?Windows-1252?Q?VrHMgU/W+SwoLpdsXxP+pgcaYHunwNxSikRYPpie0UbC52eehor9cMwK?= =?Windows-1252?Q?BnYPbqqycqrysxqviHwGl3CjH68GRGK10vvf2ZvrAyE5X65/nYYF8yEn?= =?Windows-1252?Q?PhDaVfVdb7aeRVnj4wTgwWR824+qQJukMAn4EPwdj3VsfBDQs7IUBtl9?= =?Windows-1252?Q?PxJV777/R1zBZ/T4oIvrF9ErPX4a1+2yySESfY8+iA6//GygBpczjhDX?= =?Windows-1252?Q?WCsuFTqMsg4rtjyaUyRrNohQZVLYihd5vqTZgmcC/UDJfCPVNRegS7Td?= =?Windows-1252?Q?tu9KBrziBkQ0HKudEhe8Fz9WzHCxHr/8FmSRk3qWAyERALv7aABnyJ1N?= =?Windows-1252?Q?4e8K/2ceSwGfLe4k5TI8FgEdHHD6LdBUZkdJnazrjehjrbc1pdCcXHiu?= =?Windows-1252?Q?b5xYaFokgPn3dpl66gqQB/m3SZXWNJncGj1926ZOfTNMfwaeicuAgfzV?= =?Windows-1252?Q?FbUeJ35IaKJPkVTYOh7MuLmz/2RnKcXKOUccE4SaiYhuKmg7v8wwFRK2?= =?Windows-1252?Q?QAUbxqL9hWUhQsQ4Kjzm0fkI5ju2JwFGcRbYR5R1rXaVz3kDVLphped+?= =?Windows-1252?Q?1BSYcc7uBoS0WAqPGJJZ+PelZYg7Kwi//1i+ilP6izrfcj7yOlM8imGp?= =?Windows-1252?Q?XdrhDTBrdVStxOhdoMCScIKDrISo+6whUA/Lo7gTpG+OA2DIgxppxIN1?= =?Windows-1252?Q?u68xJhNX9AP1/hxJHN8WrqFbLfHAiqwGdFiCGY17tDcew1vNTUbJekU9?= =?Windows-1252?Q?c97mQF4Qh4TbWkY1gA/9Fh22qx/78wzosYNx42bZKGBQ6/BgUcft1lAn?= =?Windows-1252?Q?E8tIrbtGqTxzPuUprN5/L2BwNs3K+tpEmSrvNV9IsLAtAzO8PLWML+oW?= =?Windows-1252?Q?ekYLINmWA74VxiMOJAuVEna3g1chRG1WfAXGSLdB2p9ta6ZkWDBFxcKL?= =?Windows-1252?Q?64TT8pBPktavHGbvmFHOr8Zq2oY6w=3D?= X-Forefront-PRVS: 03264AEA72 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(39410400002)(39450400003)(39840400002)(39850400002)(39400400002)(377454003)(24454002)(117156002)(47776003)(50466002)(53936002)(36756003)(229853002)(86152003)(81166006)(6116002)(3846002)(8656002)(8676002)(64126003)(83506001)(38730400002)(25786009)(110136004)(66066001)(2906002)(6246003)(4326008)(2950100002)(54356999)(76176999)(6666003)(33646002)(575784001)(5660300001)(189998001)(90366009)(31696002)(77096006)(50986999)(6486002)(23746002)(4001350100001)(478600001)(305945005)(230700001)(7736002)(31686004)(42882006)(42186005)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3093; H:[192.168.0.105]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY4PR07MB3093; 23:MoLHdYTEJwTgCHzrlwOh4fb6tFVlmIY6D1ylY?= =?Windows-1252?Q?K2pFfMNEp1S4TBDdIT1R766MqctR0nyBpQpIJBnXnpxXw3eyGP6UANKP?= =?Windows-1252?Q?QMuMOTm/Ye+xVlFR7a3VLJ9tTpJC56GYMmiCGa3dKMatziXh5yKxgy5f?= =?Windows-1252?Q?d+uOqKpcVIG/j7/7mS22MkoHKur+01aQwwVvP6Fvr6iLykYKTqWxlayy?= =?Windows-1252?Q?Pw+zKMYYiFjAD5GtcxI9tFD9Kzhc7EjV8lHXoi+9YNb4vX8SJqyymdc3?= =?Windows-1252?Q?CTbu0AcP29SdpUCP38gJhaKhfS2txPrWHnXoxrxrR8eGbSznIDDLze0U?= =?Windows-1252?Q?14LtoNKZGLdvbjMYNmCF/tHBeNtvp5wDm5t03WLQ1DweXlctzNOSYo9i?= =?Windows-1252?Q?d7FuXSh8Fk05QDFY/ZRYKvKL2iQXIXis5tE90QXMmE+cC+Cfuk3dfK/K?= =?Windows-1252?Q?yu03xx/uLXQdE5oXyJaVLSRboOxB5iVOg1vcsSedloHIkYUiACXHr/ZY?= =?Windows-1252?Q?o4NPMlLfO37Jji7OdAICxD95zk1CxeBFm2DoqbolGDsc+YvjO3+9OcyB?= =?Windows-1252?Q?mbnVM0lYrxen5hT9PCvz522dkmE6sL4clMNL0L+YZ80v9eBh9kUtXMj5?= =?Windows-1252?Q?AJQ/ZpyBi1kdAte6XpmfPqu1GRdR5KvSfrx21lg0kTHhRTenf0xf8JoL?= =?Windows-1252?Q?9nyq3XvkOTdX9rK41uNNJlSUdSBvNo6+eawSoLzdkGldfV0aDp3+11nj?= =?Windows-1252?Q?sMYObMEZPk7UxYSZRDf3vT1qFWFXy7p+V1bDX80Z9e+ceZin4JhxVe07?= =?Windows-1252?Q?z5HI93LBV3J3E8tPkhMN3jhISe+gdmMuj3uKEkvoo0LfcLdheGmQFAf2?= =?Windows-1252?Q?pYiZ0EEf+yImAyaWx1dCtBNSASXx8fX9j75CNg4yuD0Y5ToTbiQjeu6k?= =?Windows-1252?Q?zI7s6+bP/qSaiaAj9xXF/fteo7tnRqDMgCdyLYj/CfcvY+6YUwxLkz59?= =?Windows-1252?Q?6yWDC35HQao+7uDflDyrCUdpehGnoK4ohsgqlBeNZAX12qSBRAdjiqMB?= =?Windows-1252?Q?sx+QmDZm6BWP1yI9Mm6K4QopxitALW+K23xFcbPTMO02IcbNOUsN5fKE?= =?Windows-1252?Q?auwh6Q4RoFLvupjP+PFZ9uk/0wZ45zHaZ8RffxkoHFHlPAoAKzbBgrNn?= =?Windows-1252?Q?6YTo7EfEUoV+WQwAKWxrbMwkARvRHOzQ3uIsNRjXKY4FOvMn7FssdmQR?= =?Windows-1252?Q?WVqUWGHxmle50VxH3q9IV6r+l3qfERSzp75yPlINi1rnCf0Ugz3xFeJX?= =?Windows-1252?Q?EA8erFK5KvlgP/SWMGYI/6r3KJ6nonQ4a0OsrHp+aNTX7Xuvy9BS6BRd?= =?Windows-1252?Q?ifo61c00Qj3XFijOO6RiCGoXYjGT8T/JGeBStAkdrM3dO1cslJDbr5ur?= =?Windows-1252?Q?QPn3l0qSy3jlWurDgX7?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3093; 6:iQGhih3o6Wh2RZqhGUB7+VdwHnLT9tLd/3VPTrPh1TAJzdgSL64TgaCRwFBNtc8LJCCXa6B8GXDFor3SszC4oINiBHMhB8P13gz4aD6Gmrsan9CK5auTp9MIev4pvR7gq/kZhUUexU6zlNR0u934L2SV5+E899MaT+iWsTPvxADTwUHGpf0o+52Eg24igwFqT4WNPwUs8Pl/kN0dukSPzbaGcPc3/i+RguoCO8oCyHoh2287OaVotkhUef8gLdz5dczIQ3d/X/Ct9YGi9CN9lHkCrb2uLy2Y0J4PjjX1QnXJ70QUZyVR9C9FRSVQEWBUKvx8JzThNet4CtHnBL3L7wiMS6d3iX0SchyFYWWavaDp03XLj6tEmXAiBrpfzsm1Mau0LouUmomeEMRCUUaZlg45mDJ0J6vMnbgfbg85y+lZCSRVS5kbrZCEbYpac6gnIjfy/dbPReSxARbeeG1mkCMxmmhxiYCRboDn9kVe4eNG+RFNHyQ7qCGIZIrejVCu9LwbVo9DrN2YuWPP/9L15A== X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3093; 5:kb4NMhlJpKlQv3Zsg9en1+jzGhidl8cUiau95df4ng2L6GiZRViIyAWXywhDkD2/o5ndpNsj26yXmJ/GnEfPBH42ifYetx56PNNl/xwJSpgAFFgrmmQT++K2aZuLRXsXfXIaJRhi5+EKp7oeDL/LOd9d+8nI1ezwn6Eqwg49d97flRJP54Alk2BrFWQxx6SkmMj5jrDfRhsc+s2k0KrHKQ23S6FLHoXh8zJp6TyQUuXz8X10/NoDGHX734lY//UxZ9mnyenZwC9aXZKtNdubJjr1axga1QTlNSll8mD6MP0azcJl+5xz/6YqplqxP9gZNMXFSf8mch/D/LdJBQhxPYU/F6cIln5qGH7etOsARd+wAHxGzb0UTANFVURd35CwSErkFujiPU6hTJAqxftwGh0tdYjh5qIS60c8HkiumAiQU2FW31EhFyzlc0hkPqwDkCBsjwtjuFxeEkBDO2LmEIUsk/D+orPXtxysWJoEN5PpU09CAiCE59gc/V3P+RJo; 24:fynKKEsXwd2Wgzg8lGIHnt+SlGmGcSBH2U1kLX4QC0me4ydYEbXTyk2J5FOY6Aabozr0tbJfYbwPrz7ATmGehk7J6QTASu8d1GajOSHjJ5g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3093; 7:pWqH08mAaiAOb14NY/4Dtncdd+TI4m17EPpLknuuHxFeaFL3UF9DdIBYqYxU/06Nt03COCe36lSx/X2VMtavOL8p+IhRD5EL0F5dBzh333O33O1TGYl1rH0Sisy1HPBHl8+iam6S/W4TVkH+zhC1CcA+0FnySB23Wt16lJ3QhBUO8w7Utnq/tuLktmfJZ2frsb1jM8iM9GphUDZ3qjhlpmrxnSR6CThgm33ZuiUt66oXPenXtpURK89yzMo2yllp5Fjig2237cJLvMBRczljBp0B6XsLE8s1b465qMNpO+MiAuo7A5Ndp0Fw5o8M9u0evrd8spHLoHuAESHm1kJ08A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2017 04:25:02.1662 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3093 Subject: Re: [dpdk-dev] [RFC] eal/memory: introducing an option to set iova as va 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: Fri, 02 Jun 2017 04:25:06 -0000 Ping? On Wednesday 24 May 2017 09:41 PM, Santosh Shukla wrote: > Some NPU hardware like OCTEONTX follows push model to get > the packet from the pktio device. Where packet allocation > and freeing done by the HW. Since HW can operate only on > IOVA with help of SMMU/IOMMU, When packet receives from the > Ethernet device, It is the IOVA address(which is PA in existing scheme). > > Mapping IOVA as PA is expensive on those HW, where every > packet needs to be converted to VA from PA/IOVA. > > This patch proposes the scheme where the user can set IOVA > as VA by using an eal command line argument. That helps to > avoid costly lookup for VA in SW by leveraging the SMMU > translation feature. > > Signed-off-by: Santosh Shukla > --- > lib/librte_eal/bsdapp/eal/eal_memory.c | 6 ++++++ > lib/librte_eal/bsdapp/eal/rte_eal_version.map | 7 +++++++ > lib/librte_eal/common/eal_common_options.c | 6 ++++++ > lib/librte_eal/common/eal_internal_cfg.h | 1 + > lib/librte_eal/common/eal_options.h | 2 ++ > lib/librte_eal/common/include/rte_memory.h | 3 +++ > lib/librte_eal/linuxapp/eal/eal_memory.c | 12 ++++++++++++ > lib/librte_eal/linuxapp/eal/rte_eal_version.map | 7 +++++++ > 8 files changed, 44 insertions(+) > > diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c > index 3614da8db..6c8c2c96e 100644 > --- a/lib/librte_eal/bsdapp/eal/eal_memory.c > +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c > @@ -47,6 +47,12 @@ > > #define EAL_PAGE_SIZE (sysconf(_SC_PAGESIZE)) > > +int __rte_unused > +rte_mem_is_iova_as_va(void) > +{ > + return internal_config.iova_va; > +} > + > /* > * Get physical address of any mapped virtual address in the current process. > */ > diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > index 2e48a7366..6e020ca7f 100644 > --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map > @@ -193,3 +193,10 @@ DPDK_17.05 { > vfio_get_group_no; > > } DPDK_17.02; > + > +DPDK_17.08 { > + global: > + > + rte_mem_is_iova_as_va; > + > +} DPDK_17.05; > diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c > index f470195f3..164123ef0 100644 > --- a/lib/librte_eal/common/eal_common_options.c > +++ b/lib/librte_eal/common/eal_common_options.c > @@ -95,6 +95,7 @@ eal_long_options[] = { > {OPT_VFIO_INTR, 1, NULL, OPT_VFIO_INTR_NUM }, > {OPT_VMWARE_TSC_MAP, 0, NULL, OPT_VMWARE_TSC_MAP_NUM }, > {OPT_XEN_DOM0, 0, NULL, OPT_XEN_DOM0_NUM }, > + {OPT_IOVA_AS_VA, 0, NULL, OPT_IOVA_AS_VA_NUM }, > {0, 0, NULL, 0 } > }; > > @@ -876,6 +877,10 @@ eal_parse_common_option(int opt, const char *optarg, > conf->no_pci = 1; > break; > > + case OPT_IOVA_AS_VA_NUM: > + conf->iova_va = 1; > + break; > + > case OPT_NO_HPET_NUM: > conf->no_hpet = 1; > break; > @@ -1083,5 +1088,6 @@ eal_common_usage(void) > " --"OPT_NO_PCI" Disable PCI\n" > " --"OPT_NO_HPET" Disable HPET\n" > " --"OPT_NO_SHCONF" No shared config (mmap'd files)\n" > + " --"OPT_IOVA_AS_VA" Use va addr as iova\n" > "\n", RTE_MAX_LCORE); > } > diff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h > index 7b7e8c887..6293ed0aa 100644 > --- a/lib/librte_eal/common/eal_internal_cfg.h > +++ b/lib/librte_eal/common/eal_internal_cfg.h > @@ -84,6 +84,7 @@ struct internal_config { > const char *hugepage_dir; /**< specific hugetlbfs directory to use */ > > unsigned num_hugepage_sizes; /**< how many sizes on this system */ > + volatile unsigned iova_va; /**< use va addr as iova */ > struct hugepage_info hugepage_info[MAX_HUGEPAGE_SIZES]; > }; > extern struct internal_config internal_config; /**< Global EAL configuration. */ > diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h > index a881c62e2..50f98edea 100644 > --- a/lib/librte_eal/common/eal_options.h > +++ b/lib/librte_eal/common/eal_options.h > @@ -83,6 +83,8 @@ enum { > OPT_VMWARE_TSC_MAP_NUM, > #define OPT_XEN_DOM0 "xen-dom0" > OPT_XEN_DOM0_NUM, > +#define OPT_IOVA_AS_VA "iova-va" > + OPT_IOVA_AS_VA_NUM, > OPT_LONG_MAX_NUM > }; > > diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h > index 4aa5d1f77..c6c57e138 100644 > --- a/lib/librte_eal/common/include/rte_memory.h > +++ b/lib/librte_eal/common/include/rte_memory.h > @@ -258,6 +258,9 @@ rte_mem_phy2mch(int32_t memseg_id __rte_unused, const phys_addr_t phy_addr) > } > #endif > > +int > +rte_mem_is_iova_as_va(void); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c > index ebe068334..d7a373ba2 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_memory.c > +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c > @@ -109,6 +109,12 @@ int rte_xen_dom0_supported(void) > } > #endif > > +int > +rte_mem_is_iova_as_va(void) > +{ > + return internal_config.iova_va; > +} > + > /** > * @file > * Huge page mapping under linux > @@ -169,6 +175,9 @@ rte_mem_virt2phy(const void *virtaddr) > int page_size; > off_t offset; > > + if (rte_mem_is_iova_as_va()) > + return (uintptr_t)virtaddr; > + > /* when using dom0, /proc/self/pagemap always returns 0, check in > * dpdk memory by browsing the memsegs */ > if (rte_xen_dom0_supported()) { > @@ -480,6 +489,9 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl, > } > else { > hugepg_tbl[i].final_va = virtaddr; > + > + if (rte_mem_is_iova_as_va()) > + hugepg_tbl[i].physaddr = (uintptr_t)virtaddr; > } > > if (orig) { > diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > index 670bab3a5..b0ba2233f 100644 > --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > @@ -198,3 +198,10 @@ DPDK_17.05 { > vfio_get_group_no; > > } DPDK_17.02; > + > +DPDK_17.08 { > + global: > + > + rte_mem_is_iova_as_va; > + > +} DPDK_17.05;