From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0084.outbound.protection.outlook.com [104.47.38.84]) by dpdk.org (Postfix) with ESMTP id 480058D3A for ; Wed, 5 Oct 2016 13:53:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1CFofj8s5teuBCc+H7Er5zsq9GE6Z4U2gkqKXi5NOJQ=; b=AP1zICQ3C8HcxdBPpb7j121LzyBCRb6B40VBXT+OYpwlM7FNgUC6Xui5nzfdZzhh+nZ2i3rNeaYFuf0cp2n3MEyIRH3osvgv7JzhJPoL2oSgkyp9m+OzYtigayQbC2JtQvS3ILzXLhuk4L7RnIX/f/Dss2vw/LKzxCZGkcuTdww= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (111.92.120.53) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.639.5; Wed, 5 Oct 2016 11:53:04 +0000 Date: Wed, 5 Oct 2016 17:22:45 +0530 From: Jerin Jacob To: Hemant Agrawal CC: Message-ID: <20161005115243.GA7027@localhost.localdomain> References: <1471964080-29958-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1471964080-29958-1-git-send-email-hemant.agrawal@nxp.com> User-Agent: Mutt/1.6.2 (2016-07-01) X-Originating-IP: [111.92.120.53] X-ClientProxiedBy: MAXPR01CA0015.INDPRD01.PROD.OUTLOOK.COM (10.164.147.22) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 8dfbe9b2-5b15-445d-9e1b-08d3ed162b59 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 2:lG3FJNiDSD6/kp/LJTdwaOUywJ5QdYab9NDmBydBm2G4Bs7dpqcWZKETY5Q925h766H+RM7huprRLisnDG4rvGZV6YXYa/HsSP1AT2/dvWD2rgw04ZbTUnwZ+ck57B/KV6v9b9E8TceoFFonLR6ug5TOKS47dw13YxDbwPvD7ZltuiZH+8sXLq5t1h+VDK7r; 3:7MaRnDeJX5Dvv45NAfikdLHEZUV2fP1m0UpwEGb2DrtGtmUDIDbKp8FbL41eFNxcLn2+vIn6+vT/RxIVUhmjphIcahs9oRv/tdV/5QKaPu5euoj0pnD6sNw4wyQ+FkHg; 25:OnXwc+eifwSK2cV+16l1Ueww+ICNCV5DMWo07TCSiQ2zZpOFBZbi5jReQ4UMG60V0D6FKBbhYVZbGracoqjdLKVENGvl2K38hPEQmsn+qyIfDE1zFJhBHrfqTaQ4v7e1R6CfDQZItwPQNuE+12tlTXeR2WDP/h6/R0eyifOeYwcxcbITAQtIbvFd9BSO5gSn4NBPZQhn+WRzRsQ4X6L/Us5QrAQOpywiXIFRHjidMepqaV4Ojcr50tXDyFPExOYxy2bJe8v3EkSk/5dzOVAPBB1U09vsmuOuhkdVb+sK19wJtEoeYp/tpsxLPjtlTH3lhAnk5j/cPJFXAC+0xzUpalwLoieIi4f3d/taWCHqp3Nng5bEQeMSHFXSyJVlM3g91iq9C8tekNbrcbXNMx8VxES6O59JqZdDuZYrjlP6CIo= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:6r9hiL+SlKdBZAua20Ebw/xWdXZwL9k4JXLcdJRJ7XJ7Oiu2hoarrUZE16xtcQfBN96khFtE5W3g28Truw0wt2H6lOfmFs/L+HhvxsgEnitATKsK8xmNeU7MOFe9xXda6+XMrBURtYqPCea/UWyl0QwzRLJ/OBX8c8Fg05FKDmNJqgKrDA5iWuE2NktK87wm4AsHr3qaHWLB6NMqpB2uCAxP/p1nP6Mtas8mA1QV3sE=; 20:LMlv/utwfq/0knmuv6wsIURfja7mT2opJkl6JbdqDKeFjuysKOyKiWzBaIRzaEwn0yJU+g8N9k+1524QLlP1izTO3pXWDmdY70CnKzzjfplHcgCMeUQB6qQ7EhQGKEHa5PJv2xfYzExBFPDhxOlFvqK81j6pX5Nnm59niMgD1oxA3Ts5U0y/ypqYl3DknWL5IIuL4HRYyW22icwP98yCKzKtHeJTnsgBJ9D18VZ1lpsov1322iAevHMKGRiJWeRtulIdzu5Le2gG57ihEi0jKhcZSbchvc4PLC9hrzTsfDd8dA6U0xcqWaK6NK55VWGmRrsCx9OXcHp7dwdcSBUZIoRzZL2JKIhxgqvOvfJktEd8gpI6xJEVB3QfHU9dCE4o6j/HEqyiqKqh3pKWygwym0hVCI0rzMZrrqu0QwdoB10+9Eugs4Ninue3VyskeYP4LSjCyLyqfBBHP+WQskvigsRbqIebM3d21ORmjyNFFhf/5Jy/dn8jvMH7SIG1T7P7F/gN6sikjZR5x3Hg/RmDDWqOrD+ZFkMaUFMPbsHuFaNxD6ixx07HPyXz35fSr8TqQBKMtYaJwy1IVHMWVE7JdA6cHr14ZodUy2r62cafGYU= 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)(8121501046)(5005006)(3002001)(10201501046); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:O2T1YtOljwdVkXK9vjPF5jV7zDlTyUs3vItiH2C2PDpJxPX60CJtmB6J5b4a7wVaKWVPk+wbvCNSU5eeWO4x9HYuuuW+GX9jnp3ywUlWqQDcFrd2h2e37HY3ygS5GodU2ICbq1/4r8Kb8lRQGWhdIrs3ThOQEWkNmGsjuTab/daslZlxP1HnSvGFhWPAhOSTocVomWjiNEEWF9dD2P7Qb8Wr+yDYkkg9qXKyC+oo5L7HX0VR3roE5Oee8BR9T7UsPKe8uZIv+F67Y1MFXIsiwy4OPYza3HZUbZUhD9bOZuOD/BNHPniTyoElzJzmascZV2WYNZUd4clY+ObQ/7338x35ultCw6pg9gN92TWn8dTMHuU1TCig9PVatNPsoaISOH4tM3F+urDXMa9q2hraBB64EkSkYofTzomffkMRKwAapdvpa+TjMXj8Wg40lwAF X-Forefront-PRVS: 008663486A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(24454002)(189002)(199003)(101416001)(2906002)(92566002)(7846002)(305945005)(54356999)(42186005)(68736007)(47776003)(7736002)(66066001)(8666005)(61506002)(4326007)(9686002)(50986999)(76176999)(5660300001)(83506001)(97756001)(19580405001)(50466002)(46406003)(189998001)(33656002)(6666003)(110136003)(3846002)(6916009)(23726003)(105586002)(42882006)(81156014)(97736004)(586003)(6116002)(1076002)(77096005)(2950100002)(81166006)(8676002)(19580395003)(5009440100003)(106356001)(4001350100001)(18370500001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1719; 23:oPCLIY9Eth5d8v8cll0VaEzGcQtC+mTgwEhfBmY?= =?us-ascii?Q?7ZAgkmvwVVhNUi2eZaoxo3dcYvS1gTybQNApgKfUtTSMMCB7SFn2Z9PP/9r/?= =?us-ascii?Q?NTf6nFp3mFDeJrkwOYh7tQtoz2hEL8Sp7BptnPlNDDce7+GnUYpijRUaj5Gg?= =?us-ascii?Q?LMRPU01wU/9wzPWbfvwlro5aaDLOGbpZu1MiL4Ys0V788xyB3BANzuqE+YDi?= =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InmQaTub/BN6yk3eAg8kWr8ZK3qM00apJpETRrn1Hq7Ks6x0A7Vr6L+CC+UE1uaFS+qSBXxIvdjt5YshMcL3r7v/uLW6btVACrORM7JG0GbBKiuTyVsmYQpcFy36Xr6YKRRiSkj1tyXkz6RP8DZx3qo2ACiei2FgEe7ftK5 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2016 11:53:04.7257 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: Re: [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: Wed, 05 Oct 2016 11:53:07 -0000 On Tue, Aug 23, 2016 at 08:24:39PM +0530, Hemant Agrawal wrote: Maybe you can change the subject line to: examples/l3fwd: em: use hw accelerated crc hash function for arm64 instead of: examples/l3fwd: em path hash offload to machine > 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) Rather than adding new compilation flag everywhere, Maybe you can add #if defined(RTE_MACHINE_CPUFLAG_SSE4_2) && defined(RTE_MACHINE_CPUFLAG_CRC32) #define EM_HASH_CRC 1 #endif something like above to reduce the change for future platforms with crc support. Other than that, you can add: Reviewed-by: Jerin Jacob > #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 >