From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0061.outbound.protection.outlook.com [104.47.40.61]) by dpdk.org (Postfix) with ESMTP id 5EC42370 for ; Wed, 7 Dec 2016 00:24:47 +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=PT4ur056ZbNUU7BfpxnFDkpy72WNoQcw1+Otp/4IZtI=; b=fRwvxGVPsPH/7QcupjPbMRuktJqIVKQMj8+k9My+mWMEfLBMj3mT9LPkmZrFdr6om8x6ExWL18z+ytknnbi944NM/F9Qz/YQA4O4sjd+cTCabYjJWc152TaqT3IZpfQyAGokE1kjacGygjEc8kl2IdTAcBuVj3LHWSa94iyZc4g= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (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; Tue, 6 Dec 2016 23:24:43 +0000 Date: Wed, 7 Dec 2016 04:54:38 +0530 From: Jerin Jacob To: Thomas Monjalon CC: , , , Emery Davis Message-ID: <20161206232437.GA26779@localhost.localdomain> References: <1480851219-45071-1-git-send-email-zbigniew.bodek@caviumnetworks.com> <6384628.bAnifqqFcF@xps13> <20161206220502.GA23846@localhost.localdomain> <3445082.xGUuZ4ynkZ@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <3445082.xGUuZ4ynkZ@xps13> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: SN2PR17CA0030.namprd17.prod.outlook.com (10.169.188.168) To BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 2:7wRyPazqa8G+JBE80KDryXq4/KJeNommIuRjgmttgXg07KazC6zW9ZrdnLrHd4X9N/1p1Yr6iq0EX2Z+qsCaT+nBuVGiVVWQ1BZBxwU6PXA/TmT0SoJGwAFI9cfCvtqOqrLd9eXF0Sh6qFUbDlEpH1gCyv85Lk0BnB3v8PdHkzY=; 3:l8wWExwdoP5JU4FmwWV8ApLB4qxwA+1ShF6uL6LzFIgmLZn+1xeiQIVjuCUdgQW2dws/lpj/JGYHE6/IoEaBZfzyWuwIdgDYm2qAWxxWpn++3ISNEfbErZt35fPIJbktynE5dwpx3igFHcGQ169Z+//Gp91Zdl13ayozKBIQy9I=; 25:cpaWcocVvOPdGUSpZUZyLBi0JvGZaqWGZT3klciLcx9sX6PBiju4Ak7AnUazY3OQyxZ7FA7WsU/KwtiMTfqEvG2or8lh9IkSbI+/tuO/YI1L2cGpETxfPvLWJ/Nxj6XVSbSPu/i55l8wPo//mn36R/LKryWTBIb9b7IqQlFExalHWrU/AJWBbf9Wuj6XVl0n4TjD7lV8memsrD7D47mhJ8IuYqtz8wTcgrBQNnlFr87MMu3uJM3Dmu0LKEMO8t1GmtBzk3AF0XFRcfn2z6JouzfbW00eyuCE9nqqRfVSpC4+gqzyTGsc2D31T0JsDZ95KrOWwWtBb6RXgzlXUdqOcfeni1LNCdituT1Rn/Z3ZXUerEV66oNx9sn9f26HWsfLLtlkitQEGM97ZGA440yjho3byogiXIufXwBFA2xkm4V+VdNrr1pIogd+MZm268YVZV/+PU070ZQIPr8efYxyzQ== X-MS-Office365-Filtering-Correlation-Id: 9649bb61-cb8c-4207-408d-08d41e2f0f8b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 31:8d4dtoW8G3UwQ91i4n2fQkRIrR8u/K/prhVRYE6CczDs7xG5lE+G6BOhhfc8BYzmxQy0oanzA2IHlSV+FQE5p2tEvxF6jmFC3c0zsTforn45xZY6LvHXHm8Cncwf/ZyKPKkEBxm/z5oCzbRuh+U186YsKBjdDjopfdlBefkuo2gh0940VGrR3/2ZT/MuFNopazDsgbRL7hGA6vrtbEmxh+wABOMx+veBr6usd3M10Oq74RTlC4Iqi+1LjMXCTYjQ7yzlu1gTDGrC20sKMiZ+vw==; 20:ZM/U9FkOBUdFDY0fz989rRIoARYo0CLVQCU9UzWLaF9niSbyjwWyyfaS/RZwBxonbVnAb40nq0t+hT+XkseVr60ABCQLwnqKimEsShnL5MOGH1EX4wr6zdh4nJM5xIr6iPlQ11iqOhSXYvtzKnj3eTgai8xX1+gMi0FfzBe+07tL4wsRh7ie+3GR4ZQWlOvuYrQV07q8PMFIuUU3KAko4A8MK36IqZ3BNFA3iD3xSCqOtB5wumTWJfJ0OT1ZoFJ8+OKyTT4gePKPykxXDoNhbNeeXvnNlYAqIaYzps5TTSP2o6vVW2j3neK8O9L55EtGv1lWFWcH0KDFWuAQorlURHyOUMN0pVsxQWOLmc08soRiVVR9y0qS7armf3RR+Pnzw3BVPYJPJ/CqO3slpX6D8ly4zpLmYYfnZ/98iwCXJcjfS4WOwFGQ6fpY5twAnYWe8R+1RKjaVWA5FbpMn+fqDTbIj3xDJNfz2aFr9BFlSwfpavPAHcQ4k+GaMPPXsLzpQG+s51bbI/Ecbst95S8qCaC+mSCalpMZykge18DR2/3PEH6fuDryKvjwf+wLzn1NUT868T5uCLUKCl/vVu3DFjE9csTO52c6bwjvGGsq278= 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)(10201501046)(3002001)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 4:qkfUOTY6t2MasQR1I69Qc99E7pmTrLN9u+eHqdnDE2kSzwajk8DPbbOUoJ7V1ZgXFIvTSX13fHdPnc7NnzNCYlVzwH9SFhvFcqxMErCA27ccawxPBjkJtINMpj5CMqxVD+0ufx/UjUsjwa9QjSC+LrSUCqqSLDtPnSCvWmWi7QvSZ7ditGC90YDUtqeV5rQalsx8YwFY4x76tW4ZzzSfl7Hdy1jZhUBS/YLABQgGbEs5P2PWOwWmHBsQ0tOzkycWwELDW9e8RMgifWHNft7Tc1khZuoTaze/3eeQfp9e+iluCJbpJOMQfHaPYQ08PbOJQV0jTYE7WEePFuf+vP9JClQTpn1e0WrsZlyzDMLZ2s3TT68lsm+9ASW69E5e3oCVXRmMJ/GxYUbp3QV/Bcd+JUBeMBo3ruG3zaArWGtU+JdMv/u3VhmAUg4y/mpX+qSdeh7gHGwE1wnAqH+kyX/9ZqpcAIf/4JgoNgkH31fzKb0QOE05TXGZVLLGCE63ZfAqGh/rGe95xTNYICxYBUv139uyFVzUZ3uw31eFgQ1wj9JdqMwRnhOzamYvwaC0L7dkx+CKvhUQ1RJAk/bRWR+5C4CrSCPLJ4YUhdf3ddVH+IzQ6wIulW0JEpybVXewrHIHpRWD9qT5CQzS8CDC0XNCyQ== X-Forefront-PRVS: 01480965DA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(199003)(189002)(377424004)(24454002)(97736004)(97756001)(733004)(229853002)(189998001)(39450400002)(6116002)(1076002)(42882006)(42186005)(107886002)(110136003)(66066001)(4001350100001)(39840400001)(33656002)(105586002)(61506002)(3846002)(6666003)(2950100002)(47776003)(7846002)(92566002)(81166006)(6916009)(15395725005)(68736007)(6506006)(54356999)(76176999)(9686002)(8676002)(81156014)(101416001)(39410400001)(50986999)(46406003)(83506001)(5660300001)(23726003)(93886004)(7736002)(106356001)(4326007)(38730400001)(39850400001)(4001430100002)(2906002)(50466002)(305945005)(18370500001)(2690400003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1724; H:localhost.localdomain; 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:MJnjacvJuPDtGSpJB6HpWhjNtRdcJoPF8wQA59n?= =?us-ascii?Q?vk+Pe5lGpiESI93foUrFYfcAynAJjETHMfnCvjW0cJp2N0pGMu0ZUhcAJOXl?= =?us-ascii?Q?SLxRrGHcL9pDn5g+YaMLtFFpGFV2QcGWE44VgzVrJYXDwIV/sQ6xxGNbi3oe?= =?us-ascii?Q?QHaxr/nEInpKN8zAoay6B6HuFXAUxqy4m3aJjaX8qNzdLy5Bbq/s7k739ity?= =?us-ascii?Q?zvrt+vSGfSHUWF0BhJH/qWiOXIcFYG8WDVA9sUjNkBOOITv39j93TIHruefj?= =?us-ascii?Q?ahc8OH9O72EZ/wI//D9HUOuwYGwWmdgKd5v33eOAR63uCCi0kJbJVsw8IYU7?= =?us-ascii?Q?j/uNePeukh4NA46ScdiKVxGDJFw/tDtJD2HsRu73vGAhULazyJgmgyAmSBGC?= =?us-ascii?Q?uT14jV/82D5pIvWhvAMXgO9+l9PuKEiwHm4hl4nV85ElmDuabap00hAQd58Q?= =?us-ascii?Q?pi0c7XfosSCaB0v1NRwf1UlO4NVbK3ycZqlmjRdBCKXwcWcgbehEwTj/BVdK?= =?us-ascii?Q?Z94C19g0L6gRni5HTI7GHtCc2BeFFaB0JshOG3JstARaiuhs50B9LKb9BMFl?= =?us-ascii?Q?AJQksJSOyU5GsGHbTZkCJciJmFnyrYQ/yDL/n5yGszopR8IF0n5BxxM9TWJQ?= =?us-ascii?Q?obm3ethLZ2Y69y5rZeyOGBvMGnuy2/BufvnNHoV3arWgnhfRrPEPZ7/AkVh4?= =?us-ascii?Q?EJonQKBCsBE5zelpF62WX5a0qSI3GMm26ONToZVVBy9vKgoecfL7XEQCW6SN?= =?us-ascii?Q?2e+fACW7JIGMtHq2gA0wOB0Qka08oCK0F/rsSlO7WbD3wPGM/Fopkab7ZplM?= =?us-ascii?Q?hkpIzxOonRx/kgfn5Q2ubxkZ8CWArDr54T1OdKMlh7Nt+WrHYCKD5Am0kn6H?= =?us-ascii?Q?/nbpiX+qIMkoI67v6tSn+t1a3kaFEjI6dnqyvlcs02ntsDAMEPwehXbHmPRJ?= =?us-ascii?Q?lScczc15kcrA7mXgbi7qmhlcmGshQ6v/C0GjrIj0HllyaEVw5M2r8k+5pLXY?= =?us-ascii?Q?14Gl26ykpUuwxCVPWfOXSqT0+qKPT3/cyrodE16s1kaVgVx0JgZDLODKGoTV?= =?us-ascii?Q?iA8yIuYW1eddL30Opju6/vDseCEp+8kX1AZB8dQte+tHeQWh6U0e5zjLnYZY?= =?us-ascii?Q?FVM8k19O8iJU0qA11WL2hABzcrYsPCevnZUTPASOIa8AgksDN914tYxe924h?= =?us-ascii?Q?iJsRxeRaLCcBKAoAwueXYQlEx9J2vkJycD8QlXX4r8qGFlNmncVDjSyFwWXj?= =?us-ascii?Q?+xSB1TJPHQqqiMnUm4M2qDrQXpOr22e3tjpVzFKLUCrH6tMDKlgjFuDDStMV?= =?us-ascii?Q?yh5w8WNry+3d4MXNkAPsNe/sl3WamGSW0mmIQkmvUjikLZoGO/XqndJPUwL1?= =?us-ascii?Q?xAxPE2o7sSRLIrgmJnWGALDc0kma2uyZLr4IE1bEsuWGO11MnTiB+RCDJAwZ?= =?us-ascii?Q?nccdc4yVFGjLBMWlQ22d/gvrq46Xcg395I0GqYD2ST+/AsyLVz/S26hm1Yy0?= =?us-ascii?Q?TI6ePKOL9Dc0fFCNEQVAhNu8MikK2mYGBuNY=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 6:JwZ5QYLe7TJsdSFFuo9V0avQyAPXXv9hvqk7VOLoBxYvR4CmapZfbkTRWicvDxFGnCVDpF29BGuyB+LtoSEEfo8KvKIv5H/cqNK7GGh4uoYb9ihMRmyvxemLelAG36fu9n/2dDKMKwQVpJMblS+L1Mq5E2wIzWoG124SVvOComkSdQf7hfXCNqWBj4t81G3pf01RwlYnJdtyNbwmbdU9IjVPqukVFTmCV6z4DwxDSv9j+EtHHcQL6tBMg/fDOtVxLhXj7xgPaMsRsBpSi43MDCw5dyvJnHRLKzAvr232fyPSAHxxoYo7Z+kKuSzP9j42jWojpFINNYQgdnQZP5AKVaFXCIKMN3/67xbh3b9HGYE=; 5:QxopYbTfWTd0dpSGPU0lCyLYY49Ui0281a3xRcUfpAwibOntMypc1+M4X2to0fEAV/ukwoAQjqsHPhSwn2TkqTPNyQrbGP6mTA3B6k5DNjRaB5NVXFSJkDAit0WuU4x/S9swaKsd49w/qh/8OQBxSw==; 24:J+WhrcOZyTAwD2DprtpVqxvKE3oWVAVwzkqd04RzKvFMtCMPhIjBD6+sC2MJO9MR3dfan1/2hKZBjJTi3Pgxhm4hhV4Ato6kH66bMAHQ/go= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 7:IVFyyVpLYQSTwNmYiDehrTCckXaDlVh1CRkEzKzetdomiwL9fMFqheItFWSXlUXNwBt9bxkBLQ4fH6DW+eeieGbmYTsBfYQgrDwF0rvP/W+RWUE0pPPDaNz76tqluk0WREaWiactc5yHWZNLrbRUBICdSbIYgF1JSg6lEPx00b+MV5jqWQDzY5uAIbo4Bz8TEcyHUGjoOJ64u21ViaQOCP4P5XlDRYNbzKmSCbI7rRc5OsjcgBkdIHpLTUodyT/gI3Ia8bzPSbzy10gV5UtmBzVwGJS9+BLDbPVsNJZbLngvlmf6mAcithr5CqUKp90hR2JKj/YbkZtPpAaq3aFCSf9Att6I/zTUlkP2o7+9FiU= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2016 23:24:43.3238 (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: Tue, 06 Dec 2016 23:24:47 -0000 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. 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 > > > > > 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. >