From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10082.outbound.protection.outlook.com [40.107.1.82]) by dpdk.org (Postfix) with ESMTP id 2099823D for ; Mon, 15 Oct 2018 08:44:10 +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=whEJHu4onSRmg7TYHNUPDnj754qAT48yMnkjcLkfGQ8=; b=khm812TFqjFxUb5qiOiMLkAfMoCJZrxYodn0hG7Q2BUSB6IdM7oqWv8W2I7WomdfXUL5qqrXEDlfDSaFc+lbVixXfYgkVHrzUQ7r6bk4r+RnyQne3CM+lJ2zhCyXDAKsHzW04XghuYLYTf9WlDiCNvngDDLoHlZzgQvKkRBo+n8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by AM6PR04MB4677.eurprd04.prod.outlook.com (2603:10a6:20b:1b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.24; Mon, 15 Oct 2018 06:44:06 +0000 From: Shreyansh Jain To: ferruh.yigit@intel.com, thomas@monjalon.net Cc: anatoly.burakov@intel.com, pbhagavatula@caviumnetworks.com, dev@dpdk.org, Shreyansh Jain Date: Mon, 15 Oct 2018 12:11:57 +0530 Message-Id: <20181015064202.20802-1-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181013122130.22588-1-shreyansh.jain@nxp.com> References: <20181013122130.22588-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: OSAPR01CA0083.jpnprd01.prod.outlook.com (2603:1096:604:b::23) To AM6PR04MB4677.eurprd04.prod.outlook.com (2603:10a6:20b:1b::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 84bd483d-ae64-4d76-a773-08d632699c83 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM6PR04MB4677; X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4677; 3:NKZQmnujLNf1c1O6QAZy7BQ+eHBqUAM+VmYriV1pEoRH88qxVMIFl+6Pfz1ZIZNDiThTLt6wYE14gQW77sxElGncRDd587dX2NFnyInsxW1KOcbf6f+Jq8cP7n65x7jKGKxhMEQ0EZjZznJE+coUSdJgnr1RgT56e0uXXlTy3Uwmyy5QGc1b9bo0KUchH2BjMNwGUYQZpT9Ac282s0OWcYIQEJvS+JNxiDY9ut6o45YujZbRAaXRw/SmhNXEGe8x; 25:ACFy+o4oMHYgnEdfgJvHiTZbhi+2Hr1ouVhd40ppl9uMNTM4vWySS3XBuxLU1M4qFEo8g0fM5Fji2Uu3u63+Ic2NfiaFplntkFuuhzK9nyDa4ql5tpKI880ZfZGl+QoKWfVR3biVCJAdhKPoXOdbTRN0mOFk2wKWpcrhOQOAc9FePs2bQpzdTJfnCCzChH0Flu1XzAYp8yCl8GUSb+7LyIsPPvq3Qz+E6MEo7buOKeK9TMcEoXKj+MR+8/0pBu4SHVzT0ey2yO2+ZOEknB0JKahRxc6OefapH70Zm+SXJ0yXqAvtt7Z49Op1O9YK9Ny+aNbuMkdBnGCNyopFIRFNOg==; 31:be9YIKy+ZkBBIUhi7P71KAo457UMEDssNrgU9ReyqqCPmTNJsVWhrXf2kl4xflrMwUTpwTI6LxITMP3FR9VcK4lD8PQqDW4HsSuSSzk3Mvp3CcfelDo75Gypk5CbybNiDnMPdejimjCd2sdgr0gjezOFME1vohDUT0JWafefEBL/q6ZmZD4S/JmQtMx7Wrs12UbUrYE/GhCqQ66JJvY4mV9eqNNIXg+Wt2i5F3J/Vg4= X-MS-TrafficTypeDiagnostic: AM6PR04MB4677: X-Microsoft-Exchange-Diagnostics: 1; AM6PR04MB4677; 20:m6iGy7o1IhOvPtZitHLUV+JcziWVzYrrPjK4WNtFVjF85V1FOGNKj0mNK9ibpYTkA//mMbLXBlkprjrSBWO79uTUpsOz746C7PUlwfbKUuk4HZjEhEnxzbzSrlyT1b+TkLzXeO9HP8jcsNRsP5I/ya1uxdiZDSuqD2Y6AqsXSs4FupXH0YOLjj0pGtxl7yoJOH9WQ4bBlp8yWqEK0o8xIcj90d2rSCwT7e1o08Y4S+N9Nm3TlB3wOLQ79Ka5N9WS7i/T4+RFTQxQTK0ZjjUiL1R2xi5eGhGV12ZKUZTjhwhRzoAze0dfoJaRmyTPYdyJyrlPKhqXtIx2a0ENIUeN7U/0MUv9vWXS9Yqq1mEhkkSugfPau4X1xUro93ELXN/8c7TbJozlRmZsNz2ja7rAV1Bo5bJyyohZ4hUIhwWlYFJv26VGfbt4+cHK6LJhg6CGUiKjtIRFwldtyTD6d1J/wllOywUz96mD8zxCSRgwkwCdAKubn4ZfCjAxxP+/zpTy; 4:KcyqDisfajBLb2cPJtiN7jlB6iUZ2skp7fxOFYO1MeOJ0yjcf4zJuwfyW33eq2eumQpmzRcI7uVWE+KisvOM25FfMBnMZn+dnzmoUgRJzPEPR3VQZsqDfErbtLIskn7/glhQMIAimprpD6KT9hjKAmSfEUotR1OHU4j5BumBGjPrn8zWuhJk+AA4X7mML48QfLYRqk62uL88L80snlY1uyTcMCcaUPJbhpYnfFK96LXs272Nr2ibjEBeSa79B9uBpE7eTflMZl/EtDMo9k49a7JIZK6DkQzskjAc0qTZzpfd5rT+HZZp3LNcfqYu305RMc+GnKeaJ2l5IM6hMutQPH0a4SXbK5IFfIgbGXNVoWk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(211171220733660)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991067); SRVR:AM6PR04MB4677; BCL:0; PCL:0; RULEID:; SRVR:AM6PR04MB4677; X-Forefront-PRVS: 0826B2F01B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(136003)(39860400002)(366004)(199004)(189003)(3846002)(68736007)(50466002)(6116002)(478600001)(4326008)(2616005)(476003)(446003)(1076002)(486006)(6512007)(53936002)(50226002)(186003)(5660300001)(956004)(11346002)(78486010)(16586007)(14444005)(55236004)(6666004)(2906002)(16526019)(1006002)(52116002)(81156014)(6506007)(81166006)(316002)(386003)(44832011)(48376002)(76176011)(8936002)(51416003)(8676002)(86362001)(575784001)(7736002)(305945005)(26005)(6486002)(47776003)(66066001)(105586002)(106356001)(97736004)(25786009)(36756003)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR04MB4677; H:Tophie.ap.freescale.net; 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: =?us-ascii?Q?1; AM6PR04MB4677; 23:4+m5kPqww8OnqGRLm+0+Er0UsAHwOf6uvjwWay2+f?= =?us-ascii?Q?mEvQaLQjweh+Nn4FvVuRYUAXYkhJUXiUnrut/q0aj1juEKTWXHsHQEoImuwK?= =?us-ascii?Q?ZSBO/5fiHdZid3whqwL5zy+F/axnj79fRx3wpitvmFXkvsaHJvz0P1GxwRSk?= =?us-ascii?Q?omCl9BFeOSV30QJi8STf+82KHlJHgz6Dn+w9hCrL6VmGV+6TzqXhsJm1U6I7?= =?us-ascii?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4dPnNnTzx7zemieKslQcmBW6g/VYIe5tmAwUqCG4NdKm6nYmRIEY/ode7WgOUMOY/SIwO3bNLSg10I/z3T0vejNjoMVVBGsA38xMw==; 5:3QUNpcb7CR9FDkya0L9I7zOh1zSaC1fXGoZVPzKu7weHU15We9kDs1h+EWRkBmp2fqGg2bd0tM4gtRERFfc0nnIwxR/kx0FapD5ElxCek9nQQkHWk2hAAfbOBLlMnXXy3olvsoLdxQWHLXlQbR/uRMcvzhkOM/QMr/vsDfE0gr0=; 7:HynorBZDrVsS3PSfuVV21qECuo7YlQQEUlI33TsFgtvUpWo4v00wrLtJyddcOSbvvA0c4l8QposOPWS8H0SBwolZ/EWefl6f2u7slmjLbb95lobQCzQTJYpIZntrhr+jOOpSNYSvp4m7xdi0dePAzX3SEGzGOxOeEaPjG+MOIXJ+f+9iCYr5dOhv0zAox1zdE2e8OmgZrsKKq8Q3BGxt5qRJFrzv57rXNghqdH2QzBnAvA6AZPU8Eg+iSTijQkIC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2018 06:44:06.7550 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84bd483d-ae64-4d76-a773-08d632699c83 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4677 Subject: [dpdk-dev] [PATCH v4 0/5] Add a PA-VA Translation table for DPAAx 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: Mon, 15 Oct 2018 06:44:11 -0000 ::Background:: After the restructuring of memory in last release(s), one of the major impact on fslmc/dpaa bus (and its devices) was the performance drop when using physical addressing. Previously, it was assumed that physical range was contiguous for any given request for hugepage memory. That way, whenever a virtual address was returned, it was easy to fetch physical equivalent, in almost constant time. But, with memory hotplug series, that assumption was negated. Every call that device drivers made for rte_mem_virt2iova or rte_mem_virt2phy were expensive. (Using IOVA_CONTIG is an app dependency which is not a practical option). For fslmc, working on Physical or Virtual (IOMMU supported) address is an optional thing. For dpaa bus, it is not optional and only physical addressing is supported. Thus, it impacted dpaa bus the most. ::DPAAX PA-VA Table:: - A simple table containing entries for all physical memory range available on a particular SoC (in this case, NXP's LS104x and LS20xx series, which are handled by dpaa and fslmc bus, respectively). As of now, this is SoC dependent for fetching range. - We populate the table either through the mempool handler (for mempool pinned memory) or through the memory event callbacks (for cases where working memory is allocated by application). - Though aim is only to translate addresses for descriptors which are Rx'd from devices, this is a generic layer which should work in other cases as well (though, not the target of current testing). ::About patches:: Patch 1: There was an issue in existing PA/VA mode reporting being done by fslmc bus. This patch fixes it. Patch 2: Common libraries/commponents can be dependency for the bus thus, blocking parallel compilation Patch 3: Add the library in common/dpaax. This is a single patch as functions are mostly inter-linked. Patch 4~5: Add support in dpaa and fslmc bus, respectively. It is not possible to unlink the bus and device drivers, thus, these patches have blanket change across all drivers. ::Next Steps:: - Some optimization are required to tune the access pattern of the table. These would be posted as additional patches. - In case there is any possible split of patches, I will post another version. But until then, this is the layout. ::Version History:: v3->v4: - Fixed missing rework against review comment from Pavan: shift the IOVA mode detection code in bus/fslmc - Rebased over master (abe92131c92) v2->v3: - Added back del operation (update) for mem-events, which was removed in v2 - Change IOMMU(PA) detection for FSLMC Bus (review comment: Pavan) - Rebase on master (6673fe0ce2) v1->v2: - Rework of review comments on v1 - Removed dpaax_iova_table_del API - that is redundant - Changed paax_iova_table_add to paax_iova_table_update to make it more relevant - Previous patch removed an advertised API (rte_dpaa2_memsegs). This is fixed. A deprecation notice would now be sent for removal in next release. - Rebase on master (5f73c2670f); Also verified on net-next/mater (317f8b01f) Shreyansh Jain (5): bus/fslmc: fix physical addressing check drivers: common as dependency for bus common/dpaax: add library for PA VA translation table dpaa: enable dpaax library fslmc: enable dpaax library config/common_base | 5 + config/common_linuxapp | 5 + drivers/Makefile | 1 + drivers/bus/dpaa/Makefile | 1 + drivers/bus/dpaa/dpaa_bus.c | 4 + drivers/bus/dpaa/meson.build | 2 +- drivers/bus/dpaa/rte_dpaa_bus.h | 6 + drivers/bus/fslmc/Makefile | 1 + drivers/bus/fslmc/fslmc_bus.c | 24 + drivers/bus/fslmc/meson.build | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 21 +- drivers/common/Makefile | 4 + drivers/common/dpaax/Makefile | 31 ++ drivers/common/dpaax/dpaax_iova_table.c | 461 ++++++++++++++++++ drivers/common/dpaax/dpaax_iova_table.h | 103 ++++ drivers/common/dpaax/dpaax_logs.h | 39 ++ drivers/common/dpaax/meson.build | 12 + .../common/dpaax/rte_common_dpaax_version.map | 11 + drivers/common/meson.build | 2 +- drivers/crypto/dpaa2_sec/Makefile | 1 + drivers/crypto/dpaa_sec/Makefile | 1 + drivers/crypto/dpaa_sec/dpaa_sec.c | 6 + drivers/event/dpaa/Makefile | 1 + drivers/event/dpaa2/Makefile | 1 + drivers/mempool/dpaa/Makefile | 1 + drivers/mempool/dpaa/dpaa_mempool.c | 4 + drivers/mempool/dpaa/dpaa_mempool.h | 4 +- drivers/mempool/dpaa2/Makefile | 1 + drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 29 +- drivers/net/dpaa/Makefile | 1 + drivers/net/dpaa2/Makefile | 1 + drivers/raw/dpaa2_cmdif/Makefile | 1 + drivers/raw/dpaa2_qdma/Makefile | 1 + mk/rte.app.mk | 2 + 34 files changed, 748 insertions(+), 42 deletions(-) create mode 100644 drivers/common/dpaax/Makefile create mode 100644 drivers/common/dpaax/dpaax_iova_table.c create mode 100644 drivers/common/dpaax/dpaax_iova_table.h create mode 100644 drivers/common/dpaax/dpaax_logs.h create mode 100644 drivers/common/dpaax/meson.build create mode 100644 drivers/common/dpaax/rte_common_dpaax_version.map -- 2.17.1