From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0061.outbound.protection.outlook.com [104.47.32.61]) by dpdk.org (Postfix) with ESMTP id 7AB766CD0 for ; Fri, 14 Oct 2016 07:37:00 +0200 (CEST) Received: from BLUPR0301CA0013.namprd03.prod.outlook.com (10.162.113.151) by BN3PR03MB1415.namprd03.prod.outlook.com (10.163.34.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16; Fri, 14 Oct 2016 05:36:59 +0000 Received: from BN1AFFO11OLC003.protection.gbl (2a01:111:f400:7c10::107) by BLUPR0301CA0013.outlook.office365.com (2a01:111:e400:5259::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.12 via Frontend Transport; Fri, 14 Oct 2016 05:36:57 +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 BN1AFFO11OLC003.mail.protection.outlook.com (10.58.53.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.629.5 via Frontend Transport; Fri, 14 Oct 2016 05:36:57 +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 u9E5asaY014348; Thu, 13 Oct 2016 22:36:55 -0700 From: Hemant Agrawal To: CC: , Hemant Agrawal Date: Fri, 14 Oct 2016 16:40:56 +0530 Message-ID: <1476443456-24382-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476384425-11787-1-git-send-email-hemant.agrawal@nxp.com> References: <1476384425-11787-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131208970173087442; (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)(5660300001)(110136003)(48376002)(50226002)(68736007)(8936002)(11100500001)(92566002)(2950100002)(6916009)(189998001)(33646002)(356003)(50466002)(626004)(77096005)(8666005)(36756003)(7846002)(305945005)(586003)(86362001)(81156014)(81166006)(5003940100001)(47776003)(106466001)(105606002)(85426001)(2906002)(4326007)(104016004)(2351001)(19580405001)(8676002)(19580395003)(50986999)(229853001)(76176999)(97736004)(87936001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB1415; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11OLC003; 1:+4bbJneCaJNv8fwexFEGijI/nFuoPwrPlr9dC6Hfva5b6pHHncHSf0dQ3O3HBN1Kh2BBW1tpwHA2yIOa3qSuubIkI1g2Huo2QG8y0v2t4rY4fV7fuKo2g0ZVyWVAvRc/rewkUW/Q0qQI5TGB1GWHHhQsPt/IjNynnlDshUKhkK3DUhmfLuLSzpj0H6yJG4BYtLGHDifhQxwrcZsMkvqD1uWL9Ndlm0D3s0PyuBFsnrHIiff/oEfgJNX16BH8zOFj9Q+ZawC2iTVnFgrdXptiwoVfZ6/eczn3bPEu/hH8KO37uvTeZF9vrAYWDwUzIHlmZyagzLyN05bWP2zhWSUm8bZMXVbT2bgyQTuUDfjKqzkrNkokfBQfoZTYaznLX5BlTxgLj8ksMjiy/zJFhce42h0JLcPfyp9XtAzjZCxwtTV6REvjPoLOywRC4b6jmZa+ohxSBU9EstZB2dmF2esElsk5hRrVSYjYb+Cxfs8xny0KyD/rRr4PGyu8nrr1rEHdekSumov0Zkha5qcMiFXOAwj0CEh7me0uqKk99MiLaVkkg641807FjV/J37a2elbgTpoQEXvnkAIXufi0aicP1R9bf+YMUFQkjCfe8Buf3jXHyBNx2iXX0zkiSKl1dGKieCDu+ejN1LDDBvJFff6gfGCilD6fOlLWu2M+bp4P5YO8cR9daq21J4mCLQBiGx+5ESsJH4X36qKGFMynEiFR+AU2FScz86jHFZDooUbfccs= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: f3f9e232-8a9a-4d8a-fed2-08d3f3f41cf9 X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1415; 2:3fkbvY5YUvWlLy/397wpJHwxFAkSpyolAVlAKrcw6byrWly79oQZpT2xymX0J61fiSZ1Td1tCedEJjvzV6JFA2fiUjL6xPVhDDZMGsjfF20RbIzIl72B7BnZV+Ypec6oWEmUds1towTbrm0h7xjWVAiQUH9iWIj3HztW7nAA3H/mL3L02FFDcIabmTbTxBgs2g9M3EjMB8lPhc52TRBXfA==; 3:66MWQwTizqCqdnkkIODQjuulFwZp6F9MD6iJl88HbEVRy5+t5AcpV4XZIUeUOSxdMEabjYM4fRsnSAuY1z5bCPKOdXqiXLPPa5nBc+oksbys/BywKNXi7V7+MWzSxFdKWH/jDsfzqcu/Tl8nguL4e/6hwHouwxpABFIk2B8dQHLj9gsZqWUCmJsOq2m+LUGCbktDOaQ4V0ciEZVFDAjJr0xywceL3XJdhZ2NkESw+GMLQzP7G0/wVTU9aQo+ksTJ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1415; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1415; 25:NF7Twr8+K2ZGFYCWJlXOmXQMlHAQq3o0rf93XsR4HVY7YWtG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CtbzDSRZj/VO5uHsSaZhwQieQ96UlSGVvX; 4:EaneOEN8veuCk1fDXncSh4DcXT7K4piXlbp2dYoUjrrf+92+fa3qws8rjQ9QCkp82AZM/5Zebsu8h7sChmNH6PD5CqiN4cKlYhH01CzLFUQtZeVV/9I0sog/XytSuOjl3NqGDCYVbdp3WPRv/zYWGc9EKDraGDdvz0cXDufC1sniR1nONyHx6xmLf5KiVJbCGHu8U8NnTyM6naZRv+aoMD8dh9I5jSFq9mphJL1Ia8Cam/SvoHCi8gFZ7h8xiWSEYGh/3Xkdha/khDFQmV2+tsDnhgY7/WdWtRuGQL9Mp0tHaKJPYjEXU4SM31ShQOhp/Fj9ulJJSkhYNpo/PxM70q33srI0pZJpfAnx7dgmBXZKrxmTCgWwMdNrE6nh3c41xxRMZc6Lcy4//FHOqahzhS87Y2j8KDvL1qf8aUtEWZOuaWD8p1E1rQ2Bx40tpS/rzZ2Sr6hhfLIfkufQ5qANoRJ/IqLJlxKRWTypK0uN0oqrJx+ItuSHnMP4oOkVswdVCTCENtpJ+bpdGv7HOINvay838o9RQM+ryaW+kBnV73TygzEAVu8504jVsmcjocGr 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)(13018025)(13023025)(13017025)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:BN3PR03MB1415; BCL:0; PCL:0; RULEID:(400006); SRVR:BN3PR03MB1415; X-Forefront-PRVS: 0095BCF226 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB1415; 23:I4WzKhA31Yp8yXXeU/+XgtkWL3+h8wjV/pNQCozDj?= =?us-ascii?Q?pBYl2nLVkie6e2loy/Uf0WHJoQbvE/TiHvxGLv9wx/grkZSgo/ymFA2WBmqV?= =?us-ascii?Q?xdGYwCOVimpnAK0f3i0JXVm5/Rqw9CEY5Xr9BZcm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Ji/sOelnq9i4ND77AfwyjDvPmjGGd9oe8OkJloHnvDnUxDz?= =?us-ascii?Q?1A/4fbFFUHbHNHYmaWNvoX9GpIqRAtVAWTnsczkOesteQ/mnl6B8IiDz1wft?= =?us-ascii?Q?QjLG0PvwC5JlL0aRtDU3IvfpNMXFucm0+5C0vakiUJrKKaYO1oVNFnbVJsE2?= =?us-ascii?Q?1dNZXY3FkpFaAY=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1415; 6:YBijpXsvzxWURDi6p551neru0+1S+IGke0315lZGg75ZbLE7g5XZwoiNn+5MKZ5j3YAz5JZp9/UFUUq8/+No+jcr1sUraAxtHxMPdSbd2r5uHN7/a/oWJzKuQE0hgXVwZv+3IbuLuAWOszEtsPdDEn7G4r8E0+ByjWoRKIvtBN/ZVweaoONqv0CNE5jnfnfNFkyMdFdml++eMbMDg7jsc3viNO2i2DA5lmHpiz+NLaiX06Fev71CtjpuGWJjRHt6Vv/tNUcmzxQnWnkXNbNZxrx3NPiTcYpG9EEsBZuKUTIVQgP4YVUEAs6VL/9HoreM; 5:aRg0QTXgoqM0YLhiXNOCFFF4Cz0MReuGJ6bSYFSNsVkroHVREhe/jrQYVFyzcCkyDTrLlz29frNv30C0WVfWOqM6F4qK45CaZE+3swnRySGz5J+fHistFkIw6XTSPXN5aQVAdiCxdwM8fYB6lctHLf5GLR1i8OwGGXJAo3wYeuXDtaA+DmgfiiDfeWTMIZOy; 24:IL24pN969mwFmg8oUqYx0Pm6HvDK91lPJV5rbIY4M3ukjPGThrFBY6Soc1lL0Y+Rb7OymoNOcC/WRBOrMtvVa9Ua8TtVaSvx1oXQiNioVsQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1415; 7:KBf6kM4td5HFsNuLIdXWwweemj0zZbN0P45sEC7kueyD6kWabYF6UZHS6cbWNHrf/U4HhcGQPChgmJn4RPGlPK3eorKm+te6QIrGKPfv3VQW26ReqT5+pCuUcbR4OAjBn10aZjZv1XeAXKHE8RxC3eFjkHWIlkFlZre849wEa3HWFz2s1aVOkAupwrge6fuITxp6TtYtseWPEuT3cZsIpZ7l0INn4d7cxSoGZ1dYlZlvZ8To5c2S0ut89QadbZd+PnxasKZ58VUdjHyjn8aAJ/BPfqBwi+kcUEx804eiyWyZK4hsxbsJYrzd/9SGza/MZx8pJUi/RZ+3fiQqm6iCp0Czq9hQo1g3NwZe2TOBeOI= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2016 05:36:57.0747 (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: BN3PR03MB1415 Subject: [dpdk-dev] [PATCHv3] 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: Fri, 14 Oct 2016 05:37:01 -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..9cc4460 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