From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0042.outbound.protection.outlook.com [104.47.41.42]) by dpdk.org (Postfix) with ESMTP id B28192934 for ; Wed, 7 Dec 2016 17:30:29 +0100 (CET) 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=6TOYdSiDL86V+iFqLQAY8RfV8VmU8Coke9O335jpOBI=; b=ecPCxOWRwraCbGhaG+p4JdxN5K1gZ6QR7UU5Fq1L6OsDxdwzaeXi3Z9nBUpOc7qztgyL3ol7CV/Z6uRTSVnC/RdyZ0Ku7d/0XV+8QKjgc+ZC30kfoyMNKVYrajcyGKh/CmxIOkrotQzCdqNMZRK0oA3n5djHa948X6WEVcbQFMM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from svelivela-lt.caveonetworks.com (50.233.148.156) by BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Wed, 7 Dec 2016 16:30:25 +0000 Date: Wed, 7 Dec 2016 22:00:20 +0530 From: Jerin Jacob To: Thomas Monjalon CC: , , , Emery Davis Message-ID: <20161207163019.GA2524@svelivela-lt.caveonetworks.com> References: <1480851219-45071-1-git-send-email-zbigniew.bodek@caviumnetworks.com> <3445082.xGUuZ4ynkZ@xps13> <20161206232437.GA26779@localhost.localdomain> <2244872.kAKz40o8xq@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2244872.kAKz40o8xq@xps13> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: DM5PR21CA0043.namprd21.prod.outlook.com (10.172.92.157) To BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 2:87hhMbGNILzVWuztz6d5X+UGYILvuyjGjeZZEPQz5C2sa7OeEyUoRgeCAwcipWpfq3gzFpFT94NvI+fW1cLVNxlpT1j0eCo6mTUbIL9+swH6FMDn1TvTQL5yf1fHOKa3qisnbGmW8ccbw56cPy+HmEX1mak8AKFpccpq6kIvMMg=; 3:NusLjjGyaDN2+GTXrfHCD/zAz5rYdGi/wMMWDdpS20TXQ0jIG6qTZZj18/Afns8PaOZaQ99SX+nFk0opBqNePI+ZGDzKaRMis33oiReaEMpoaBhsVUssefWUQrvpjLG0dKA6IFNIUskHkpeYrXWRKgxKigkZ8Xn3zV904RdTv+E=; 25:3+ttKFRYuwArNDoWE1ppOsKwLr8FmlYxUcuuUB27Xj7DtHxb5WVrNhx9EubC5Dpft6d8K7ClY4Oyv+4HsvA0t3VvGEocs5zBR48uKKjh8vrjG2Wwg4n9LcxlOm5x0oIw70BECJeyzsODDv1ZligWvrku+GaMx5ey00ZHud0d8UzxeiXLk3/1i1w+Jn/5JcxOwOH1dYwy2AVdL1V/A0TZ2V5/E/TquIX+FqS6tHJLWjedXL9lDDeIbPRhkB7nw3mN3Lo9HNKdv18iSvRKkP3oivU3Yy5DdvkeCUgbMylxo92VaTCZMyn7SlmXqpWPRaSpCqLk7qb5fJiQZ4k38WpjYMCKNWRnhfCsUk+w4SLYI6LkPglLbdvuL+vm/Ch/rhXnnsHRqCfnzRkxZs3kXc/8m+idxFIRvHaSJMGbgMLVwqUJGCN+c0ynE94nTLMsvglble5O+Bzrc3HufEYdqGqXng== X-MS-Office365-Filtering-Correlation-Id: b8260b20-a1f6-4fcd-f554-08d41ebe5995 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 31:o//Pj8/x9sVh2eotk/azQLZOU1qJg8ijMkljpyS2sruTb9Yve3QUkYjN+oGr7qFvHGrnT2d24B4yvm7vPt/u06m6eEcPXvT9zOhKQEDNTgdc+PiW6Ipd04PwWRe6rd6VuQoAy2B58hBGvnT0aojYvwlsKW88ZtTQzR4UU7dPlUpxRH4ScM8dpXtHY8MTQ3eMX0iRmHGuPVAx2ZweoOWid6z00VokJfSnnBkFmg/ytn5Qs4ZHszhK9ggjeqckdaIA; 20:5aCceWRGdSgrIfwAWbkseez/mbmBfIH/bPqLdcia3KZSOTNmysnWph+FUFKz6Pi8VvInO35A2K7aVYvmBcDFsfqN3Ekgww2jQ7Z8BJgezSjLVwdEz2I9Maewlffaf2Mqwc2SmeXgBPrqEC9CHyhRYSJDbohK+CcetqUYMTV9GsWn0hf5WzfWIA+1i47cbWAdfBtCARYCLB6sBjoUoz86tstpl8AGurEMxdvLjUwl0WD9LlYzI1zjranZb7TPX4vxLJFGhhPGVjXsFateA0VwwWbOqVVR1lVjHb/nCfXYLOzdgPH4UYq5yvDGX6dlx/3mW0g8ZXP6qqOk3Xe8JYgO/dDz/GnUS+MMkx4EVZG9B5RE4eRx++c3DuDe0ZcDnACALeZ8fcy/tH9dWd4gu4RGOdkFaEKeenWf/BiOlnWRQllC/Q2bLjErkedvkH5FWYAhh5MGbWA3Bu4GeRU/nzy5K2OKgAQct2T7/zh4SJ3IfAyTkVn1DM5Z+sLJq9lWMN/eVrm4ZSIR5rPfFjTj9fg3zDlOBNClHH0+nn76k7oWYDXAx3jvj5o6WZ1Yu00NOP/4R7tFQTrPbZD/6Zr1kDP3FhZmtPzsfy1BuRZq2SJmweg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(166708455590820)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 4:xQ0ReItrM4/bjDla50gbe8p5b1ChKXEK2N4j3cAkrq+CiR2wvLWoGHoRza0WjUk5BXaApFcJ+YICed4cymcdo8x6zg4xpD8nQr/oIHMOaHiLkL3wnE3fG9gc6k6QUfwBHTQfKunrn6TYATvFtKaF3O8LStR8k1BMwcnw1UzLSp2hNValaJci2fpaRuQG2mFkzvaTRnU/a2oFZpMEHH0veO7klLTeexo/cbWyGpRoZrIX2P//vX4znZmVdao5Zmxoek55Y+wH/YUpbOWEepo3JQw8IRLn4OCySWixnRxpZSnhofTgmGOosmNgVfnT5sVSz5yjbl5odm/sKzmZb1GX1gl5gh8/QjdxcNP3tq1TpXI7st6usaRLiwpH1v1cmugB/0PhRnuiwnRAFxOHvfLWmlgPMETo8CPS88/tOLFYJ4gv+oD11HFgCiPVmIm0iw8ryF6SHgQju4Wz1l+gRK6RPDyBPO1giV/vLh1xb/6BaGkccKINV4NuozV7XckbRCaTRK14Z+OxxQAq6lOVSwsf7r7lSV5lxzft1jlLJgeT4WaspKojT67lJIOxErh61GSPDeUD7xgcgwTyH98PlmiPJNnzjl+HqRcarMemQpWZl0Yf0SqQXwuQrnC/KoZ/Gi5nTbCNmg+yYyFwnw6FvOA7Wg== X-Forefront-PRVS: 01494FA7F7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(24454002)(377424004)(189002)(15395725005)(4001350100001)(3846002)(5660300001)(33656002)(68736007)(6116002)(97756001)(1076002)(93886004)(97736004)(53416004)(4326007)(42186005)(50986999)(6666003)(2950100002)(42882006)(6916009)(23726003)(106356001)(105586002)(66066001)(101416001)(92566002)(9686002)(2906002)(54356999)(110136003)(76176999)(47776003)(8676002)(4001430100002)(81166006)(39410400001)(50466002)(6506006)(189998001)(81156014)(7736002)(7846002)(46406003)(38730400001)(305945005)(229853002)(83506001)(107886002)(39840400001)(39850400001)(733004)(39450400002)(69596002)(18370500001)(2690400003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1724; H:svelivela-lt.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; BY1PR0701MB1724; 23:5g8vhUz/HxjgZucKLK1O0Vaj1R4BETsd9fswW1n?= =?us-ascii?Q?e7bea99L6uwiVMQI9qD3SEVR2U6tGW8qx7kGf9BTcV2FXrQD0ABwV5nM8hnR?= =?us-ascii?Q?8T9DPEkCa3cUyFB2JghQIBWF47ujTXfApNoXqUAp/GhITgCXk+wpnTrF1iYF?= =?us-ascii?Q?bkXCik8jn8DgvjfCtnqvLAlxsMZDAlUp8lqVT5ly6pxQEVCHMRhlkrCjugj/?= =?us-ascii?Q?P1nRydZsxTQMHVdRoe/rmvnjhwa78MLdBeRNvP2fouSZutV9MIazlnk++aoY?= =?us-ascii?Q?dP+dne2a2WpAalbwd2RIac3hcJx4/OXF3/QdpGNQw9rbLKHE6FfM8bnp28w8?= =?us-ascii?Q?cQYh0yTEM+5nCdYSoCaYN9EpqjBqbBb4H+qs3vHKCYntQT4p15OFwMikhpLD?= =?us-ascii?Q?TGwWlJRBkTPoeKTS9Pv4DQtUl67uTF+f89XRRfLteJEH7q3pHRREOzpoMjva?= =?us-ascii?Q?gD/VbS4fmsGdIySMRbVkkgPzhJi6tRVYp2gnscZkYMdBo2pl46OnyjMNbVW2?= =?us-ascii?Q?2ZP9twcxeMJbN4+8OcKjiuUpLnleA7i45RqlLrCLFlTcI5ZSXSz0MnxSf8BA?= =?us-ascii?Q?LK+7XIXCz78ptIc9FUBbK0EdC2/2n8oaFUQaaoyV5b6Qf4vsf2I12+yWq2Dw?= =?us-ascii?Q?GxU65EK8luCYFBzfbbbBfJYXxEFBnMH7bV8yN4f41J1VBRdB0xSbBqK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uKq6TnLwyOAc1DvkGDXRrQn6obo2eUWP/ktFkANwKzwdizaZ4mBl9yVM1lX9NS8jQzLRgYuqeDGzjLB9fM2mSswjQ4evFetm0hEVdHWdCXYoyixWp2peLoXjGPBb/R2N6JBUwH5XAg23leI4p8m8iBKLc0MZO+y/61ifjrhWsEwsDWvI49IWZ2TCzgtCDgxp8E9OIabvkxmZgkckWvrU9HVYirsYK6hzIZ1rX0Ej8X4Xta/wVS31/yuZpIlaHMS2KF9L+GIAJ7yAOXBOL1UiUNZ6Q4P8Sz03RtVQhgqZwLAi5pHftYHXLLbNYYSstb0SDwJ5o449GYQGTHwjgfeWBs64=; 5:6nICHY2xf+yYcT9Mcd+9OUVLEKEg7m/8O3IqPGjJh/W68nwZb5dtK5EDkWFRhiMkCDtemhJotUZXLt1kJC2HZdPHUBklKvKuYxxHzb97hGn1lWQXEf9iPlX/vp1zTNphdryq2P85A4BOqA9x/fCS1A==; 24:TqPasTUFDyuLciBn2fFZEAMjUfvFhIajAvauubL1wghNRTvGD+UqZvvm2FJONBUQnN7E90V82NBlq4vpSxYp48dwl7d6eAdTF7NTajVI5FM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 7:iwTuLwtEtJrVjpOV7VMAXstYfNrIhQOcsc2KmFPnvhZoCvV5EbNHOSWrae3ln4XaTx0ZyRwR6pelhW50Wuiqi/N3kZNUm6+dCWSbH2gwsOirYfnPTpa0iKrAqtN5Ty96CVXouUvCMEV7ennIc6DY0XnCDK1xWRNC7FXnxi1HxjlUMfu/M4YuPDBATMwtoDY07B518D1cGqAvez0DVegSdoEPwsNp9Di1oU435sMiCAU/DBq1R+P1Fql8AYuix980KAz351buaWTonzkj2A6GIFuey0dxBpmf5Tm5DLMRfwO4bxqfOP3DflQYWm/wPRbjhdQq1A/4Z/rDX6vGA4fBVzI/tcCXu6b16qFJfiNAbJs= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2016 16:30:25.5136 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1724 Subject: Re: [dpdk-dev] [PATCH v2 03/12] crypto/armv8: Add core crypto operations for ARMv8 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 16:30:30 -0000 On Wed, Dec 07, 2016 at 04:00:07PM +0100, Thomas Monjalon wrote: > 2016-12-07 04:54, Jerin Jacob: > > On Tue, Dec 06, 2016 at 02:41:01PM -0800, Thomas Monjalon wrote: > > > 2016-12-07 03:35, Jerin Jacob: > > > > On Tue, Dec 06, 2016 at 10:42:51PM +0100, Thomas Monjalon wrote: > > > > > 2016-12-07 02:48, Jerin Jacob: > > > > > > On Tue, Dec 06, 2016 at 09:29:25PM +0100, Thomas Monjalon wrote: > > > > > > > 2016-12-06 18:32, zbigniew.bodek@caviumnetworks.com: > > > > > > > > From: Zbigniew Bodek > > > > > > > > > > > > > > > > This patch adds core low-level crypto operations > > > > > > > > for ARMv8 processors. The assembly code is a base > > > > > > > > for an optimized PMD and is currently excluded > > > > > > > > from the build. > > > > > > > > > > > > > > It's a bit sad that you cannot achieve the same performance with > > > > > > > C code and a good compiler. > > > > > > > Have you tried it? How much is the difference? > > > > > > > > > > > > Like AES-NI on IA side(exposed as separate PMD in dpdk), > > > > > > armv8 has special dedicated instructions for crypto operation using SIMD. > > > > > > This patch is using the "dedicated" armv8 crypto instructions and SIMD > > > > > > operation to achieve better performance. > > > > > > > > > > It does not justify to have all the code in asm. > > > > > > > > Why ? if we can have separate dpdk pmd for AES-NI on IA . Why not for ARM? > > > > > > Jerin, you or me is not understanding the other. > > > It is perfectly fine to have a separate PMD. > > > I am just talking about the language C vs ASM. > > > > Hmm. Both are bit connected topic :-) > > > > If you check the AES-NI PMD installation guide, We need to download the > > "ASM" optimized AES-NI library and build with yasm. > > We all uses fine grained ASM code such work. > > So AES-NI case those are still ASM code but reside in some other > > library. > > Yes > > > http://dpdk.org/doc/guides/cryptodevs/aesni_mb.html(Check Installation section) > > https://downloadcenter.intel.com/download/22972 > > > > Even linux kernel use, hardcore ASM for crypto work. > > https://github.com/torvalds/linux/blob/master/arch/arm/crypto/aes-ce-core.S > > Yes > > > > > > > We had compared with openssl implementation.Here is the performance > > > > > > improvement for chained crypto operations case WRT openssl pmd > > > > > > > > > > > > Buffer > > > > > > Size(B) OPS(M) Throughput(Gbps) > > > > > > 64 729 % 742 % > > > > > > 128 577 % 592 % > > > > > > 256 483 % 476 % > > > > > > 512 336 % 351 % > > > > > > 768 300 % 286 % > > > > > > 1024 263 % 250 % > > > > > > 1280 225 % 229 % > > > > > > 1536 214 % 213 % > > > > > > 1792 186 % 203 % > > > > > > 2048 200 % 193 % > > > > > > > > > > OK but what is the performance difference between this asm code > > > > > and a C equivalent? > > > > > > > > Do you you want compare against the scalar version of C code? its not > > > > even worth to think about it. The vector version will use > > > > dedicated armv8 instruction for crypto so its not portable anyway. > > > > We would like to asm code so that we can have better control on what we do > > > > and we cant rely compiler for that. > > > > > > No I'm talking about comparing a PMD written in C vs this one in ASM. > > > > Only fast stuff written in ASM. Remaining pmd is written in C. > > Look "crypto/armv8: add PMD optimized for ARMv8 processors" > > > > > It"s just harder to read ASM. Most of DPDK code is in C. > > > And only some small functions are written in ASM. > > > The vector instructions use some C intrinsics. > > > Do you mean that the instructions that you are using have no intrinsics > > > equivalent? Nobody made it into GCC? > > > > There is intrinsic equivalent for crypto but that will work only on > > armv8. If we start using the arch specific intrinsic then it better to > > plain ASM code, it is clean and we all do similar scheme for core crypto > > work(like AES-NI library, linux etc) > > > > We did a lot of effort to make clean armv8 ASM code _optimized_ for DPDK workload. > > Just because someone doesn't familiar with armv8 Assembly its not fair to > > say write it in C. > > I'm just saying it is sad, as it is sad for AES-NI or Linux code. > Please read again my questions: > Have you tried it? How much is the difference? We haven't tried due to following reasons, 1) It is a norm in the industry to write such things in ASM.So we have to do it anyway. 2) It really takes a lot of R&D cycles first to write it in C and then ASM. So skipped the R&D part and moved to ASM directly as we need to write in ASM anyway. > I'm not saying it should not enter in DPDK, I'm just asking some basic > questions to better understand the motivations and the status of ARM crypto > in general. OK > You did not answer for comparing with a C implementation, so I guess you > have implemented it in ASM without even trying to do it in C. > The conclusion: we will never know what is the real gain of coding this in ASM.