From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80075.outbound.protection.outlook.com [40.107.8.75]) by dpdk.org (Postfix) with ESMTP id B151F1B4C9 for ; Tue, 9 Oct 2018 12:46:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=futaW+Hh5A3aLzbnBiMVFfJ8/9Vk1nJk31zdm/cJU6A=; b=LxfQtSwQmfhoy1jj+gZjbmBSfh9mh0l5GY6N+xd4qXzx+ZDNstb1bNEnYxcSRi0NZOo7pobHZZRzqBfQxnRvK5u4/VfWxTwddL5c8DI+fY5AyCr5niMGkwBexwPQXSAPd6SebluUBInO1nizcdG9J1aYeLWgHWIvk4CiGBOEJZs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from [10.232.14.39] (14.142.187.166) by VI1PR04MB4686.eurprd04.prod.outlook.com (2603:10a6:803:71::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.27; Tue, 9 Oct 2018 10:46:13 +0000 From: Shreyansh Jain To: "Burakov, Anatoly" Cc: ferruh.yigit@intel.com, dev@dpdk.org References: <20180925125423.7505-1-shreyansh.jain@nxp.com> <20180925125423.7505-4-shreyansh.jain@nxp.com> <894130a9-017c-348d-31f8-c4c23f517f25@nxp.com> Message-ID: <2d2e9008-fb5b-3ecd-2d2c-e86250f5d363@nxp.com> Date: Tue, 9 Oct 2018 16:15:45 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <894130a9-017c-348d-31f8-c4c23f517f25@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0084.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::24) To VI1PR04MB4686.eurprd04.prod.outlook.com (2603:10a6:803:71::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 005a2109-789d-48e5-61e6-08d62dd4701c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB4686; X-Microsoft-Exchange-Diagnostics: 1; VI1PR04MB4686; 3:8vnV3YZna9/Szx+2x5YuQ1keGFsITIVOupfNM4XFf8nMhmAzmUk2BwawWTBbCM/brIy/TSioAQmEAsZGUrTlk70sxuaKkSrzQxcDhO5sD8oulkLsI2DRdYlPrsjAO9CGnBjGXPLN9wAPEAZ0ylwiB0VA9Wa1R0YylnAaZhK68n2ykh8/8jjufPQslLPVjVtZUVdqsmeInFI9P+RizpSr5wacuoFp5xG9BcF0wiDOMk5gMG4sBrJ87DHskf4cY9xt; 25:G6vxkC9LGKH5u0NLL70A/S/B3gV6nirvpRAhUeFzMg0+iadpDSVzJyRVlEmFR85JJHPe7ue7OmJ1PV6S5gPGoZEkNjxNvfFac7G/C7EDHAqDYKUwrE+RXqULP67LtwjU/6mFhKYRnIyBCXOgxFFKgogMImenk9ikkONXZ3sgW8RkwsuPMU4dQHgSgdMGVL+CyMCNSCC0sRdjwq3gBGkMl7Jsn0GFyxUIx0WqC2tcZjX3LS7sNtlgfGQ9qQwudLassJG0OdvAEbNSSyrEymSBh/q9yRfCtNXLWf6Q8fI7d5QDFlGpA2wc4u7BXmr1HUWTtnZyCEgPl8Hw2dN7l34jVw==; 31:hzKbEQO5epfIushsyh49+sw2DEqq70B54Oe2HTAuxBcckk4ubxp/49pw3bfrnrGgQx6RC+doQAZw9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-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(163750095850); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:VI1PR04MB4686; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB4686; X-Forefront-PRVS: 08200063E9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(136003)(396003)(366004)(346002)(376002)(39860400002)(199004)(189003)(105586002)(31686004)(58126008)(7736002)(2870700001)(2906002)(5660300001)(305945005)(65826007)(64126003)(478600001)(16576012)(6916009)(65806001)(316002)(66066001)(6666003)(93886005)(65956001)(6116002)(3846002)(106356001)(47776003)(5009440100003)(36756003)(97736004)(11346002)(53546011)(386003)(55236004)(86362001)(8676002)(6486002)(446003)(2616005)(476003)(81166006)(31696002)(229853002)(956004)(25786009)(81156014)(6246003)(4326008)(8936002)(16526019)(23676004)(186003)(53936002)(44832011)(77096007)(26005)(52146003)(52116002)(2486003)(76176011)(68736007)(50466002)(67846002)(486006)(14444005)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB4686; H:[10.232.14.39]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtWSTFQUjA0TUI0Njg2OzIzOkhRUXF0TGY3TGU5eGtGa3NDNXMzcW1hZUZo?= =?utf-8?B?aDZKODkwcnV6b0tWLzliYjRleFA1S0FpRHhvWnpBZU55eWRISHlPdm5WbEM1?= =?utf-8?B?U3JLRS84Q0dtSHJYQVlwWVhycmdFVW1u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Awc4Im+PGyF7LWsHTTMaVzikl3L0SaiVeW4uHxYrX5EPd5ABUEEvdnYTDwdtwsG9NRs9g==; 5:RsBvX7cG4YEirT0PWLl3kN+BrQ9rO6nBQo7vZSFShJbP5QBPXfFPlZJxkCvddJHXpgwR7l77xUjDkUx+c2TOXFl2s6ggIIn25291YjRp59T9hhmP4zzB8SKVAKWfetXUgpNXclH6d9oyZbY8Q0logsLAKQzMnDc51AfGXPVBeiM=; 7:7zmrQlh9uwLQNaj1mKwfImBCFOMWs2ny3hGnRlhe52Ny9m0sLJ/xZ/uj8Y49YAqjVMFZJgkBueeHAy80+Rmsf/szrAbg8QB4nXH5Aku2j4r3gKx7zsVGu+tsuwyCuhesogHJg60gDxqIeXkf4QuuFrek3rMBhLLdAUacO8pTEARKlghuVTWvnYcJmto6jSH410jVWrDTPCMIRr2MGoY0lPXJ4Luc9k6dh3hqqy4wj68B8mCOogASc87vJp+rpeNF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2018 10:46:13.7805 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 005a2109-789d-48e5-61e6-08d62dd4701c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4686 Subject: Re: [dpdk-dev] [PATCH 3/5] common/dpaax: add library for PA VA translation table 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: Tue, 09 Oct 2018 10:46:16 -0000 On Tuesday 25 September 2018 07:09 PM, Shreyansh Jain wrote: > Hello Anatoly, > > On Tuesday 25 September 2018 06:58 PM, Burakov, Anatoly wrote: >> On 25-Sep-18 1:54 PM, Shreyansh Jain wrote: >>> A common library, valid for dpaaX drivers, which is used to maintain >>> a local copy of PA->VA translations. >>> >>> In case of physical addressing mode (one of the option for FSLMC, and >>> only option for DPAA bus), the addresses of descriptors Rx'd are >>> physical. These need to be converted into equivalent VA for rte_mbuf >>> and other similar calls. >>> >>> Using the rte_mem_virt2iova or rte_mem_virt2phy is expensive. This >>> library is an attempt to reduce the overall cost associated with >>> this translation. >>> >>> A small table is maintained, containing continuous entries >>> representing a continguous physical range. Each of these entries >>> stores the equivalent VA, which is fed during mempool creation, or >>> memory allocation/deallocation callbacks. >>> [...] > >> >> Also, a couple of nitpicks below. >> >>>   cosnfig/common_base                            |   5 + >>>   config/common_linuxapp                        |   5 + >>>   drivers/common/Makefile                       |   4 + >>>   drivers/common/dpaax/Makefile                 |  31 ++ >>>   drivers/common/dpaax/dpaax_iova_table.c       | 509 ++++++++++++++++++ >>>   drivers/common/dpaax/dpaax_iova_table.h       | 104 ++++ >>>   drivers/common/dpaax/dpaax_logs.h             |  39 ++ >>>   drivers/common/dpaax/meson.build              |  12 + >> >> >> >>> +    DPAAX_DEBUG("Add: Found slot at (%"PRIu64")[(%zu)] for vaddr:(%p)," >>> +            " phy(%"PRIu64"), len(%zu)", entry[i].start, e_offset, >>> +            vaddr, paddr, length); >>> +    return 0; >>> +} >>> + >>> +int >>> +dpaax_iova_table_del(phys_addr_t paddr, size_t len __rte_unused) >> >> len is not unused. > > I will fix this. > Actually, this function itself is useless - more for symmetry reason. > Callers would be either simply updating the table, or ignoring it > completely. But, yes, this is indeed wrong that I set that unused. > Actually, I was wrong in my first reply. In case of dpaax_iova_table_del(), len is indeed redundant. This is because the mapping is for a complete page (min of 2MB size), even if the request is for lesser length. So, removal of a single entry (of fixed size) would be done. In fact, while on this, I think deleting a PA->VA entry itself is incorrect (not just useless). A single entry (~2MB equivalent) can represent multiple users (working on a rte_malloc'd area, for example). So, effectively, its always an update - not an add or del. I will send updated series with this change. [...]