From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0079.outbound.protection.outlook.com [104.47.33.79]) by dpdk.org (Postfix) with ESMTP id 0D0E61B144 for ; Fri, 5 Oct 2018 15:01:26 +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=qYGlDudTszB9qAG28pRuMRnKSweA5gRM2XD4PHk5Sm4=; b=ewXvcIrdAyn8HUmMX5q3MLmLvAs9jviwclWJMOhq8PdEZ93w+cRwKvPrenT5gkVeV2/mBdhsJy0uGAUXDwAz5y0IEdKq2jHdPoyMQHAE7mRATWBsKNpRfE49DK+uYYoHAoQUHk6LkjdkueFAZKJjEayh3TwhPTHghylhNmlP1DU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.21; Fri, 5 Oct 2018 13:01:20 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Nithin Dabilpuram , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Ankur Dwivedi , Anoob Joseph , Murthy NSSR , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj Date: Fri, 5 Oct 2018 18:29:06 +0530 Message-Id: <1538744363-30340-16-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538744363-30340-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> <1538744363-30340-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: MA1PR0101CA0036.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::22) To SN6PR07MB4910.namprd07.prod.outlook.com (2603:10b6:805:39::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7c50b29f-3b82-412a-d1fe-08d62ac2a7d0 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB4910; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4910; 3:3d+Y8eLDPjVL0Wne8hi3DZFfWW0fwT6skmMb4iUcuw+gihoWP3vAA39B+O03IawGYzK6D5npUj5PN0+ygYbO2wWV9GXiHsUErKlNhenHF8vgKee8hUnBNkz+fvKJk22v+8YudJUcx1WPlPdRIp2fWXNBZFL8gUxAZ30fg0BPHZLYISXn7Rho/EKfonWn1kx5+n/2B9PXYvhheBwUisXEcm76a60Yu08yn7Q+VTjpC1Sesb8uBpkMfVjajQPUoW0R; 25:OKRtwTAB4aEV05U0ZY4uKAgT+srfuJ11D+j1pvr8AOc6/cqAhQR9OIveXYovRTgefpjpnBnPQaajdlcBXc5M7DDVlMCG+SnNmE6nrKsMatWNAl11tB/J9PAP6NbsxlHFHKRxNSWdH98PbTiLvBFHj9QAeK09SKy5/Hn4hNUbpDCZzUddY/WNcfiFbSuobBY/lQktPt/HU4N3/mqUyJhsECvo1cSlLRx/EDxGsDBnX7+2lrG5m4f5qaM7M0tXw37KiEnv5yS4BoTB/4PKAMyhuRiVSts3m7P5sfkZOjYpi9sut4Ne7gWWZvo21OE5sYv6GviFT4fIiL+AFvsuMKibyw==; 31:qPKCv3mFNRob/ggmMBfJpyWugZBqXKfW+MIeCudYsRNV8pR2D3NBq3OeWs27kKcgtKEX//gVV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u5GS5XU2O7Wle5c143Bntzkav47/7t+fovuHPCh96VAzetaabMnSHqfJzL+WzJi0ioKHxINC5SZzqJVFfGFOorvt6l7sC X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(163750095850); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(149066)(150057)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:SN6PR07MB4910; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB4910; X-Forefront-PRVS: 0816F1D86E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(136003)(396003)(366004)(199004)(189003)(51416003)(76176011)(11346002)(50226002)(25786009)(8936002)(48376002)(305945005)(186003)(16526019)(110136005)(6486002)(3846002)(446003)(52116002)(6116002)(81156014)(8676002)(97736004)(5660300001)(50466002)(4326008)(956004)(42882007)(2616005)(68736007)(478600001)(54906003)(7736002)(81166006)(6666003)(16586007)(107886003)(26005)(55236004)(66066001)(386003)(47776003)(6512007)(72206003)(44832011)(476003)(316002)(14444005)(36756003)(105586002)(106356001)(486006)(6506007)(2906002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB4910; H:ajoseph83.caveonetworks.com.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-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR07MB4910; 23:oalMuPCDY/OrLpZSlZU+WiRiVW48gpmkS7HXGG87N?= =?us-ascii?Q?EhYKe/rqw6ktxgfW1nIhdqPj5dER1Qz6EW1XBGWv9tghoCPFJh5UYu9yzdFS?= =?us-ascii?Q?v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5i+AwO0mE?= =?us-ascii?Q?sSfH5XLbMkQmX306FPW0/pUdAZOISoMYNd/EzhhvJCGiULCy8+K6Zby1VPui?= =?us-ascii?Q?C7QdsdxQRrOvtTO1DFMwNiBJrkSixbOy5oKMxEG/ElExDluAHVdKaUbZRbd0?= =?us-ascii?Q?6dR0Qj/53VxBn8AH+P2uFpBLwwGyW7Blpv9EHaXIto2V7pU/AJnzDPAoWqw1?= =?us-ascii?Q?cYHo1jFoXXAzm5o3rZlS3IfTbYecZk6+9u7UVCyJcHSD3J47sqqRHVRQXWmI?= =?us-ascii?Q?YIAJLkwsSfbi907WP8hy6Eu57MGU2Fjl3Zi3SV+ujGDO2kuN4hc4KxTpJt48?= =?us-ascii?B?Zz09?= X-Microsoft-Antispam-Message-Info: 6bh+/3+Fz8ICdckgBF/W9LUmhB0rYBaLNEYNN5ZKlNkx3oPleZdvV0MmzARxjKKGI7ZUnkYKBLkWUqAb2C66dyB2PMRZuT/Ar2Bs6nauURPqcTVk32q9H3Ff/gYup/dtGFku0GSNm+Y/OpygM3cNL78s+SUHH/XfEZxhrlehee+uEcFCeOnkSEktf8JQUD01UfJb50C8eIZRo8sntPkuR9YTWvaw1hqsBZip0INwhE2teLZwsuiIJa5rJuk92TG1lrQ4a7l1vspntnRk5EY4FYRLYIXYEZ9FmMeLiD+VJu1Pr/j0YAHoz23YQc+zO96wam8WdrPp893QWNyOpq8P+LBmP8T4aH6K2K4gqX61JM8= X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB4910; 6:vc4bzfS095wh9L112Uig9ZVvXoELFl52KsbrXrNnxYJqPElwst4yona6jN3unYie6kQq3HschwyTyEphPxbTUkGCDOIovc5+xPgOsnSBhCz6VxtIY9bZD7LDg2LCNwMBza07bdS2Bzv8++bg7hL25wgEpRJIjN/pUdOgpil7M/Yt1qdBNAmARAhV3pg++OBzAlcCsfDiWY/29LslV8x2Cpc0jtCsPu2PpB+T7RBFcDtnBSOOWlPy4yXXGZKgumyNwm/fQ0mhSMcA+9v5HzWVjaaHRA1CS3hYC6/YokyBLiJNWhZOGTgvtlvalbwE+e0oI8iL3vIdSHarpuw0sLHPCCx4U6TQ1CNwayi+KGLcqtfvjIMBd59FR4KXetrTqs5i7bQBbJQGyTdF7EDoTNvPuLZyaaQmAOh7EPWe2eYTlz+P8v/Rp987IkSivwAZMD4E7nWgRmFCOUfDKD9g9ZnGXw==; 5:CjDSxHnEq6HsHZf76CEH5h1G3lQO6l6a+pO3f79k0MnL4QKMbU+lTKvTMXWAhpjWR/yMbI6OFEEu6nY1axnFtYa1mbo0GXg7VhEpcEH1xYMn0rlM+NvVuRxrUWINf8ZpcXwtpqb/Xp7YC/zRxAg8ly4Ms3rdyO5ldUoNMe42XlY=; 7:WhsS+mXgGbf3FMZCK2raggQJNGumzjh/yWmmgobtHfesz/+cwHSEH86MZEAIbCyi0L5c+OqX2yYpQqs8WZqrlLEt8Td9Euoeie4YIKVvMLoRsEry6Sus9zhJQ+Og2ejiyuFJkBqy3Zm60Wr50N7h9Bs9q8A4YLyRWFZ+En7yx2H2I9OTfhx6b5xH+4SF+FFpgd+YamcWSFzDNHwDCaeLJJDPVX5kn0FGG3/DDqdltk4SN8n5wXJJgMQuhHM550Tw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2018 13:01:20.6887 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7c50b29f-3b82-412a-d1fe-08d62ac2a7d0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB4910 Subject: [dpdk-dev] [PATCH v3 15/32] common/cpt: add common code required for session management 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, 05 Oct 2018 13:01:26 -0000 From: Nithin Dabilpuram Adding common code required for session configure, session clear and get session size ops routines Signed-off-by: Ankur Dwivedi Signed-off-by: Anoob Joseph Signed-off-by: Murthy NSSR Signed-off-by: Nithin Dabilpuram Signed-off-by: Ragothaman Jayaraman Signed-off-by: Srisivasubramanian S Signed-off-by: Tejasree Kondoj --- drivers/common/cpt/cpt_mcode_defines.h | 119 +++++++++++++++++++++++++++++++++ drivers/common/cpt/cpt_request_mgr.h | 32 +++++++++ drivers/common/cpt/cpt_ucode.h | 47 +++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 drivers/common/cpt/cpt_request_mgr.h create mode 100644 drivers/common/cpt/cpt_ucode.h diff --git a/drivers/common/cpt/cpt_mcode_defines.h b/drivers/common/cpt/cpt_mcode_defines.h index 83a8a42..235320c 100644 --- a/drivers/common/cpt/cpt_mcode_defines.h +++ b/drivers/common/cpt/cpt_mcode_defines.h @@ -5,6 +5,9 @@ #ifndef _CPT_MCODE_DEFINES_H_ #define _CPT_MCODE_DEFINES_H_ +#include +#include + /* * This file defines macros and structures according to microcode spec * @@ -35,4 +38,120 @@ typedef struct sglist_comp { uint64_t ptr[4]; } sg_comp_t; +struct cpt_sess_misc { + /** CPT opcode */ + uint16_t cpt_op:4; + /** ZUC, SNOW3G & KASUMI flags */ + uint16_t zsk_flag:4; + /** Flag for AES GCM */ + uint16_t aes_gcm:1; + /** Flag for AES CTR */ + uint16_t aes_ctr:1; + /** Flag for NULL cipher/auth */ + uint16_t is_null:1; + /** Flag for GMAC */ + uint16_t is_gmac:1; + /** AAD length */ + uint16_t aad_length; + /** MAC len in bytes */ + uint8_t mac_len; + /** IV length in bytes */ + uint8_t iv_length; + /** Auth IV length in bytes */ + uint8_t auth_iv_length; + /** Reserved field */ + uint8_t rsvd1; + /** IV offset in bytes */ + uint16_t iv_offset; + /** Auth IV offset in bytes */ + uint16_t auth_iv_offset; + /** Salt */ + uint32_t salt; + /** Context DMA address */ + phys_addr_t ctx_dma_addr; +}; + +typedef union { + uint64_t flags; + struct { +#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint64_t enc_cipher : 4; + uint64_t reserved1 : 1; + uint64_t aes_key : 2; + uint64_t iv_source : 1; + uint64_t hash_type : 4; + uint64_t reserved2 : 3; + uint64_t auth_input_type : 1; + uint64_t mac_len : 8; + uint64_t reserved3 : 8; + uint64_t encr_offset : 16; + uint64_t iv_offset : 8; + uint64_t auth_offset : 8; +#else + uint64_t auth_offset : 8; + uint64_t iv_offset : 8; + uint64_t encr_offset : 16; + uint64_t reserved3 : 8; + uint64_t mac_len : 8; + uint64_t auth_input_type : 1; + uint64_t reserved2 : 3; + uint64_t hash_type : 4; + uint64_t iv_source : 1; + uint64_t aes_key : 2; + uint64_t reserved1 : 1; + uint64_t enc_cipher : 4; +#endif + } e; +} encr_ctrl_t; + +typedef struct { + encr_ctrl_t enc_ctrl; + uint8_t encr_key[32]; + uint8_t encr_iv[16]; +} mc_enc_context_t; + +typedef struct { + uint8_t ipad[64]; + uint8_t opad[64]; +} mc_fc_hmac_context_t; + +typedef struct { + mc_enc_context_t enc; + mc_fc_hmac_context_t hmac; +} mc_fc_context_t; + +typedef struct { + uint8_t encr_auth_iv[16]; + uint8_t ci_key[16]; + uint8_t zuc_const[32]; +} mc_zuc_snow3g_ctx_t; + +typedef struct { + uint8_t reg_A[8]; + uint8_t ci_key[16]; +} mc_kasumi_ctx_t; + +struct cpt_ctx { + /* Below fields are accessed by sw */ + uint64_t enc_cipher :8; + uint64_t hash_type :8; + uint64_t mac_len :8; + uint64_t auth_key_len :8; + uint64_t fc_type :4; + uint64_t hmac :1; + uint64_t zsk_flags :3; + uint64_t k_ecb :1; + uint64_t snow3g :1; + uint64_t rsvd :22; + /* Below fields are accessed by hardware */ + union { + mc_fc_context_t fctx; + mc_zuc_snow3g_ctx_t zs_ctx; + mc_kasumi_ctx_t k_ctx; + }; + uint8_t auth_key[64]; +}; + +#define CPT_P_ENC_CTRL(fctx) fctx->enc.enc_ctrl.e + #endif /* _CPT_MCODE_DEFINES_H_ */ diff --git a/drivers/common/cpt/cpt_request_mgr.h b/drivers/common/cpt/cpt_request_mgr.h new file mode 100644 index 0000000..fe184fe --- /dev/null +++ b/drivers/common/cpt/cpt_request_mgr.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#ifndef _CPT_REQUEST_MGR_H_ +#define _CPT_REQUEST_MGR_H_ + +#include "cpt_mcode_defines.h" + +/* + * This file defines the agreement between the common layer and the individual + * crypto drivers for OCTEON TX series. Datapath in otx* directory include this + * file and all these functions are static inlined for better performance. + * + */ + +/* + * Get the session size + * + * This function is used in the data path. + * + * @return + * - session size + */ +static __rte_always_inline unsigned int +cpt_get_session_size(void) +{ + unsigned int ctx_len = sizeof(struct cpt_ctx); + return (sizeof(struct cpt_sess_misc) + RTE_ALIGN_CEIL(ctx_len, 8)); +} + +#endif /* _CPT_REQUEST_MGR_H_ */ diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h new file mode 100644 index 0000000..e4f16fe --- /dev/null +++ b/drivers/common/cpt/cpt_ucode.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#ifndef _CPT_UCODE_H_ +#define _CPT_UCODE_H_ + +#include "cpt_mcode_defines.h" + +/* + * This file defines functions that are interfaces to microcode spec. + * + */ + +static __rte_always_inline int +cpt_is_algo_supported(struct rte_crypto_sym_xform *xform) +{ + /* + * Microcode only supports the following combination. + * Encryption followed by authentication + * Authentication followed by decryption + */ + if (xform->next) { + if ((xform->type == RTE_CRYPTO_SYM_XFORM_AUTH) && + (xform->next->type == RTE_CRYPTO_SYM_XFORM_CIPHER) && + (xform->next->cipher.op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)) { + /* Unsupported as of now by microcode */ + CPT_LOG_DP_ERR("Unsupported combination"); + return -1; + } + if ((xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) && + (xform->next->type == RTE_CRYPTO_SYM_XFORM_AUTH) && + (xform->cipher.op == RTE_CRYPTO_CIPHER_OP_DECRYPT)) { + /* For GMAC auth there is no cipher operation */ + if (xform->aead.algo != RTE_CRYPTO_AEAD_AES_GCM || + xform->next->auth.algo != + RTE_CRYPTO_AUTH_AES_GMAC) { + /* Unsupported as of now by microcode */ + CPT_LOG_DP_ERR("Unsupported combination"); + return -1; + } + } + } + return 0; +} + +#endif /*_CPT_UCODE_H_ */ -- 2.7.4