From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0069.outbound.protection.outlook.com [157.56.112.69]) by dpdk.org (Postfix) with ESMTP id D6DB62E8D for ; Mon, 6 Jul 2015 10:53:30 +0200 (CEST) Received: from HE1PR02MB0810.eurprd02.prod.outlook.com (10.161.118.15) by HE1PR02MB0697.eurprd02.prod.outlook.com (10.161.114.151) with Microsoft SMTP Server (TLS) id 15.1.207.19; Mon, 6 Jul 2015 08:53:29 +0000 Received: from VI1PR02CA0041.eurprd02.prod.outlook.com (10.162.7.179) by HE1PR02MB0810.eurprd02.prod.outlook.com (10.161.118.15) with Microsoft SMTP Server (TLS) id 15.1.201.16; Mon, 6 Jul 2015 08:53:28 +0000 Received: from AM1FFO11FD031.protection.gbl (2a01:111:f400:7e00::154) by VI1PR02CA0041.outlook.office365.com (2a01:111:e400:581f::51) with Microsoft SMTP Server (TLS) id 15.1.207.19 via Frontend Transport; Mon, 6 Jul 2015 08:53:28 +0000 Authentication-Results: spf=fail (sender IP is 124.207.145.166) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of ezchip.com does not designate 124.207.145.166 as permitted sender) receiver=protection.outlook.com; client-ip=124.207.145.166; helo=bjgfarm-1.internal.tilera.com; Received: from bjgfarm-1.internal.tilera.com (124.207.145.166) by AM1FFO11FD031.mail.protection.outlook.com (10.174.64.220) with Microsoft SMTP Server (TLS) id 15.1.201.10 via Frontend Transport; Mon, 6 Jul 2015 08:53:26 +0000 Received: (from zlu@localhost) by bjgfarm-1.internal.tilera.com (8.14.4/8.14.4/Submit) id t668rMLq024557; Mon, 6 Jul 2015 16:53:22 +0800 From: Zhigang Lu To: Date: Mon, 6 Jul 2015 16:51:34 +0800 Message-ID: <1436172698-21749-10-git-send-email-zlu@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1436172698-21749-1-git-send-email-zlu@ezchip.com> References: <1436172698-21749-1-git-send-email-zlu@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD031; 1:QLRd3BmQAIlJDw8kDvf7hVGt7NS2Pkboj42eMrpnmrIXOz9QUNOjy5vvw7l6BMRXtcWTpqdGwxtKY+9UrH0hw9i1DOU9y5xhqXe1gvMGiSEDTqL8kA1qmEEy4EI8f11R2A6Zs+1X8C97tV+HAXBBpDV3MlN8c8gNnzmN3TQ1E8H3XJUdOIfM5oKsGc0hN1QnaGyZckFJjjAlRSSCCljEBvxwc/61j0T69lJTsoKWhK3W9ggr31GYbZjHnkv/Ds3pfnEkwaeKy3j/cLyXq+NgNs5pQ1enOPxf81n8lhAAFCAId9AVFgd+GhNkyFSfKPT7sIh/JUsM3rz8KRr4DcwHmQ== X-Forefront-Antispam-Report: CIP:124.207.145.166; CTRY:CN; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(339900001)(199003)(189002)(46102003)(19580395003)(6806004)(19580405001)(106466001)(87936001)(86362001)(2351001)(42186005)(50986999)(33646002)(575784001)(104016003)(229853001)(85426001)(76176999)(50466002)(77156002)(62966003)(48376002)(450100001)(2950100001)(107886002)(5001960100002)(189998001)(110136002)(47776003)(36756003)(105606002)(50226001)(92566002)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR02MB0810; H:bjgfarm-1.internal.tilera.com; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB0810; 2:g/gyI3OOfgx3dcSfgYQwT3+wXMf7xGduQHupKKPoEXkJNlfhnJsrvSn4LnUROZu8; 3:Uiklz1KOMkdAqnv/bP4GTmguSyZ1glTioc8wE7tF5Cmo+/O+5L/SLGPbcb2rwHx0wIA9hPXXVq4SQWxgBWo7WPMIrv+6ScdQgoa4Asg1FzUxmN5jJXuZSVYwkIAQVVB4oXfKNV2bfDZeZVlEzcMGl8xLfUDYiZ3jv244mNxuRbzLC7ws4yKy/fFJQ5XMxl8SRt4zzF597yTWQGwfSQgZ3SDsnfu0joiL/iMlldTLL66COEznNQ09ekI4KtL80EBm; 25:DVsVZ4tyHXWC1WckPDqyhaPSg7iszRuGHg3XcRMMPGrJ/pI89Zx7pwRJLrhP+1OcYwUdLgZlcmhj5YNLQTcj3/0/FC89BfNT4G0H4WEtlyF0aKYRE6vMUpkv6hhpXYlQda6Put1qR5b3tVKreCw3AQ/LIZd4bevZqFVjkAyDYPNbCIcw546Jn767zrUv7rT69C2/fdMv5W0K38HEfbOIksL2HRtpeyhXRAHwe3m/gKGGbTuD2ZMF6m+WzoL8guKMvn5P84oIONylZ3Su32yofw==; 20:q889W1FkDJo7w4mTvCoZS42AN68E5ugsmSP/zojG5RVKo69su7pCFglCu4FlbXTGGH66uN06yKeM3Dgtv9rHwnSyIb2zqCzj7cogZuTNlmnfP52VaGFFspdiMhAwQdkKAB2fG30cTAKpanFGtrAfpZgcEOqxeFn44ls124hwE04= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:HE1PR02MB0810; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:HE1PR02MB0697; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:HE1PR02MB0810; BCL:0; PCL:0; RULEID:; SRVR:HE1PR02MB0810; X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB0810; 4:u5ooklQDdC9SWa7FnuWQHyAWFkJUs3rEJiUmnjbXgVUwAk7Sko4qKA0rVbOPqkewyg5I9Qr7O8f3lgr0rnwZC63nNF2Q4eiLMOxxCf5L5gVpGkSPUN8vwsmCIKkaCOCgg56wcIm+DQF6vUJLqRTFPFsR8KO+I2B8YeyW9P94aJZEutK21UH5MnrTfZ7SBhTLbUKjE1mBnC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R8o0fSxibvaHeuC9XAKBd+DeQs9Rb?= =?us-ascii?Q?50zHGupzE/O85l84OjSk04mWNwQXxsRKgvjlPmik0+XWn6Rb7T42r6w2GhCv?= =?us-ascii?Q?mrIySHAA5yWKvaxPFOIowbe0WGSu/fLCBs4ijnaCbz55MGNoonvm7LjiWSP3?= =?us-ascii?Q?r3kVLTqq/mAejYGCCbwEGTXf2fhktj7hk7wiKE8YONoLyR8iBl1PRV9y6b4l?= =?us-ascii?Q?OwInSIkP5m3bem8EJxvyRvmcJqw+i9iLxjFlOsR4vzEYjKPz4QntGUxLhOV2?= =?us-ascii?Q?ig=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB0810; 5:zetnEBTGH4xafwKM9qenGHKQpObAFWLVMpIzOlCDWhpWPH5r1slDsNy/jgYdkCTancOmF7wKaCTT8X5CGanBooeaXSA2yk22ejGH2ZzKOQhbiByjMjX/cozQX5yGSaBZ34qh+VkgRC4qjQoi5EQMxQ==; 24:rewsZemK/nCru8zvaNZ+lLj3Ca0h2UVkQtYvpmZzGD3OcpdGRmB4HNgF+C84pxtxgTRwvx254i+Oaw7Bk37CyleeHQYYnaYP2OGusrggv1Y=; 20:VYkD2GcuKn44n7QWa7kw7XjwuxarhnDAWC0hYEcgIxbF/YOolG34uEc7LcabVhF2kmWv8PjW3+5LmFWhPG4wLQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2015 08:53:26.5375 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3; Ip=[124.207.145.166]; Helo=[bjgfarm-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR02MB0810 X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB0697; 2:iUF80REBDSdpgGm/yCBGcoijIaK2HofgbnD1vM/bjXX4RdAW6i0JRWOrO6fFA2gA; 3:Eg/r3B40YiVwGiXdy+AZButVmarVzkX7c2T1PWAHe12PIzMk3dzw10MKoQ+mIqi8L10XQuStV+V0lpWo0q0iDMxXOMqmGKXZGoSgmbWlJxOTcOLC2zceVkaBSCiM228Ab3erUQngMJx9JqLywzsW+RNCpT5BRbaWhAUVNX9IjyIWzBEIHdJhPoatSSxVkYeN/OpoGxj8R/HJehyfJGn+VBibvHC5HqMe1QZwGiRR3BDj/aWlvX/UTN3IHut2Mk0K; 25:smdxVvNoOCyGUkc30xz6n2cFaZ6DKG9RDEZT8+EL583xJhj3ql92aEyhUU0WyGkzgF9cjXfPX4DKAVPUKl+1N2FWmdLQnG1ksbfFrBWLP+ZN84lSGVS22ru84fbcj03ISsRdS3Q5NSrjUhtSI04K7tKTtFfzEYpOemNUmG29Cav1E40lFGnLNzWuXXa+4MbT2MPBw15kUWsXWZeM55s5A7XVSUmz9S0J3knkFXgIizw9Gtf43Szm8JAgFvHR6+YllFg11vVRV4HfoTGKWc1X5g==; 23:koJ1McJiSUbqHUjKe6w5Zd7fi4Hvwyu+Z7MvVZISwwB0nyp6pE13UAjAj3JzwfLAATb9IQK3Eg2KKOw9bu28Bd2MAyloXJRxtrz/KcWP+PRQRbK68d61OaJu8YGk8pqxG7tyUHVxSPNlq4Wv1mDqBu2+huG7iK7avsFEQHiaLZJC1OoqPOOqHn1FEuhOv1qdLjlzzATQstXBRmX1CQINcvI1qQZUvDBHeEHgP8i8LhNSogmLR1DJr6D/sA2Vj3Gl X-OriginatorOrg: ezchip.com Subject: [dpdk-dev] [PATCH v3 09/12] tile: add page sizes for TILE-Gx/Mx platforms X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2015 08:53:31 -0000 This patch adds a few new page sizes that are supported on the TILE-Gx and TILE-Mx platforms. Change-Id: I7da783703149c4f96b84d0017fa4f1191fc029c6 Signed-off-by: Zhigang Lu --- lib/librte_eal/common/eal_common_memzone.c | 8 +++++ lib/librte_eal/common/include/rte_memory.h | 16 +++++---- lib/librte_eal/common/include/rte_memzone.h | 50 +++++++++++++++++++---------- 3 files changed, 51 insertions(+), 23 deletions(-) diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c index 76bae72..dc39a79 100644 --- a/lib/librte_eal/common/eal_common_memzone.c +++ b/lib/librte_eal/common/eal_common_memzone.c @@ -284,12 +284,20 @@ rte_memzone_reserve_thread_safe(const char *name, size_t len, const struct rte_memzone *mz = NULL; uint64_t size_mask = 0; + if (flags & RTE_MEMZONE_256KB) + size_mask |= RTE_PGSIZE_256K; if (flags & RTE_MEMZONE_2MB) size_mask |= RTE_PGSIZE_2M; if (flags & RTE_MEMZONE_16MB) size_mask |= RTE_PGSIZE_16M; + if (flags & RTE_MEMZONE_256MB) + size_mask |= RTE_PGSIZE_256M; + if (flags & RTE_MEMZONE_512MB) + size_mask |= RTE_PGSIZE_512M; if (flags & RTE_MEMZONE_1GB) size_mask |= RTE_PGSIZE_1G; + if (flags & RTE_MEMZONE_4GB) + size_mask |= RTE_PGSIZE_4G; if (flags & RTE_MEMZONE_16GB) size_mask |= RTE_PGSIZE_16G; if (!size_mask) diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h index d948c0b..1bed415 100644 --- a/lib/librte_eal/common/include/rte_memory.h +++ b/lib/librte_eal/common/include/rte_memory.h @@ -53,12 +53,16 @@ extern "C" { #endif enum rte_page_sizes { - RTE_PGSIZE_4K = 1ULL << 12, - RTE_PGSIZE_2M = 1ULL << 21, - RTE_PGSIZE_1G = 1ULL << 30, - RTE_PGSIZE_64K = 1ULL << 16, - RTE_PGSIZE_16M = 1ULL << 24, - RTE_PGSIZE_16G = 1ULL << 34 + RTE_PGSIZE_4K = 1ULL << 12, + RTE_PGSIZE_64K = 1ULL << 16, + RTE_PGSIZE_256K = 1ULL << 18, + RTE_PGSIZE_2M = 1ULL << 21, + RTE_PGSIZE_16M = 1ULL << 24, + RTE_PGSIZE_256M = 1ULL << 28, + RTE_PGSIZE_512M = 1ULL << 29, + RTE_PGSIZE_1G = 1ULL << 30, + RTE_PGSIZE_4G = 1ULL << 32, + RTE_PGSIZE_16G = 1ULL << 34, }; #define SOCKET_ID_ANY -1 /**< Any NUMA socket. */ diff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h index ee62680..de5ae55 100644 --- a/lib/librte_eal/common/include/rte_memzone.h +++ b/lib/librte_eal/common/include/rte_memzone.h @@ -60,8 +60,12 @@ extern "C" { #define RTE_MEMZONE_2MB 0x00000001 /**< Use 2MB pages. */ #define RTE_MEMZONE_1GB 0x00000002 /**< Use 1GB pages. */ -#define RTE_MEMZONE_16MB 0x00000100 /**< Use 16MB pages. */ -#define RTE_MEMZONE_16GB 0x00000200 /**< Use 16GB pages. */ +#define RTE_MEMZONE_16MB 0x00000100 /**< Use 16MB pages. */ +#define RTE_MEMZONE_16GB 0x00000200 /**< Use 16GB pages. */ +#define RTE_MEMZONE_256KB 0x00010000 /**< Use 256KB pages. */ +#define RTE_MEMZONE_256MB 0x00020000 /**< Use 256MB pages. */ +#define RTE_MEMZONE_512MB 0x00040000 /**< Use 512MB pages. */ +#define RTE_MEMZONE_4GB 0x00080000 /**< Use 4GB pages. */ #define RTE_MEMZONE_SIZE_HINT_ONLY 0x00000004 /**< Use available page size */ /** @@ -110,11 +114,15 @@ struct rte_memzone { * constraint for the reserved zone. * @param flags * The flags parameter is used to request memzones to be - * taken from 1GB or 2MB hugepages. - * - RTE_MEMZONE_2MB - Reserve from 2MB pages - * - RTE_MEMZONE_1GB - Reserve from 1GB pages - * - RTE_MEMZONE_16MB - Reserve from 16MB pages - * - RTE_MEMZONE_16GB - Reserve from 16GB pages + * taken from specifically sized hugepages. + * - RTE_MEMZONE_2MB - Reserved from 2MB pages + * - RTE_MEMZONE_1GB - Reserved from 1GB pages + * - RTE_MEMZONE_16MB - Reserved from 16MB pages + * - RTE_MEMZONE_16GB - Reserved from 16GB pages + * - RTE_MEMZONE_256KB - Reserved from 256KB pages + * - RTE_MEMZONE_256MB - Reserved from 256MB pages + * - RTE_MEMZONE_512MB - Reserved from 512MB pages + * - RTE_MEMZONE_4GB - Reserved from 4GB pages * - RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if * the requested page size is unavailable. * If this flag is not set, the function @@ -157,11 +165,15 @@ const struct rte_memzone *rte_memzone_reserve(const char *name, * constraint for the reserved zone. * @param flags * The flags parameter is used to request memzones to be - * taken from 1GB or 2MB hugepages. - * - RTE_MEMZONE_2MB - Reserve from 2MB pages - * - RTE_MEMZONE_1GB - Reserve from 1GB pages - * - RTE_MEMZONE_16MB - Reserve from 16MB pages - * - RTE_MEMZONE_16GB - Reserve from 16GB pages + * taken from specifically sized hugepages. + * - RTE_MEMZONE_2MB - Reserved from 2MB pages + * - RTE_MEMZONE_1GB - Reserved from 1GB pages + * - RTE_MEMZONE_16MB - Reserved from 16MB pages + * - RTE_MEMZONE_16GB - Reserved from 16GB pages + * - RTE_MEMZONE_256KB - Reserved from 256KB pages + * - RTE_MEMZONE_256MB - Reserved from 256MB pages + * - RTE_MEMZONE_512MB - Reserved from 512MB pages + * - RTE_MEMZONE_4GB - Reserved from 4GB pages * - RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if * the requested page size is unavailable. * If this flag is not set, the function @@ -209,11 +221,15 @@ const struct rte_memzone *rte_memzone_reserve_aligned(const char *name, * constraint for the reserved zone. * @param flags * The flags parameter is used to request memzones to be - * taken from 1GB or 2MB hugepages. - * - RTE_MEMZONE_2MB - Reserve from 2MB pages - * - RTE_MEMZONE_1GB - Reserve from 1GB pages - * - RTE_MEMZONE_16MB - Reserve from 16MB pages - * - RTE_MEMZONE_16GB - Reserve from 16GB pages + * taken from specifically sized hugepages. + * - RTE_MEMZONE_2MB - Reserved from 2MB pages + * - RTE_MEMZONE_1GB - Reserved from 1GB pages + * - RTE_MEMZONE_16MB - Reserved from 16MB pages + * - RTE_MEMZONE_16GB - Reserved from 16GB pages + * - RTE_MEMZONE_256KB - Reserved from 256KB pages + * - RTE_MEMZONE_256MB - Reserved from 256MB pages + * - RTE_MEMZONE_512MB - Reserved from 512MB pages + * - RTE_MEMZONE_4GB - Reserved from 4GB pages * - RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if * the requested page size is unavailable. * If this flag is not set, the function -- 2.1.2