From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0087.outbound.protection.outlook.com [157.56.112.87]) by dpdk.org (Postfix) with ESMTP id A55525A96 for ; Thu, 9 Jul 2015 10:26:55 +0200 (CEST) Received: from DB5PR02CA0040.eurprd02.prod.outlook.com (10.161.237.50) by VI1PR02MB0798.eurprd02.prod.outlook.com (10.162.14.148) with Microsoft SMTP Server (TLS) id 15.1.207.19; Thu, 9 Jul 2015 08:26:54 +0000 Received: from DB3FFO11FD020.protection.gbl (2a01:111:f400:7e04::162) by DB5PR02CA0040.outlook.office365.com (2a01:111:e400:5805::50) with Microsoft SMTP Server (TLS) id 15.1.213.14 via Frontend Transport; Thu, 9 Jul 2015 08:26:53 +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 DB3FFO11FD020.mail.protection.outlook.com (10.47.217.51) with Microsoft SMTP Server (TLS) id 15.1.213.8 via Frontend Transport; Thu, 9 Jul 2015 08:26:51 +0000 Received: (from zlu@localhost) by bjgfarm-1.internal.tilera.com (8.14.4/8.14.4/Submit) id t698QlMO003933; Thu, 9 Jul 2015 16:26:47 +0800 From: Zhigang Lu To: Date: Thu, 9 Jul 2015 16:25:17 +0800 Message-ID: <1436430321-3864-9-git-send-email-zlu@ezchip.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1436430321-3864-1-git-send-email-zlu@ezchip.com> References: <1436430321-3864-1-git-send-email-zlu@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD020; 1:ZG63XTVG4vGDeGe9p/23+Hahk6gLImEqHYM4oLMlh5HvqPUoc8xgwOmCK3KNtRie+w5n0/E6tNBg+UnA3RcfvMTatu0hUe7Q4lby5UD09qgXXrp6stF1ByY8lMym7CDXxbIlC9ve13HIS/OL0S8iuWR98NtJLSNV2ZEK+/gopCbl+JqLzUVJyo4UDdlcnfFawGLFageQPjBzpDl9TMlzNTL8G/ckb2bFav9PHk92YhWWMCzdErpWIgHVjTGiiDp+dB1mQHSF2qPKXu7guZCxL6NRwIZpp7+1no5Lc6srI63UmEsOi/sCVbMsdxDOECWV60Ov2I1WRoUPTNOI/cL7ogq5unsSwN9Dgt6puGQN2kbq788rLOCf+BgHuPdasEleAkTIUeN70i28jvnUnKLn0BLwbre2K0URMRhzah/97NzO7Ky1s3VjR8RjvkHEetWp X-Forefront-Antispam-Report: CIP:124.207.145.166; CTRY:CN; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(339900001)(189002)(199003)(85426001)(36756003)(50226001)(76176999)(50986999)(5003940100001)(189998001)(46102003)(87936001)(229853001)(105606002)(19580405001)(19580395003)(92566002)(2351001)(2950100001)(6806004)(50466002)(86362001)(575784001)(107886002)(106466001)(110136002)(5001960100002)(77156002)(42186005)(48376002)(450100001)(47776003)(62966003)(33646002)(104016003)(4001430100001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR02MB0798; H:bjgfarm-1.internal.tilera.com; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB0798; 2:xmz/a4Y4NQDnZo1L+7hzehuanmhLkc1VPM7h16xM6Ax5zQEYBFM2Bw3defSrR3mB; 3:lhUzoZ0ZCl+m0rmepuimTb6PM/lxm5bxrNwUQGWTyg/nkMm7tDrBBbc8sqbwU5bt4b2cG9nmNykZ2ug9/4e2GhdqEnW7o3B1JkWPpmwf0c6ew5Jbrs2jCqBKierJ1QLNSLgrxBjRP9d8cFG/I7EjfO5k14cRVPlVp14VyxkGAJ0BJP3FAQi9OkaSC8MTk6v4xSTB9aLYyfOdGifunkngmE954UlUhRYhn47k7s/E3HGs85ckYXdkGKWpDLCv9fqX; 25:U0Wj8agSlWx/Gn2BaGklQGeynTnNvEdh/Iq5J11CQl/aHtNAqc1Iza9+0uYr2aS/eqGEbLqHPLe0mGwNTWH1kJJ5iHUAL8gkxyRFb17V+xXcwXRJMSXkfQluHjNDblxWXHWP6go2x9VfMRAigNH/IZ3qNKh0cSh7VZx4aW6m+i3dAEujrK35aSaHCjtlL8rg2dGL0o2vKTINyzKWgMU/hkl3BGKv5GyRSLQ4bqM5K5UBEmhRnRXrQjOlIaG9QNOn9d0IK4hAF2fIdpDpLAm86g==; 20:CE6aGwNPKo80AVnD7Y/KbsMPz/UvUhd3AL+CwqPR9dry1JohONaKPfQJ3525dVuOyk9Bosd2EVDfPoHmI/mNX4QwWr4TLs8UMD4wxohOKfcKkfyrxnDVRRJ72izngt14DKOFZ6NebErMwCgzUt43Mc8rIx0PnYZjzlzcduH6+Ek= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB0798; 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:VI1PR02MB0798; BCL:0; PCL:0; RULEID:; SRVR:VI1PR02MB0798; X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB0798; 4:LbblHYCMq28Gzhawx/15rCqTQkObe5BGM9o1bWyFl/OEjE1a3PYVnrYvc8HCI/hvI2W83e/5oxbIqqrPnES5oAVFTyNzseWg9e2jjnRt9+M2xLVdQSArYCPIcPyN/Ky3qkJGawi6fihNfdS9aQghY9eCOBpIn8XCqHNpRlQmhVNYaqzsp0B6/lrI88XjJNJxL7gczl2FrZxhGA/ykSuXbdEgUfTAXK3zhTagwz7+N3iKITye4NIKDRtZifQg0rhYEeANSzDlDdnci1fuqO03ymgcwxWG53V/WLRX5LbOCJ8= X-Forefront-PRVS: 0632519F33 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR02MB0798; 23:pJ9ERb57MQ5Nk09zIqAmKW+p0q1vFwP7joawFNovW?= =?us-ascii?Q?KJe3dLjDOYrb6MGGHVs+q0rqLjzinWDqoyQS+9/4buHWKwSGybSirYQgPp2j?= =?us-ascii?Q?Jk3WXHAFtU9zTC/7RQJH0SZw1lqxZ2sOfp0iKzlQcWnn16LHZdUfLUj6e3YB?= =?us-ascii?Q?WDqkkXDNmnu48kbyn2UZIWO61muZ7mkSq8VIouoDpqQHRAjg0xZ6xurrX3mw?= =?us-ascii?Q?Pxm8HgvpOoPHHinWOYor50ED3MipmHPa3EaGSFA/WnaFSDu5WoacyZdj5f5j?= =?us-ascii?Q?vA3Y5bYL2S3kIxB9Gn87teeBJsE1L+SVPbppfXBDOFTUVaUgBWnQE25/PYPX?= =?us-ascii?Q?t6I0cpVdy78XCAjO1w+67/hahRtAPja4n4OPNYEqk39BnddUIpMSacM4GtS8?= =?us-ascii?Q?QWhGcRArbt6eIIBzq/keU9pqXDavjNtnrW/PnStbgqK8SMwCSTw+s2Aksm7d?= =?us-ascii?Q?HpSllNXwowQk48ABBoNh0iM5LzQ9+ixpGa1sczpqxmb5JKZjv4ftt8QHGmtu?= =?us-ascii?Q?g+56g8IeELDXDgdj3P2zKiKfWa2SJHb/Sp60MjVVVBBKHpVdE68Mtc7/M4Ir?= =?us-ascii?Q?mEAV3aUhJjouGQWuAYY5LgYtPrsZZfrqVtjFRjA8CLGpn8TdCS6NpVbYhJdc?= =?us-ascii?Q?gwlAW8ZkkOvSn6reXlWnR1NzmSBBPjuSPTU8NMiQJylKpMU18umUbvR3HN0J?= =?us-ascii?Q?a+Ldp3Na1G43TvFAP0zDBXaM2elB+oiyH8RfF1z4jBmJHrIMgKoUSyNG4qZY?= =?us-ascii?Q?87HqgwWh/nvQTB3yBgRd72N80GF4PzqUPvaX5Bma8D6s6vlZGKwWAry7Pj6f?= =?us-ascii?Q?+feMP8VwRmdZzM4GaZZZp6mlv5TxkXF81X8DrgzPubLP00bMFSPxr5ttHBt+?= =?us-ascii?Q?pr20+zgaBvaNeyvqQaw39Uc1tGry1r9ICCc+B6CBVnUlsx1w7lUz8OGoNfmF?= =?us-ascii?Q?VEvndFAORK9b/QXzFV61IALdIttEdxccn+YFTNZuAlTKIVXp4ULoYEbdUCd4?= =?us-ascii?Q?cyCeKH9a9qq3FRRLRCNvDfi?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB0798; 5:t3TDVBXNGItOyMXQ1RXGRxSqZtqGh0pFrECOuqwcy/UyBDPHyFjpHedXQczmLRe84hCf++chmdgLWW3MRubQnfYnmq5TN8zMFEa2DpbwkOCU4ILNUao7GKXuzQLFYztHmF8JB1szlEYuc8atWXEiZQ==; 24:uv2ne+OX/1ac8m9uYsKX6CLVPjUvP/j/dcRochCIKosKA7x3NZXUq+8f6KYxJhcSc0YtshytNhqLScvtsupSfLbTcAAH63wcw1wLiw4gcGA=; 20:laz6vsvv8B1uvY4RPNOD30kMWDHRljxNR3rx7CypgeGn5NtkZ0YRexdZgF0zDK4TjKgq+Sn++saymAuXmHGUnQ== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 08:26:51.6628 (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: VI1PR02MB0798 Cc: Cyril Chemparathy Subject: [dpdk-dev] [PATCH v5 08/11] 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: Thu, 09 Jul 2015 08:26:55 -0000 From: Cyril Chemparathy This patch adds a few new page sizes that are supported on the TILE-Gx and TILE-Mx platforms. Signed-off-by: Cyril Chemparathy 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