From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0084.outbound.protection.outlook.com [104.47.41.84]) by dpdk.org (Postfix) with ESMTP id 28D32137D for ; Tue, 23 Aug 2016 11:20:32 +0200 (CEST) Received: from BN6PR03CA0047.namprd03.prod.outlook.com (10.175.124.33) by BN6PR03MB2705.namprd03.prod.outlook.com (10.173.144.12) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Tue, 23 Aug 2016 09:20:29 +0000 Received: from BY2FFO11FD034.protection.gbl (2a01:111:f400:7c0c::181) by BN6PR03CA0047.outlook.office365.com (2603:10b6:404:10c::33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21 via Frontend Transport; Tue, 23 Aug 2016 09:20:29 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD034.mail.protection.outlook.com (10.1.14.219) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.587.6 via Frontend Transport; Tue, 23 Aug 2016 09:20:29 +0000 Received: from netperf1.ap.freescale.net ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7N9KR4a018569 for ; Tue, 23 Aug 2016 02:20:28 -0700 From: Hemant Agrawal To: Date: Tue, 23 Aug 2016 20:24:39 +0530 Message-ID: <1471964080-29958-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131164176300772739; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(586003)(2906002)(50226002)(8936002)(8676002)(81166006)(81156014)(50986999)(68736007)(36756003)(50466002)(48376002)(87936001)(86362001)(97736004)(110136002)(107886002)(189998001)(33646002)(229853001)(105606002)(11100500001)(2351001)(104016004)(106466001)(77096005)(5003940100001)(92566002)(19580395003)(19580405001)(450100001)(85426001)(626004)(5660300001)(356003)(305945005)(7846002)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2705; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD034; 1:VHzI1HM/ULK4ckux+uwiAktD2dm/0j+9X4okHLiMJqz0O+jUJhf2iPFvy543ORauc/q7eTgZljJ2RSlMO3YBGbCTmTBpO6c78FN0nDaKZg503tkyFl3IF16mITf31GLezoQkQW4oYLhKe9XzKdDNh2N9G8hunWICE5P9T32nKJkDZ5o4OOMLfQDwVJlTZ57nwr7sFVfRinkX6ca80UKXnI2zveQhSOD75dgoXLdeiZbXL0ncv0EPm03WKTJ1jL2HLg7BJGSD3Y5M2+JnYaDFr211h11lRntaYGmvYE04rq3T4A8zW03hIW3cadtQKQObg0xXB+ShMgsMxC2ZfPCkWjw6dNMFG2FWTS5+b62LHA1gzrUmTew5rqhy4EuMs1WCiWwUkYXhi0/Gbg/FpT1SPkj4HCZ4VbPqvt/SVBsKWgNX2fnViyH3krKseEbd/PD9/UGHbgegyEFaac/dK5+ya6B57o0Qjc4nXRiFqatUSVE0GDHhho7CD0SpgcQJHj7vrPmcC0BUXnNWfagBMnUjD5h4u9eLIblnyEL45cEqBYzYzMV8MG3Z4U93g/WFYMjVqpyd6a8TDOQq8fOYCGjfgQ== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: a0eb8f6b-d5f3-4e3e-a11a-08d3cb36ba0b X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2705; 2:Fl0L9pInZAPl+0sYG1V2zLPF8CfE5tHHRbIqce9fNP38f8F6YR3ZZCQkRPMNwe8CLMIQ2G8erzLhWO4qGTnzpBoPTiof3LQTJ6HOB7cJciPlblg3fGMqLWwVlEo63jVlAppQiZm3eMxuk/WDIA04RBy51+gGPgErNKV27ScKXoboaidAKSNRG/B4+N1GJuLr; 3:sK36qW3gWCOxn9RwIltz2i/FFXOhqIignEsNjfszRqaatWeeuK0sfjZzDSXnajkD2mL8zffpgqiIiNllYReq+W8mxNWJNklGtCbuaVBOUPirzmsHSt58rvFnktR4LpmOxIJAjJIkLuKuTyZmX45h6UVLzzqFD5s5KnO6pPJrdSrHGya+T0GcszA5kSiIUIw0tvzGXQeZPxgk2iOhFdH1/sXlD5dtTXnzmn7PMFqM/Ko= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN6PR03MB2705; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2705; 25:HTQA3dgU3QSNEuGIaxRbPsIopSE7e5r/J5fz7DWBD5qOfqXFelQAFD7+hbVp2+NzkfYKUwpqAohdfPuz17Zc2mMIj1bIoe/LQflKzRyjJBf1LrtUSDGx5Zs1YASPyaVLISfnIFusdk+5yvlwhaH2AGS21ViW6Amuivv/wjmFMq/ynowx1wIgV22975SeKbjWQNURRDpFV3F/HB6WUF41DpsXborhQD5SzjQXw0FG9sL4d5IYoM+9lZHDoYI6x38q7KszTO+1BozlMkOLunR1fnnYbozncMzdFntP+LDsRt76+57sRPbLuixHbOkch3xun11LaSOmh1pzTLnzD2HGkHGuUXxrk95U9CEmaUQEM5wrNZ4t8htb69U+Jz1ZWgvZbHYEeOKqJH08MA+bPavEylLFnhGt1CAHGEcRxVKDFAH3BgtnkCa+jXO0LEf+y9EJJPm1KlhVlgrKq/e9DSdphZb0LyrR7u1mV7Djx4K+HrPJ7qC7BaouzXn54EgrB9nQM3R6VxTaJb9FmEa4wcB0Z2NXtG5ym5yalmGmuMAHQMyOVLoF0tJFbzNyAIqvm9JBJmF1BkT+Ldyolwppb5AURLqFjouk6OYEN85SxZ9jQ53xj1szJonbFzrdBA5MuF4L+bDOXJdqO4v5fMUs6eA/TS3y+Roef31XrhGe33bt6jPTXTKhq0347U7nHbQ55ftwlXppgXCEvRdA4YIDewLP5A==; 31:jti3RPyRZSSuQcv6fp9Ipx8FGly/E8xK+5mCiDEHFBKPEEXLeFCP50RBvrQB1TM8svOBZm/FHCYXbGGxgcEWaPKAgQhH27Ux+nQJcWQLSOgzM9p7Hkzrc6azKj9zGlsUeBcQyYZpn964QoduTpMTa9Ic3MU1weQHod6oL87QWiv11nCwNy0HmTBjWorYtG/wU5sv/fnYj0XnZZFbeHaV10a4i7sGbAGKDnuuyaricFk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13015025)(13017025)(13023025)(13024025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BN6PR03MB2705; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2705; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2705; 4:coCSnF9VOd1tF5xkMXBNMnAhsBhc487FJBadjSmcRqvmMfWi4P7rF72vXx6i80cH4/SGysPVkH/G9WnMLqdt02zLWLkMLTs39RCc5xbbicGXH+PTrXELzMWGG0X5c34hWD0eXyUWaX5vQL7LDzVxVO3zF8Z09V9L88t7Ts0O3/QNiddD4fUqpGPKMjSe9k7Zl6uJ2lMAAuvwhGXdf34QlI2uk8vTcxcUQ6S4zeWYEngVIxgktT9Cw5CRX0DT+ODiUm2TPnoZRlZ14LyOfb19DZtx7WfnJp0j6Ua1VgyMURXI+DaPzZx0adrLt1givg4/Co/bB7VO/bKYktgv3JyKwbbUI9XVjuxkdFPwF/g8HWDnsX2F1It5jbstmM0MbHHD2LZBGr94TmT7SB3P7iMLTDUKH29IY0qLo84tohrd214bLHEBI37hk+gPlt3tP92Wn2jip1hqhVyr4DRwFbLtoJOJ2IxoBDzP1cCjPmJLIUXIn+tAeFDZ6rvvXmgQ31sNuQz1QBi1xsSgh4Ab/g9HquOeIR9GjZZ3hroQjedyrzA= X-Forefront-PRVS: 004395A01C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2705; 23:uncPBLhTjoDOsKb6lK53Fz9sdiDBI3Yp2kPeg7K79?= =?us-ascii?Q?DLPZbEwSL0RnnO5sVBYcZAs0NUKEFYY4qAYFlp/0yOduqI8R+l4QuE1k8ltA?= =?us-ascii?Q?azv4nJNNo88H5MP+yEFGen0g6JE755U5fz+XAtwj3eWA56qNIFkyGFf0Hy8h?= =?us-ascii?Q?bXV6rOcCj4gU+i6RKiE79sXtQ9c3wIGUfBLPesOqK1oJo40cFC6Mp0AHMqEb?= =?us-ascii?Q?YrLgn/QswDUPfZdNC7th+272M4zCNkjWucMUnWC9yxg0omUnjFHLx/a938he?= =?us-ascii?Q?L9VQB79+pg4e/Pm4YkUvaoJuEJpCg8J0WpazsMp7b1S2+JSqd6EMpxuCa2nx?= =?us-ascii?Q?nNaXp8zV3oJ7hspqjgjLIEuCpjV0syq1k9uM8/Wv4GTYPpOk56NhRfhozacU?= =?us-ascii?Q?4r794WJNY3rs25MDkvwZFS5HZ0DFVTQ62JgWjP7yq4BTdIQNkVuwRasmj933?= =?us-ascii?Q?EHsizfvllueeQDq3+6cTXTt5R9s8KamF1h411nu3H6Znx5jXVplzyVhPJF/+?= =?us-ascii?Q?IsLyaewxg4/UdOFWm/PQNClxW4qmkMbyn4asQNumL+FlxaGgmY49Alw/czsN?= =?us-ascii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xOlSUKrFBKbDHkOHkcxgxvlOIuvAAEbErZohih3NPQFQ7pI5opZCTzAcyuI5A1/YsPzHAZDMG2ScfaCafoOZwQ+RjnO5dhaA8OwgskeoFedGym6aWzDNlH4=; 24:ZRUAZauN1Tcm18FJMLAwQXGErdbsEy2mJa61N4W/qo+fkb0hbXuT/Ti5dcOjubkBdRW0ALr6jbdvpJa6RAw7egSNuwL+XF0fJrzuXpTUL3A=; 7:jzG6IFQl6yKoNFXhl5SrGOf22o0ed05Bp453tlQe5cnmWnFhjMvWE1juw+VkQrjRF+2B4aWuyheRmwiuTxadUU3plfZQFybDWNAyAYVP4J/+L0R2MC0l4HSvhEN2xnxCIa4JsKzsaB+xaE/1COaN0CnvQUKJw7WzZbsYRvqq1taEssyrUWaHh/vwF54svOt96YfGfXsK1oGnPhCyaUhQq3Qu3Lg5DfQKu9VsTEYNY3hLq81gokCfLxCBPoHvJlj2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2016 09:20:29.7652 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2705 Subject: [dpdk-dev] [PATCH] examples/l3fwd: em path hash offload to machine 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: Tue, 23 Aug 2016 09:20:32 -0000 if machine level CRC extension are available, offload the hash to machine provided functions e.g. armv8-a CRC extensions support it Signed-off-by: Hemant Agrawal --- examples/l3fwd/l3fwd_em.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index def5a02..a889c67 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -58,13 +58,13 @@ #include "l3fwd.h" -#ifdef RTE_MACHINE_CPUFLAG_SSE4_2 +#if defined(RTE_MACHINE_CPUFLAG_SSE4_2) || defined(RTE_MACHINE_CPUFLAG_CRC32) #include #define DEFAULT_HASH_FUNC rte_hash_crc #else #include #define DEFAULT_HASH_FUNC rte_jhash -#endif /* RTE_MACHINE_CPUFLAG_SSE4_2 */ +#endif #define IPV6_ADDR_LEN 16 @@ -169,17 +169,17 @@ ipv4_hash_crc(const void *data, __rte_unused uint32_t data_len, t = k->proto; p = (const uint32_t *)&k->port_src; -#ifdef RTE_MACHINE_CPUFLAG_SSE4_2 +#if defined(RTE_MACHINE_CPUFLAG_SSE4_2) || defined(RTE_MACHINE_CPUFLAG_CRC32) init_val = rte_hash_crc_4byte(t, init_val); init_val = rte_hash_crc_4byte(k->ip_src, init_val); init_val = rte_hash_crc_4byte(k->ip_dst, init_val); init_val = rte_hash_crc_4byte(*p, init_val); -#else /* RTE_MACHINE_CPUFLAG_SSE4_2 */ +#else init_val = rte_jhash_1word(t, init_val); init_val = rte_jhash_1word(k->ip_src, init_val); init_val = rte_jhash_1word(k->ip_dst, init_val); init_val = rte_jhash_1word(*p, init_val); -#endif /* RTE_MACHINE_CPUFLAG_SSE4_2 */ +#endif return init_val; } @@ -191,16 +191,16 @@ ipv6_hash_crc(const void *data, __rte_unused uint32_t data_len, const union ipv6_5tuple_host *k; uint32_t t; const uint32_t *p; -#ifdef RTE_MACHINE_CPUFLAG_SSE4_2 +#if defined(RTE_MACHINE_CPUFLAG_SSE4_2) || defined(RTE_MACHINE_CPUFLAG_CRC32) const uint32_t *ip_src0, *ip_src1, *ip_src2, *ip_src3; const uint32_t *ip_dst0, *ip_dst1, *ip_dst2, *ip_dst3; -#endif /* RTE_MACHINE_CPUFLAG_SSE4_2 */ +#endif k = data; t = k->proto; p = (const uint32_t *)&k->port_src; -#ifdef RTE_MACHINE_CPUFLAG_SSE4_2 +#if defined(RTE_MACHINE_CPUFLAG_SSE4_2) || defined(RTE_MACHINE_CPUFLAG_CRC32) ip_src0 = (const uint32_t *) k->ip_src; ip_src1 = (const uint32_t *)(k->ip_src+4); ip_src2 = (const uint32_t *)(k->ip_src+8); @@ -219,14 +219,14 @@ ipv6_hash_crc(const void *data, __rte_unused uint32_t data_len, init_val = rte_hash_crc_4byte(*ip_dst2, init_val); init_val = rte_hash_crc_4byte(*ip_dst3, init_val); init_val = rte_hash_crc_4byte(*p, init_val); -#else /* RTE_MACHINE_CPUFLAG_SSE4_2 */ +#else init_val = rte_jhash_1word(t, init_val); init_val = rte_jhash(k->ip_src, sizeof(uint8_t) * IPV6_ADDR_LEN, init_val); init_val = rte_jhash(k->ip_dst, sizeof(uint8_t) * IPV6_ADDR_LEN, init_val); init_val = rte_jhash_1word(*p, init_val); -#endif /* RTE_MACHINE_CPUFLAG_SSE4_2 */ +#endif return init_val; } -- 1.9.1