From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0079.outbound.protection.outlook.com [104.47.33.79]) by dpdk.org (Postfix) with ESMTP id CB8F0137C for ; Thu, 13 Oct 2016 15:13:09 +0200 (CEST) Received: from BN6PR03CA0055.namprd03.prod.outlook.com (10.173.137.17) by BY2PR03MB330.namprd03.prod.outlook.com (10.141.139.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.12; Thu, 13 Oct 2016 13:13:07 +0000 Received: from BN1AFFO11FD040.protection.gbl (2a01:111:f400:7c10::115) by BN6PR03CA0055.outlook.office365.com (2603:10b6:404:4c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.649.16 via Frontend Transport; Thu, 13 Oct 2016 13:13:06 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; 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 BN1AFFO11FD040.mail.protection.outlook.com (10.58.52.251) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Thu, 13 Oct 2016 13:13:06 +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 u9DDD3O0019955; Thu, 13 Oct 2016 06:13:04 -0700 From: Hemant Agrawal To: CC: , Hemant Agrawal Date: Fri, 14 Oct 2016 00:17:05 +0530 Message-ID: <1476384425-11787-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471964080-29958-1-git-send-email-hemant.agrawal@nxp.com> References: <1471964080-29958-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131208379869791498; (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)(1110001)(1109001)(339900001)(189002)(199003)(48376002)(356003)(2351001)(19580405001)(8676002)(77096005)(229853001)(81166006)(97736004)(8666005)(305945005)(110136003)(19580395003)(8936002)(68736007)(189998001)(87936001)(7846002)(81156014)(47776003)(50226002)(33646002)(85426001)(86362001)(575784001)(586003)(76176999)(92566002)(50986999)(5003940100001)(626004)(36756003)(105606002)(2906002)(4326007)(11100500001)(106466001)(5660300001)(6916009)(2950100002)(50466002)(104016004)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB330; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD040; 1:ephYN6OGEKsFd0WeDR8riNElFwXI7rDrTE+bSns4iRo0UwI9/PFeZbQjcCOxQGFhazf0gGN6b8w3OpnYwKmjgWLn4czrTJIz2qvgRoXmZml2HV9RVAtu5kAX/Y2vrrWFtVCBjf795CFdNnuCR47DDSD1nwb64wZt4mskRF59IGcOAbCsDOVTnAI8Azh2rt94di8isvm8wu5BUO/effxJ8bWsABVEDDZRQYOnmDgfMvuOazYLsQauHoGTjuHPSA9QSDIiH0toJzKGLw5ybAYNbJjusQZSAm8CiuUUfmjjGySk2ItEqt5PcCezgUUlWVtbxfqDXn6CYbUFqOecW0BAC4SQ7PMwzkrPVc9sMSKcXIKO05k9z+Lz3UYPPJW2XGQ7sHu9pxCKd3n3LYthv2ul9F0wXT1sX/4oE0UVonE7Q+h1Vk32iFrWPX8ItER1xHaZy1eDkU+uQ+lAiCkpB8bqTcPgSa9yoXuFPFQhwUJj+02BNA8rQQeGQsbpLJu52pAL2DSz6b9TfB8IamWC+mNLHRZwD7l4BmmBaCzjEImlYyblreyl9yk0Od1bTZgjXmsMdAuId6pZljaUpSxRmkcKfoeyqkaCSvEikk2Xz95KiemenAt9arZWJNb4JMjMSsSeODh9MyNlqrCFyp++fsQZ/nwZL14rdvwoPI7w9yF3L4HH0AX7M/UoCy+S1jXcYW1FzABEw3650DKVe/iX5OrKL+BVLWjz+fQei8sZSWUM4Nk= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 3e812984-8b82-47a3-23a9-08d3f36aac26 X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB330; 2:qRgbRCvVFoFHNbDSeZIlLhI6RuCEYcbpi2PvOpEOOWi9lpRp2a8r2Ht1WWnagxMosXAHFmsvUPxPPkqeFsBrlrVpv7PXHxirPlxZerGHNHnFqfEHddvnOoZDgnFxgEhZRsWhNbsMc1EfTxwM+UAuiH5HQtRLAks2IO/BGLtVciAuJuFOzzaDug6GGkwBNULZfH3ZjafWOj5FsXh/nzW+eQ==; 3:ag04np8seNF+qvT7V3wcOebr/j4Eh0+C/atTE1PE/7aXhu6KFIJtDW8rNP6tkhwPAY5uSb2ppCimwnHlFKwWCzi+qKxM4VV+rkDeemmaqnL1eVvFNMbsdzDUpKVS4Z28319STGxg5l5fqmMroqrzp60qMaKn8OwdN7iCGtOjG2kO2BfHcUp+HlVUW3L2vA1PLTkwjrhBUjvWuL5giXvul65T2fYD/dzQjNAt8iq7RP3JxMmwHa9OezKx2C4oIEcN; 25:8Oa3JqOq5L1jTbv5LA6aqMfYmyE8BpPYK5VSmQee/RBwQ0On2y1Z4VE3GCkSfKC8RYwZlBv1Tf+wgl0BGX/Vt9vabeGhJIcr/NIZc9iHQizx4K41Mvvx9yJmDwW1u0tQb9g6F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PDKEDQ6lySulpYBQDh0Ti4KYc15nQElHuoj15CMUApvuURnMfaRIZpyh4FWZEF8M5PGYb5BVVczAWnnbqqc2aEecJi9weyw1cGg3Tcn/B1y5ku7oRyxc5BnLpgkUTjvDmRO2NSVG2p4jHdGqAEZmiv/JH2LI/nt8thTfXA2ZYQuDfTJqqrJPmCKn3hGP2IYzmxVtnJAsvdxx 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)(13024025)(5005006)(13018025)(8121501046)(13023025)(13017025)(3002001)(10201501046)(6055026); SRVR:BY2PR03MB330; BCL:0; PCL:0; RULEID:(400006); SRVR:BY2PR03MB330; X-Forefront-PRVS: 0094E3478A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR03MB330; 23:drUL9qhCzIJnV72NhI7JCWLhTXpDiaxwI2qfSta/4n?= =?us-ascii?Q?AzqZ9rtWLGEytPwknczcDZogypAdQgIu1wxX1Y9VClYhVKq+yvbBprDrOBGy?= =?us-ascii?Q?A+ZMKz/9QUWBB2yZJjVwmZFHko1zVFR3rhSIRmuBseksbsEb6Vs5vcdheH+C?= =?us-ascii?Q?5WSJf2vzw4292pNelPf0htUYlWdXRmJEUSPzaJbraHexyMwQxXOpxR8Yd04I?= =?us-ascii?Q?EdCA+dIsCRrrDaXwFEpiWm0DR5uYGFSzfkkpmwRCK6GQlJJxgnQDvBbYzgKF?= =?us-ascii?Q?8us90pu+eZQv2D2fco2kEmT3oxSI7dk4JetMTlY33zTb/9/fsmgaAUJdl698?= =?us-ascii?Q?RIaYrMBcV/c2xENV14i2GETuzx7j39tqHgxal3ApZ3qbeOmZEHeWjiGsZkq/?= =?us-ascii?Q?7jqHC71oUw7F/g+CDyEuiQsR0g8rEAGXvX28vGSof84qsL9P7Vltf52PArnP?= =?us-ascii?Q?kr1Rroipu6lvJ7kfasca2PL3bitpIWEiRYSj4exIax4HLIUUbIWGaVOR0wR3?= =?us-ascii?Q?aaGMHBZQhfzXXw+5UTcyKxdQngkvClqSZkN2d+dHbx6E+EjbuZgfA5XeLzFh?= =?us-ascii?Q?cCuL/0cIdQjN4U7LwULy4MoBSuMZXMpZ96/I00ct5KNUfneFoSg3EY99R9cj?= =?us-ascii?Q?JKI6NfIHlLT9PTMj/H2A7FIg0v19F7g6/vUWomWmLmnPUZyUdWlqII7WeIzb?= =?us-ascii?Q?JwJbdK3+ES+/WToRTPw4ySoH36p14K9TEAVwPwehlc3mlTOyZ9PuupVBs0oB?= =?us-ascii?Q?8kMimGoKNx+cOQ7VUXe2VNIdvatlRUIX/m31VCybQHLHK296WjwrriJxA/EH?= =?us-ascii?Q?FN8C6rz8ha+LYwyjSqJT7VMvG52tdAtaA59Qs4eAjPqteOUnkaEd8EMSEMGH?= =?us-ascii?Q?RTbHmPYMg3NXIyavONP+Jq0AwFSYkiTsJbW5Ie9fmOXgPlkFeIhP4Eeb/06f?= =?us-ascii?Q?0P/SLeVjuNTDHBGTZ+0myoHrKWrSM3E2CGX3jU1sVcRFOAwAqHHI4Osm7sFd?= =?us-ascii?Q?3dTVGT43vNpnRDz2kT5uq3jhUa1lc0gMAJKF6GoSeYESnOrIZnsrq8PVZweC?= =?us-ascii?Q?Jphs78wRZPd1bgUWhFOECltZWFo8S3P3MY44/a4CppzlI6N0NYsk4EDRJHJy?= =?us-ascii?Q?1MjrlbzDbMxPnjKzc6uNO1X8C2/3EBlL9Tt7FGxeWqfgHCSvE53i1gP34Nc3?= =?us-ascii?Q?L0O10ZisETQmsjOPJO9YdaM9cYQTQIRqZpYVModdpYSTcgWbcvUmgpMg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB330; 6:u+m981PoqEzsZX/weKzAPP2ig5YaSGvCzdbf2YATfDUsnGEreVCdmUrDPzLt6uPP39pcobKc/DCaaZb/N90udTdIazW3JewiAbaKYaBxtirxx6ZEOKSg5Omc4eZkepYwQW8t8T7rGeaJM6aFuok0Xsgh5O+rucmkYr4xhNOb0Ecv1sOS3HL9wsq9X9nqmqFpKZVkccGuy8UTBBh6KMPzJHtHCfdgOPpnHZequPOk+sHnrlmIO+fsr0M9lIZY4CX52jysOaj3DBkhdRbTVLbLwc8OqaS4NHJxfRVH/KYYJFUoB2Qzo52cuiiH3hI7NlqN; 5:Y8AXsshisq8+cZ8HiNJlGPbTMVAes4gKgYg75sToNK5nar/W4Ms2FfmlhvONUlxtT/y2iq03caXfKTtMcWi1nPxsbnMYreTF9RGc8p8XRtxCOmVmSsCnyaYIN/tO0f3wXXq2bID6ZNyhNL+JlHLLPOWY/fx1to5VllTvdUNjIBTIvApiGVgOsaeKQi34xsZP; 24:FflbIdstM7CWoOni2sHWBkySc4xl0TkTG8o9/IbMworxkjg3mziPJu1ZJffr/vizw4QyM1vpV7tFcpGsmZxVElqN1wHt+bvfg/Shpx2KfsI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR03MB330; 7:ly4UHyPNB5pGS1Dmp4B5agri8mCH2t3UJlmnPCGvq1lG7Rdjtv57lx+/eypusc8AJt4i2AFF0PdxZ/exSC5gl19d4A2riuK2/h2E0pqFf0jT7j2EJfw3Rq4sGdrCGo5WE25zb79M/BgStpctbk0clNfTHjyMTxiw2/TMiynYWxrwvRkAeMdqCBBph737uyotbipRr9PnwGlUSLMmvY60sFElJTVQhGcoE2wx23zopBgkta8eyHTwkWVxw7EUZPeyN7cJBzyfF3fewTmvXNjVKo4laNTE48nQ7m/ImAN+akCv9s9RQ95AZlYUK3zscs6NqQvtKctvy33zIj4xhMtAwFiJBwP0xg6Dw9tdE7FDw64= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2016 13:13:06.7919 (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: BY2PR03MB330 Subject: [dpdk-dev] [PATCH v2] examples/l3fwd: em: use hw accelerated crc hash function for arm64 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, 13 Oct 2016 13:13:10 -0000 if machine level CRC extension are available, offload the hash to machine provide functions e.g. armv8-a CRC extensions support it Signed-off-by: Hemant Agrawal Reviewed-by: Jerin Jacob --- examples/l3fwd/l3fwd_em.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 89a68e6..d92d0aa 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -57,13 +57,17 @@ #include "l3fwd.h" -#ifdef RTE_MACHINE_CPUFLAG_SSE4_2 +#if defined(RTE_MACHINE_CPUFLAG_SSE4_2) && defined(RTE_MACHINE_CPUFLAG_CRC32) +#define EM_HASH_CRC 1 +#endif + +#ifdef EM_HASH_CRC #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 @@ -168,17 +172,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 +#ifdef EM_HASH_CRC 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; } @@ -190,16 +194,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 +#ifdef EM_HASH_CRC 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 +#ifdef EM_HASH_CRC 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); @@ -218,14 +222,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