From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0080.outbound.protection.outlook.com [104.47.37.80]) by dpdk.org (Postfix) with ESMTP id A5A913B5 for ; Fri, 13 Jan 2017 20:09:31 +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=IYgZBnpYCjfV+RBQx5HGrK8ya5bcEhVf1QxMSgv4u/E=; b=RqgsZZUgUoe4sW49/PY3gUVijhUsYJ+HUhJnuvpKt9vqwpvW26+oD1F2D8bWCIxhLZkAlth8zR7KDMnu4ykIER1wbv6/EwvsfTUZB9/QgZ1Q9l0MOdMq7YfV+5i5HRYie6HTuWKtoIrc+ZgaAQjK3/zAUocV+FicJIPXxW+5qy0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Zbigniew.Bodek@cavium.com; Received: from [10.0.0.33] (31.172.191.173) by CO2PR07MB553.namprd07.prod.outlook.com (10.141.199.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Fri, 13 Jan 2017 19:09:28 +0000 To: Jianbo Liu References: <1481077985-4224-2-git-send-email-zbigniew.bodek@caviumnetworks.com> <1483551207-18236-1-git-send-email-zbigniew.bodek@caviumnetworks.com> <1483551207-18236-4-git-send-email-zbigniew.bodek@caviumnetworks.com> <356b7ac5-0196-6181-bfc9-06e5d0d5a227@caviumnetworks.com> CC: , , Declan Doherty , Jerin Jacob From: Zbigniew Bodek Message-ID: Date: Fri, 13 Jan 2017 20:09:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: VI1PR03CA0018.eurprd03.prod.outlook.com (10.166.38.156) To CO2PR07MB553.namprd07.prod.outlook.com (10.141.199.149) X-MS-Office365-Filtering-Correlation-Id: 0f4f5b48-0285-479e-d4f1-08d43be7b320 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CO2PR07MB553; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB553; 3:VzSaf+Hjyr6a2Og1I9/TxkYVqeiCIEB7rb6YYJYhkeRqGzNI6dleahWZVmSL6Tx4R5qL9j2vub/19axn8CsInD/QcRXbiL0AyndPe4L8SnBuewDpmjo/JWUVPicFl1GEcEe7aBvvZrkItITy9jZ8poIuRUfNvK37dRoUs41MvhvWSrhztl8MWxiLKpDjuiBmymbFnLTLp7cM8qJxshHPE6YZesZgT2/PU7XI8GYOtFZj9z3Woab2HZtTe57DUAGjOQ/wLadcuYuJ3u0dfhle8w== X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB553; 25:1Vf7Fb6wv97j+lERJj8bfUtP7Q1zv/zofuMX8bbR+2IvfJM9QWtFmf7BZbJtThDu/JgI+k8ll8ufEg2/AzQhVuqwv4IQYusmNZWRd0V6/uUPO3IxdCWfOYLqnoylBvmvaVWGhyF2Z11l+Kf7SnqSSlkGCht08b5PUf9RPUdHaWRJEHWPLvfswEGRV5+olnojvaXlvx/W8qF9arPHLDKHqm0yuojSPaaFz8ZKgLFKp2+CmsrNd9LjitFPPNioYi7XcD8DyGtv4HKFoYz4NwxSD+HQzWc8TA3QR+ST2AZuwLMh+nCyMcKyxQWITmvZNShUAg7Wg8J2uJV4airYgRFCkRaStE1lW0n4L66JBG6wDHSdkEoF0LYwwTmZkoxfoRr7yqtxqTVrt7teTowRClgceSkQF/5w3rBtRCQNKiALKCc5177eWtl+GLJJNQS6iCuBXYF82/6HffzNyJyUqARPEfXfneiTD7a2fNoRmI84FTP9dAg42MD+ebnzNGdkR841duJ6CPK0pJ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yWdD7LyXYqt1VV3HYnxTwj6GH7b7VFNroAm0OQv+LNi9IgDRKBNjF26YmbMzeB5a2s8OROrt8i7hgRFbIbYFnbAZOsjcDzXk1vBYCvQCTGgtk2FA2wprqTog/4EOygAL7WIYGqW++GrbxpUDmXFHSccROQNMfdbx8lyWwX3D6XSSp/RBhBnta20ChnasdSdlecjBrtcfch5x0hWNDK4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(166708455590820); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:CO2PR07MB553; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB553; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB553; 4:tZgq3Jys0HnUy8ejWz35TztnticqFVs2pyGWkIr/VekKKs3slhz91TgwKaSyodQsHR6d+e23XMhdZAqXTbuqR5+V3g/hn+gl99zbW+RnZZ0RLsvLa2V36m+L6ZBhwtuJJoUiO0B/bdzydwBP7R05n3TAjT/gFMaXJnA9BYNga6/gKebeW5U3jKoaAoNGaLWtDmZW6xoB0iXtbrDn+sBHATgg/9ah/RUGxDSPnFqkLFR0EFX74Cf+M7Z+a3+RQs/g5vNs5L4yvw3hXHlpIh5sCVL+nhP8nZem7yR9yZcls+DYAfvdaeBEXJxQYEriLLpNIuxrbo5TWy0nxQ5X0O4SbclrsGml5NY2pYwVPHATYcMQs40UiU/zMBjt9SJK/Qvc9U+gDPAoBCzJstFkCySs/yuAoZx0rDR4DjvvBGQMY2a2NXlUk10t8CiWvFgtNMOgV3F6s7wA/hjnTxji9NxFLWELq+V429EXT6f4pkBbOIAQ0YbK5VVUqZYp4CfyXzwpLSEoNR0dol1QQPwZl9uB2cSWy3JpdIgHSJ5ZTxmDFeKf/saXXNhL/Ood3gX/x1dILMZTfdYzAaH9V+lL3izV2KCRDDHLpsd0i+0o/GXr6q6MCj8QEUGD+rN5ORRwhia+ X-Forefront-PRVS: 018632C080 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(7916002)(39450400003)(51914003)(24454002)(189002)(199003)(97736004)(189998001)(4001350100001)(93886004)(4001430100002)(230700001)(101416001)(65956001)(50986999)(107886002)(81166006)(76176999)(54356999)(33646002)(65806001)(50466002)(8676002)(81156014)(66066001)(64126003)(36756003)(3846002)(6116002)(47776003)(42186005)(105586002)(31686004)(23676002)(68736007)(2906002)(6666003)(106356001)(5660300001)(6306002)(54906002)(77096006)(6486002)(90366009)(4326007)(25786008)(229853002)(38730400001)(92566002)(7736002)(305945005)(42882006)(83506001)(2950100002)(65826007)(6916009)(110136003)(31696002)(27001)(23001)(25001)(26001)(16001)(13001)(14001)(24001)(12001)(22001)(15001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB553; H:[10.0.0.33]; 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: =?utf-8?B?MTtDTzJQUjA3TUI1NTM7MjM6YXNHS0RsSXFMcFd2VTJJaXZGVDVzLzI5N3BK?= =?utf-8?B?Z2NOUGZZSWFNSGoxQ0dpQmlYNW9ZTzJGV2h2akw4OEZsZUhRSTdlQWt1WGJz?= =?utf-8?B?eThsVXN3UzNVUm5ZQk4ycWpWdjdlQjhDZHkxREZCd0lORlhGVmtNc2UwNURO?= =?utf-8?B?aUpFa0hJODFaS29JODMzTHh4dU1NN0lBaWcyaFpoaWMyeWNUbFNzUjIwMnQ2?= =?utf-8?B?YTFtRXFDNHgwOFdrQTFaZ0pGQ0J6c3BHRkEwOU51Q1JtTjZLbnpxZFlMVlVU?= =?utf-8?B?RHl6V1pRWVRlaG44OGIwM0lIdHB2WjVVTElyZEdpaStPNVR6VGFuRnBpQjUx?= =?utf-8?B?VTZQcTY5Z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HlKBV5bi0Ofp/xa40J2gl2xFkpKcNcs88Y2fG33JtvjjAawzu3hrV5RSBzqSzt03J2x3lmtcWJ3olARyz0fapHW1gT/waI4fQttvfnDcL6aM0HWC6FojRESN32Hz9VKtdyJBZ4a95n8CUuh0N33kL93buo82Wnm0Uk9yX6QCTXPp2ZyOKL70/ymHME5I0FXX5mtH0qrtxCiD9MT/XK0aRwWOg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2017 19:09:28.2470 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB553 Subject: Re: [dpdk-dev] [PATCH v3 3/8] crypto/armv8: add PMD optimized for ARMv8 processors 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: Fri, 13 Jan 2017 19:09:32 -0000 On 13.01.2017 08:41, Jianbo Liu wrote: > On 12 January 2017 at 21:12, Zbigniew Bodek > wrote: >> Hello Jianbo Liu, >> >> Thanks for the review. Please check my answers in-line. >> >> Kind regards >> Zbigniew >> >> >> On 06.01.2017 03:45, Jianbo Liu wrote: >>> >>> On 5 January 2017 at 01:33, wrote: >>>> >>>> From: Zbigniew Bodek >>>> >>>> This patch introduces crypto poll mode driver >>>> using ARMv8 cryptographic extensions. >>>> CPU compatibility with this driver is detected in >>>> run-time and virtual crypto device will not be >>>> created if CPU doesn't provide: >>>> AES, SHA1, SHA2 and NEON. >>>> >>>> This PMD is optimized to provide performance boost >>>> for chained crypto operations processing, >>>> such as encryption + HMAC generation, >>>> decryption + HMAC validation. In particular, >>>> cipher only or hash only operations are >>>> not provided. >>>> >>>> The driver currently supports AES-128-CBC >>>> in combination with: SHA256 HMAC and SHA1 HMAC >>>> and relies on the external armv8_crypto library: >>>> https://github.com/caviumnetworks/armv8_crypto >>>> >>> >>> It's standalone lib. I think you should change the following line in >>> its Makefile, so not depend on DPDK. >>> "include $(RTE_SDK)/mk/rte.lib.mk" >>> >>>> This patch adds driver's code only and does >>>> not include it in the build system. >>>> >>>> Signed-off-by: Zbigniew Bodek >>>> --- >>>> drivers/crypto/armv8/Makefile | 73 ++ >>>> drivers/crypto/armv8/rte_armv8_pmd.c | 926 >>>> +++++++++++++++++++++++++ >>>> drivers/crypto/armv8/rte_armv8_pmd_ops.c | 369 ++++++++++ >>>> drivers/crypto/armv8/rte_armv8_pmd_private.h | 211 ++++++ >>>> drivers/crypto/armv8/rte_armv8_pmd_version.map | 3 + >>>> 5 files changed, 1582 insertions(+) >>>> create mode 100644 drivers/crypto/armv8/Makefile >>>> create mode 100644 drivers/crypto/armv8/rte_armv8_pmd.c >>>> create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_ops.c >>>> create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_private.h >>>> create mode 100644 drivers/crypto/armv8/rte_armv8_pmd_version.map >>>> > ..... > >>>> + /* Select auth algo */ >>>> + switch (auth_xform->auth.algo) { >>>> + /* Cover supported hash algorithms */ >>>> + case RTE_CRYPTO_AUTH_SHA256: >>>> + aalg = auth_xform->auth.algo; >>>> + sess->auth.mode = ARMV8_CRYPTO_AUTH_AS_AUTH; >>>> + break; >>>> + case RTE_CRYPTO_AUTH_SHA1_HMAC: >>>> + case RTE_CRYPTO_AUTH_SHA256_HMAC: /* Fall through */ >>>> + aalg = auth_xform->auth.algo; >>>> + sess->auth.mode = ARMV8_CRYPTO_AUTH_AS_HMAC; >>>> + break; >>>> + default: >>>> + return -EINVAL; >>>> + } >>>> + >>>> + /* Verify supported key lengths and extract proper algorithm */ >>>> + switch (cipher_xform->cipher.key.length << 3) { >>>> + case 128: >>>> + sess->crypto_func = >>>> + CRYPTO_GET_ALGO(order, cop, calg, aalg, >>>> 128); >>>> + sess->cipher.key_sched = >>>> + CRYPTO_GET_KEY_SCHED(cop, calg, 128); >>>> + break; >>>> + case 192: >>>> + sess->crypto_func = >>>> + CRYPTO_GET_ALGO(order, cop, calg, aalg, >>>> 192); >>>> + sess->cipher.key_sched = >>>> + CRYPTO_GET_KEY_SCHED(cop, calg, 192); >>>> + break; >>>> + case 256: >>>> + sess->crypto_func = >>>> + CRYPTO_GET_ALGO(order, cop, calg, aalg, >>>> 256); >>>> + sess->cipher.key_sched = >>>> + CRYPTO_GET_KEY_SCHED(cop, calg, 256); >>>> + break; >>>> + default: >>>> + sess->crypto_func = NULL; >>>> + sess->cipher.key_sched = NULL; >>>> + return -EINVAL; >>>> + } >>>> + >>>> + if (unlikely(sess->crypto_func == NULL)) { >>>> + /* >>>> + * If we got here that means that there must be a bug >>> >>> >>> Since AES-128-CBC is only supported in your patch. It means that >>> crypto_func could be NULL according to the switch above if >>> cipher.key.length > 128? >> >> >> Yes. Instead of checking for key lengths in a similar way that we check for >> algorithms, etc. we just fail when we don't find appropriate function. Do >> you suggest that this should be changed? >> > > I mean to return error directly if length is not 128 in the above > switch, so this "if" is no necessary. OK. Done. Will resend patches soon. > >> >>> >>>> + * in the algorithms selection above. Nevertheless keep >>>> + * it here to catch bug immediately and avoid NULL >>>> pointer >>>> + * dereference in OPs processing. >>>> + */ >>>> + ARMV8_CRYPTO_LOG_ERR( >>>> + "No appropriate crypto function for given >>>> parameters"); >>>> + return -EINVAL; >>>> + } >>>> + >>>> + /* Set up cipher session prerequisites */ >>>> + if (cipher_set_prerequisites(sess, cipher_xform) != 0) >>>> + return -EINVAL; >>>> + >>>> + /* Set up authentication session prerequisites */ >>>> + if (auth_set_prerequisites(sess, auth_xform) != 0) >>>> + return -EINVAL; >>>> + >>>> + return 0; >>>> +} >>>> + >>> >>> >>> .... >>> >>>> diff --git a/drivers/crypto/armv8/rte_armv8_pmd_ops.c >>>> b/drivers/crypto/armv8/rte_armv8_pmd_ops.c >>>> new file mode 100644 >>>> index 0000000..2bf6475 >>>> --- /dev/null >>>> +++ b/drivers/crypto/armv8/rte_armv8_pmd_ops.c >>>> @@ -0,0 +1,369 @@ >>>> +/* >>>> + * BSD LICENSE >>>> + * >>>> + * Copyright (C) Cavium networks Ltd. 2017. >>>> + * >>>> + * Redistribution and use in source and binary forms, with or without >>>> + * modification, are permitted provided that the following conditions >>>> + * are met: >>>> + * >>>> + * * Redistributions of source code must retain the above copyright >>>> + * notice, this list of conditions and the following disclaimer. >>>> + * * Redistributions in binary form must reproduce the above >>>> copyright >>>> + * notice, this list of conditions and the following disclaimer in >>>> + * the documentation and/or other materials provided with the >>>> + * distribution. >>>> + * * Neither the name of Cavium networks nor the names of its >>>> + * contributors may be used to endorse or promote products derived >>>> + * from this software without specific prior written permission. >>>> + * >>>> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >>>> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >>>> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS >>>> FOR >>>> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE >>>> COPYRIGHT >>>> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, >>>> INCIDENTAL, >>>> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >>>> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF >>>> USE, >>>> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >>>> ANY >>>> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >>>> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE >>>> USE >>>> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH >>>> DAMAGE. >>>> + */ >>>> + >>>> +#include >>>> + >>>> +#include >>>> +#include >>>> +#include >>>> + >>>> +#include "armv8_crypto_defs.h" >>>> + >>>> +#include "rte_armv8_pmd_private.h" >>>> + >>>> +static const struct rte_cryptodev_capabilities >>>> + armv8_crypto_pmd_capabilities[] = { >>>> + { /* SHA1 HMAC */ >>>> + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, >>>> + {.sym = { >>>> + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, >>>> + {.auth = { >>>> + .algo = >>>> RTE_CRYPTO_AUTH_SHA1_HMAC, >>>> + .block_size = 64, >>>> + .key_size = { >>>> + .min = 16, >>>> + .max = 128, >>>> + .increment = 0 >>>> + }, >>>> + .digest_size = { >>>> + .min = 20, >>>> + .max = 20, >>>> + .increment = 0 >>>> + }, >>>> + .aad_size = { 0 } >>>> + }, } >>>> + }, } >>>> + }, >>>> + { /* SHA256 HMAC */ >>>> + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, >>>> + {.sym = { >>>> + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, >>>> + {.auth = { >>>> + .algo = >>>> RTE_CRYPTO_AUTH_SHA256_HMAC, >>>> + .block_size = 64, >>>> + .key_size = { >>>> + .min = 16, >>>> + .max = 128, >>>> + .increment = 0 >>>> + }, >>>> + .digest_size = { >>>> + .min = 32, >>>> + .max = 32, >>>> + .increment = 0 >>>> + }, >>>> + .aad_size = { 0 } >>>> + }, } >>>> + }, } >>>> + }, >>>> + { /* AES CBC */ >>>> + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, >>>> + {.sym = { >>>> + .xform_type = >>>> RTE_CRYPTO_SYM_XFORM_CIPHER, >>>> + {.cipher = { >>>> + .algo = >>>> RTE_CRYPTO_CIPHER_AES_CBC, >>>> + .block_size = 16, >>>> + .key_size = { >>>> + .min = 16, >>>> + .max = 16, >>>> + .increment = 0 >>>> + }, >>>> + .iv_size = { >>>> + .min = 16, >>>> + .max = 16, >>>> + .increment = 0 >>>> + } >>>> + }, } >>>> + }, } >>>> + }, >>>> + >>> >>> >>> It's strange that you defined aes and hmac here, but not implemented >>> them, though their combinations are implemented. >>> Will you add later? >> >> >> We may add standalone algorithms in the future but those ops here are not >> for that purpose. I thought that since there is no chained operations >> capability we should export what we can do even though that it will work >> (mean not return error) only if the operations are chained. >> Do you have some other suggestion? >> > > Nothing special. Either implement them later, or add new chained ops > (is that possible?) > BTW, can you explain what optimization you have done, so I can better > understand your asm code, thanks! Yes. The optimized assembly code is utilizing locality of reference while doing encryption/decryption as well as hash at the same time rather than one after another. Also, significant parts of the code are arranged for best instructions pipelining. Some parts of the implementation such as key schedule are written in a way that uses NEON and crypto instructions to speed up operations needed for key expansion. > >> >>> >>>> + RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() >>>> +}; >>>> + >>>> +