From patchwork Tue Jul 10 15:33:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shally Verma X-Patchwork-Id: 42723 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C86F1B4CB; Tue, 10 Jul 2018 17:34:10 +0200 (CEST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0047.outbound.protection.outlook.com [104.47.42.47]) by dpdk.org (Postfix) with ESMTP id CD1451B4B5 for ; Tue, 10 Jul 2018 17:34:06 +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:X-MS-Exchange-SenderADCheck; bh=I3VPYDTQK4KdwpT74M19ULHE2Uu20txdQ3z2gKg54ZA=; b=oCCUMWfOAUGRrPsABP+AIh3SCL/7oIdEiqScrJ1g6sva451vGJc21o9SOq+E+nvMd98v3kQW8MnGzQXIzIu+SsYEk2IsB4CEO2kc+vRYXmtObsqwfjSWEYVRFX6uXZOey3C7EjzBHFWtkY4x3HpfGrHK1Rv54xXlUfT9RWHimXE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Shally.Verma@cavium.com; Received: from hyd1sverma-dt.caveonetworks.com (115.113.156.2) by DM5PR0701MB3639.namprd07.prod.outlook.com (2603:10b6:4:7e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.20; Tue, 10 Jul 2018 15:34:03 +0000 From: Shally Verma To: pablo.de.lara.guarch@intel.com Cc: dev@dpdk.org, pathreya@caviumnetworks.com, nmurthy@caviumnetworks.com, Sunila Sahu , Ashish Gupta , Umesh Kartha Date: Tue, 10 Jul 2018 21:03:20 +0530 Message-Id: <1531236801-5931-4-git-send-email-shally.verma@caviumnetworks.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1531236801-5931-1-git-send-email-shally.verma@caviumnetworks.com> References: <1531236801-5931-1-git-send-email-shally.verma@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BM1PR0101CA0007.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::17) To DM5PR0701MB3639.namprd07.prod.outlook.com (2603:10b6:4:7e::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d1e4a617-4d24-4f97-4b05-08d5e67a9218 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DM5PR0701MB3639; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3639; 3:Ee+vGNykVR7CfgbqJcgmN8VQKhQY1Ush0sMZ5mk6jhtJFu4M/hKr3gOFMhA6jycea5/sZcrFyuHEncMA9n5aUajUq/PoPlanzl6YKfuomYdPSm/znwCXMAxhDRs0LX58v32rml5ZX4564a/XeDw6bIttRTQ43L2LBt/hrC2J2nPQeHx2pMDlY9kLdHQaOcU2vBXH140d3SIc3JsUSxt8GKoI3OkV2Pm3KZyFNY07QyJLISG3DZtUEXhF8weOQ+PX; 25:4tbjaaoAEAXEwf4MGpzA5MF8Gv3PcA0umKCnZtS7QD6ckbJEf/JeKP0/ce3kr2C4B/XsjdH1Z8IM2J8c6PLVwPO9KLHyOay85X8RuS3NKfrPh4VeykdIJmJtJxFbvEzm69++FTNQsca0S1VzZFB/2h6codv8x4zUfWCYN8YFc+Pa71S746wrJfQv4w2rsClPoUZZ525fYBTwLMYnap21QVOrhAgSHNwmKd4ZGMDSvIqvi0F5o0p0bJGMwIaQpCnJZLdKmg8X9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5FAgjttpGd64Vv9RYrqFwFO9dB6uxLQ2nC4jJVGHu1f6D7VyRAdwi8/eAdYInGqZ3FFm0XoorCABiDaxBL62pcwdUwRRDl37P82nJ1gWHnZUJ1eX0rM2zquYp/1P6F4X/9+xXDW3DZu5tZL4t+//BG6pUoOeSgUmKVrPSB1i6uT/r9kCaRWvAGWDywgrqgiDEmmClZ/7IIOyr3zVkjynlI2WgDfOQnOQ1lue+14fZQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3002001)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM5PR0701MB3639; BCL:0; PCL:0; RULEID:; SRVR:DM5PR0701MB3639; X-Forefront-PRVS: 0729050452 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(366004)(39860400002)(136003)(199004)(189003)(47776003)(2361001)(68736007)(53416004)(76176011)(66066001)(6486002)(6666003)(186003)(105586002)(16586007)(316002)(6916009)(51416003)(50466002)(97736004)(48376002)(72206003)(54906003)(8676002)(4326008)(478600001)(5660300001)(16526019)(50226002)(6512007)(2906002)(386003)(3846002)(6506007)(44832011)(106356001)(107886003)(2616005)(26005)(55236004)(69596002)(6116002)(956004)(81166006)(2351001)(305945005)(25786009)(81156014)(53936002)(36756003)(8936002)(11346002)(52116002)(476003)(7736002)(575784001)(486006)(42882007)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0701MB3639; H:hyd1sverma-dt.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-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dKZj5xjjFkzl8jmGxgyFIP66aG4oqdbqsUPOZ98jziFyu+I+/IKtRDGvJ4wzUQbnQH2XHYJRLBfpgs2pD+b7pD6p7FUzQ7bYgJlJ+UoJ4l86ljhn0IFy42+TArrSDgi2cupL6fmeqaCNSct/SZg==; 5:sIg3/QWkUd+43TIDSvUtXnFyE84KRL+5LarCbGGjqj32g0ba3pQD9BSKCqQ0RnPeOYL14TXTVihV4olUdqUP3lP01ikhIepdWIRfiRF7j98o2TNXSRkEt1WahHxCLJJCWX5iXs9m2lxyPle3JoYAd51hNSknzFIDLie9QoNzW9g=; 24:/zo/ADLFWTXURbtR0J9f+qUoMCDTZZ/LgSbfdh/MWnS2YCS5AOt8Gayb94NLVJLSF/pM8wqr7CffBWJHemSer7ZOxBUalqpfDuKOrPPnyPU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR0701MB3639; 7:Dxa/GvvlFTSzTDql7Sf0G1v1jn6zMQewhPmx2sPPKo9b0G9eM6i1d0w088WGnVt4fOZVuO5Lt5U2w8kthkiOJlJk44ofJztUN68SG8vWWMQ2oh45ASvnHM1icnIYE3gh01pnbr3n4eq/FPBSZcAwFmj8wJ71CcwTwHHewoY8EwKYbeToXJ015sCaMZVPEFpD9rI+JrwdSGUX1BCq+xa4Iby3WFuDynNz+2Qf9pFu6DZf4x0DiDvpLi9SGEAY34Pm X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2018 15:34:03.0600 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1e4a617-4d24-4f97-4b05-08d5e67a9218 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0701MB3639 Subject: [dpdk-dev] [PATCH v5 3/4] cryptodev: add asymmetric capability 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Sunila Sahu Extend cryptodev with asymmetric capability APIs and definitions. Signed-off-by: Shally Verma Signed-off-by: Sunila Sahu Signed-off-by: Ashish Gupta Signed-off-by: Umesh Kartha --- lib/librte_cryptodev/rte_cryptodev.c | 76 ++++++++++++++++++ lib/librte_cryptodev/rte_cryptodev.h | 103 ++++++++++++++++++++++++- lib/librte_cryptodev/rte_cryptodev_version.map | 9 ++- 3 files changed, 185 insertions(+), 3 deletions(-) diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index da0d322..63ae23f 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -242,6 +242,24 @@ rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum, return -1; } +int __rte_experimental +rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum, + const char *xform_string) +{ + unsigned int i; + + for (i = 1; i < RTE_DIM(rte_crypto_asym_xform_strings); i++) { + if (strcmp(xform_string, + rte_crypto_asym_xform_strings[i]) == 0) { + *xform_enum = (enum rte_crypto_asym_xform_type) i; + return 0; + } + } + + /* Invalid string */ + return -1; +} + /** * The crypto auth operation strings identifiers. * It could be used in application command line. @@ -312,6 +330,28 @@ param_range_check(uint16_t size, const struct rte_crypto_param_range *range) return -1; } +const struct rte_cryptodev_asymmetric_xform_capability * __rte_experimental +rte_cryptodev_asym_capability_get(uint8_t dev_id, + const struct rte_cryptodev_asym_capability_idx *idx) +{ + const struct rte_cryptodev_capabilities *capability; + struct rte_cryptodev_info dev_info; + unsigned int i = 0; + + memset(&dev_info, 0, sizeof(struct rte_cryptodev_info)); + rte_cryptodev_info_get(dev_id, &dev_info); + + while ((capability = &dev_info.capabilities[i++])->op != + RTE_CRYPTO_OP_TYPE_UNDEFINED) { + if (capability->op != RTE_CRYPTO_OP_TYPE_ASYMMETRIC) + continue; + + if (capability->asym.xform_capa.xform_type == idx->type) + return &capability->asym.xform_capa; + } + return NULL; +}; + int rte_cryptodev_sym_capability_check_cipher( const struct rte_cryptodev_symmetric_capability *capability, @@ -363,6 +403,42 @@ rte_cryptodev_sym_capability_check_aead( return 0; } +int __rte_experimental +rte_cryptodev_asym_xform_capability_check_optype( + const struct rte_cryptodev_asymmetric_xform_capability *capability, + enum rte_crypto_asym_op_type op_type) +{ + if (capability->op_types & (1 << op_type)) + return 1; + + return 0; +} + +int __rte_experimental +rte_cryptodev_asym_xform_capability_check_modlen( + const struct rte_cryptodev_asymmetric_xform_capability *capability, + uint16_t modlen) +{ + /* no need to check for limits, if min or max = 0 */ + if (capability->modlen.min != 0) { + if (modlen < capability->modlen.min) + return -1; + } + + if (capability->modlen.max != 0) { + if (modlen > capability->modlen.max) + return -1; + } + + /* in any case, check if given modlen is module increment */ + if (capability->modlen.increment != 0) { + if (modlen % (capability->modlen.increment)) + return -1; + } + + return 0; +} + const char * rte_cryptodev_get_feature_name(uint64_t flag) diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index f93dc71..7ef7fb4 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -143,6 +143,35 @@ struct rte_cryptodev_symmetric_capability { }; }; +/** + * Asymmetric Xform Crypto Capability + * + */ +struct rte_cryptodev_asymmetric_xform_capability { + enum rte_crypto_asym_xform_type xform_type; + /**< Transform type: RSA/MODEXP/DH/DSA/MODINV */ + + uint32_t op_types; + /**< bitmask for supported rte_crypto_asym_op_type */ + + __extension__ + union { + struct rte_crypto_param_range modlen; + /**< Range of modulus length supported by modulus based xform. + * Value 0 mean implementation default + */ + }; +}; + +/** + * Asymmetric Crypto Capability + * + */ +struct rte_cryptodev_asymmetric_capability { + struct rte_cryptodev_asymmetric_xform_capability xform_capa; +}; + + /** Structure used to capture a capability of a crypto device */ struct rte_cryptodev_capabilities { enum rte_crypto_op_type op; @@ -152,6 +181,8 @@ struct rte_cryptodev_capabilities { union { struct rte_cryptodev_symmetric_capability sym; /**< Symmetric operation capability parameters */ + struct rte_cryptodev_asymmetric_capability asym; + /**< Asymmetric operation capability parameters */ }; }; @@ -166,7 +197,17 @@ struct rte_cryptodev_sym_capability_idx { }; /** - * Provide capabilities available for defined device and algorithm + * Structure used to describe asymmetric crypto xforms + * Each xform maps to one asym algorithm. + * + */ +struct rte_cryptodev_asym_capability_idx { + enum rte_crypto_asym_xform_type type; + /**< Asymmetric xform (algo) type */ +}; + +/** + * Provide capabilities available for defined device and algorithm * * @param dev_id The identifier of the device. * @param idx Description of crypto algorithms. @@ -180,6 +221,20 @@ rte_cryptodev_sym_capability_get(uint8_t dev_id, const struct rte_cryptodev_sym_capability_idx *idx); /** + * Provide capabilities available for defined device and xform + * + * @param dev_id The identifier of the device. + * @param idx Description of asym crypto xform. + * + * @return + * - Return description of the asymmetric crypto capability if exist. + * - Return NULL if the capability not exist. + */ +const struct rte_cryptodev_asymmetric_xform_capability * __rte_experimental +rte_cryptodev_asym_capability_get(uint8_t dev_id, + const struct rte_cryptodev_asym_capability_idx *idx); + +/** * Check if key size and initial vector are supported * in crypto cipher capability * @@ -235,6 +290,36 @@ rte_cryptodev_sym_capability_check_aead( uint16_t iv_size); /** + * Check if op type is supported + * + * @param capability Description of the asymmetric crypto capability. + * @param op_type op type + * + * @return + * - Return 1 if the op type is supported + * - Return 0 if unsupported + */ +int __rte_experimental +rte_cryptodev_asym_xform_capability_check_optype( + const struct rte_cryptodev_asymmetric_xform_capability *capability, + enum rte_crypto_asym_op_type op_type); + +/** + * Check if modulus length is in supported range + * + * @param capability Description of the asymmetric crypto capability. + * @param modlen modulus length. + * + * @return + * - Return 0 if the parameters are in range of the capability. + * - Return -1 if the parameters are out of range of the capability. + */ +int __rte_experimental +rte_cryptodev_asym_xform_capability_check_modlen( + const struct rte_cryptodev_asymmetric_xform_capability *capability, + uint16_t modlen); + +/** * Provide the cipher algorithm enum, given an algorithm string * * @param algo_enum A pointer to the cipher algorithm @@ -279,6 +364,22 @@ int rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum, const char *algo_string); +/** + * Provide the Asymmetric xform enum, given an xform string + * + * @param xform_enum A pointer to the xform type + * enum to be filled + * @param xform_string xform string + * + * @return + * - Return -1 if string is not valid + * - Return 0 if the string is valid + */ +int __rte_experimental +rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum, + const char *xform_string); + + /** Macro used at end of crypto PMD list */ #define RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() \ { RTE_CRYPTO_OP_TYPE_UNDEFINED } diff --git a/lib/librte_cryptodev/rte_cryptodev_version.map b/lib/librte_cryptodev/rte_cryptodev_version.map index e63b51a..d9b56aa 100644 --- a/lib/librte_cryptodev/rte_cryptodev_version.map +++ b/lib/librte_cryptodev/rte_cryptodev_version.map @@ -91,12 +91,17 @@ DPDK_18.05 { EXPERIMENTAL { global: + rte_cryptodev_asym_capability_get; rte_cryptodev_asym_get_header_session_size; rte_cryptodev_asym_get_private_session_size; + rte_cryptodev_asym_get_xform_enum; rte_cryptodev_asym_session_clear; rte_cryptodev_asym_session_create; rte_cryptodev_asym_session_free; rte_cryptodev_asym_session_init; - rte_cryptodev_sym_session_get_user_data; - rte_cryptodev_sym_session_set_user_data; + rte_cryptodev_asym_xform_capability_check_optype; + rte_cryptodev_sym_session_get_private_data; + rte_cryptodev_sym_session_set_private_data; + rte_crypto_asym_op_strings; + rte_crypto_asym_xform_strings; };