From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0069.outbound.protection.outlook.com [104.47.41.69]) by dpdk.org (Postfix) with ESMTP id C8AB91B150 for ; Tue, 9 Oct 2018 11:09:00 +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=i/YPHyP/lncmossLZyYEOsWv6Y/5Odug3VkNou/HCZA=; b=VJwYFAblsfgD8SUtjTYDZ1nmuPsKuc6ijNjjvGrYkKYefwLPSrNZSIM9H+bP8N29tC9vVtljJ/3ydEapmTPNdBu0YcCPggDv5fjM0KNihHd7CUr9CwWZmbBHJk4CXH/O+linvBhnaswJB/VcvK10GUJJpbR5Dw9ufL2bvsSEDhc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by BN7PR07MB4897.namprd07.prod.outlook.com (2603:10b6:406:ef::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.28; Tue, 9 Oct 2018 09:08:54 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Anoob Joseph , Jerin Jacob , Narayana Prasad , Ankur Dwivedi , Murthy NSSR , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj , dev@dpdk.org Date: Tue, 9 Oct 2018 14:37:38 +0530 Message-Id: <1539076076-19786-6-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539076076-19786-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1538744363-30340-1-git-send-email-anoob.joseph@caviumnetworks.com> <1539076076-19786-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: PN1PR0101CA0004.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::14) To BN7PR07MB4897.namprd07.prod.outlook.com (2603:10b6:406:ef::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e3e4921-93ce-4d6b-7915-08d62dc6d934 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BN7PR07MB4897; X-Microsoft-Exchange-Diagnostics: 1; BN7PR07MB4897; 3:INt8Nnd34uCyQmmp0/xDkMunQnLw7U8GH8i7RvGcqz94CHC6zClVX74Q4H/Fc3JKIqLcadp19dKAMK+rmMMQCttptQocdxH7YytkO2SjFErjq+Ej6xBCpAXDWJnMXJunWc0T0NfjufmD8CmASPkUFgGeLbNNQVXXhk4V3PKR4FjaFTB33Tt2MxMiE9PwccvLyhbXE+wHfs7eKggkc6i10qfky0cNrcWj5oLGZTaHB6rdO9HKU/mCGOGuT33YAmdF; 25:2mQtGNX71TyqgqvBeQ8iyJUZldnYq9/lQ0Un/L58MEkkd+Bdj+rOx/C2pzyfz3h2nQlMvd2LRtraCMNcradAjarJNFaaY6yCmg/jGm6J/BRs3EjkJJ1u0y/CPfYZcLZn2oAP/rwSZe/gTnaPs1VFRbFRL4QTysG14tnfRi+l4HISFqlhQ2RnwxDT7Bx71nyKG072BKmNxkGl9ks4uJZanQE/n6aNaJryrQB4yjF3wCYJW5C6LnLnqwxfJwm67x5zboFZFNMRBUAe/hN+TwFK5wlv7gHaSMlLOz7k8e2KiaLNJjL0MvkeoecVG6zcUsZbkxxGzvQ7GjzjBNdYj9Z4qA==; 31:YqPny9/MSZd8zv33DkJevZj+f5VbcrUL60Eo2qOLAHo7cWHv2yD/HJr0tGSUNfqs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Rh6RaWHen/MYLHwy7yU89HLn1AnqRR1mFJxQghIE8TH9oM6Cyefc/QQ== 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)(5005006)(8121501046)(3002001)(93006095)(10201501046)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(201708071742011)(7699051); SRVR:BN7PR07MB4897; BCL:0; PCL:0; RULEID:; SRVR:BN7PR07MB4897; X-Forefront-PRVS: 08200063E9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(136003)(346002)(39860400002)(199004)(189003)(42882007)(47776003)(106356001)(6666003)(186003)(5660300001)(26005)(68736007)(16526019)(8936002)(25786009)(6116002)(2906002)(81156014)(50226002)(305945005)(81166006)(7736002)(3846002)(105586002)(478600001)(8676002)(54906003)(110136005)(48376002)(16586007)(14444005)(6486002)(6506007)(50466002)(316002)(53936002)(386003)(51416003)(52116002)(76176011)(11346002)(6512007)(44832011)(446003)(36756003)(55236004)(956004)(2616005)(486006)(4326008)(66066001)(97736004)(72206003)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR07MB4897; 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; BN7PR07MB4897; 23:MKeLPZFZTneGKI/fDm7N2Jchz7m1ut8+d3WGIZsdk?= =?us-ascii?Q?3KHC8S5trYWPChI8zi+O5El3EcnvgpaQPqeyMPkPVjsyP3Aa/IpI0/W1PHz6?= =?us-ascii?Q?1UA8jE5VnhOEeBUynnIKzp6xx6WMj17QL7wZbZLqelD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pNAkCCsf2wD9mqztWEiCKvQjWbHUznmFdUEK6/p4T82gToTdPPGGsm9vhYx3bJpARrOfgzmboJejGoHeGPiCWrPLQ4x/08FeKuAplCD0Afcy+a0lmiCp99IVA0YfdGQtCKW2O0KxdwnLrk9HY/XzTDXuw==; 5:/ZJFgegOJXu1eIDnl/8k7vzOCUg9MYgleN+EIOtHMX+d1Y7tjWswS9IasaLZi+mUV8QSLG/RlqC+XKGhEAi+cQf/fsdghpSWcgb1HRZnkUiLIbHYFjBJ3e5g/64Ub3QeIry87hCBCXVW8odN7pCham5/0S4aS+yuqe1uCQEPJQM=; 7:49I5hL6JL4W8tjy6njwDOatRhGaW9WuUNi+zgLqXvNGI7EuQNdH8hR6Z40XmleHDqJ/n17GdUHAaNfYTxTQCafMNSNGJO8xOHmDK6YrHbdO0KKTlVdS9Ix+DXUEFCpTTiwpKdlwDTkOihE/RvEf7KueYFlVj0wOsK23IUzjp1qk6N9LFK4yQhAPfvsK0hMWTC+cZCqNqdg2fp9SmyxKw74TBG7sqpP9jJXJWvA4IrbT+E+hAu4ForU27LxNHzZBq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2018 09:08:54.9404 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e3e4921-93ce-4d6b-7915-08d62dc6d934 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR07MB4897 Subject: [dpdk-dev] [PATCH v4 05/23] common/cpt: add PMD ops helper functions 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, 09 Oct 2018 09:09:01 -0000 Adding pmd ops helper functions. Control path accessed APIs would be added as helper functions. Adding microcode defined macros etc as dependencies to the helper functions. 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/Makefile | 4 +++ drivers/common/cpt/Makefile | 25 ++++++++++++++++ drivers/common/cpt/cpt_common.h | 36 +++++++++++++++++++++++ drivers/common/cpt/cpt_mcode_defines.h | 38 +++++++++++++++++++++++++ drivers/common/cpt/cpt_pmd_ops_helper.c | 41 +++++++++++++++++++++++++++ drivers/common/cpt/cpt_pmd_ops_helper.h | 34 ++++++++++++++++++++++ drivers/common/cpt/meson.build | 8 ++++++ drivers/common/cpt/rte_common_cpt_version.map | 6 ++++ drivers/common/meson.build | 2 +- mk/rte.app.mk | 4 +++ 10 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 drivers/common/cpt/Makefile create mode 100644 drivers/common/cpt/cpt_mcode_defines.h create mode 100644 drivers/common/cpt/cpt_pmd_ops_helper.c create mode 100644 drivers/common/cpt/cpt_pmd_ops_helper.h create mode 100644 drivers/common/cpt/meson.build create mode 100644 drivers/common/cpt/rte_common_cpt_version.map diff --git a/drivers/common/Makefile b/drivers/common/Makefile index 5bcff17..29a8f6d 100644 --- a/drivers/common/Makefile +++ b/drivers/common/Makefile @@ -4,6 +4,10 @@ include $(RTE_SDK)/mk/rte.vars.mk +ifeq ($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO),y) +DIRS-y += cpt +endif + ifeq ($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF)$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL),yy) DIRS-y += octeontx endif diff --git a/drivers/common/cpt/Makefile b/drivers/common/cpt/Makefile new file mode 100644 index 0000000..2340aa9 --- /dev/null +++ b/drivers/common/cpt/Makefile @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Cavium, Inc +# + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_common_cpt.a + +CFLAGS += $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/bus/pci +EXPORT_MAP := rte_common_cpt_version.map + +LIBABIVER := 1 + +# +# all source are stored in SRCS-y +# +SRCS-y += cpt_pmd_ops_helper.c + +LDLIBS += -lrte_eal + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/common/cpt/cpt_common.h b/drivers/common/cpt/cpt_common.h index 5e2099a..88f4902 100644 --- a/drivers/common/cpt/cpt_common.h +++ b/drivers/common/cpt/cpt_common.h @@ -18,6 +18,24 @@ #define AE_TYPE 1 #define SE_TYPE 2 +#ifndef ROUNDUP4 +#define ROUNDUP4(val) (((val) + 3) & 0xfffffffc) +#endif + +#ifndef ROUNDUP8 +#define ROUNDUP8(val) (((val) + 7) & 0xfffffff8) +#endif + +#ifndef ROUNDUP16 +#define ROUNDUP16(val) (((val) + 15) & 0xfffffff0) +#endif + +#ifndef __hot +#define __hot __attribute__((hot)) +#endif + +#define MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++) + struct cptvf_meta_info { void *cptvf_meta_pool; int cptvf_op_mlen; @@ -44,4 +62,22 @@ struct pending_queue { uint64_t pending_count; }; +struct cpt_request_info { + /** Data path fields */ + uint64_t comp_baddr; + volatile uint64_t *completion_addr; + volatile uint64_t *alternate_caddr; + void *op; + struct { + uint64_t ei0; + uint64_t ei1; + uint64_t ei2; + uint64_t ei3; + } ist; + + /** Control path fields */ + uint64_t time_out; + uint8_t extra_time; +}; + #endif /* _CPT_COMMON_H_ */ diff --git a/drivers/common/cpt/cpt_mcode_defines.h b/drivers/common/cpt/cpt_mcode_defines.h new file mode 100644 index 0000000..83a8a42 --- /dev/null +++ b/drivers/common/cpt/cpt_mcode_defines.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#ifndef _CPT_MCODE_DEFINES_H_ +#define _CPT_MCODE_DEFINES_H_ + +/* + * This file defines macros and structures according to microcode spec + * + */ + +#define CPT_BYTE_16 16 +#define CPT_BYTE_24 24 +#define CPT_BYTE_32 32 +#define CPT_MAX_SG_IN_OUT_CNT 32 +#define CPT_MAX_SG_CNT (CPT_MAX_SG_IN_OUT_CNT/2) + +#define COMPLETION_CODE_SIZE 8 +#define COMPLETION_CODE_INIT 0 + +#define SG_LIST_HDR_SIZE (8u) +#define SG_ENTRY_SIZE sizeof(sg_comp_t) + +/* #define CPT_ALWAYS_USE_SG_MODE */ +#define CPT_ALWAYS_USE_SEPARATE_BUF + +typedef struct sglist_comp { + union { + uint64_t len; + struct { + uint16_t len[4]; + } s; + } u; + uint64_t ptr[4]; +} sg_comp_t; + +#endif /* _CPT_MCODE_DEFINES_H_ */ diff --git a/drivers/common/cpt/cpt_pmd_ops_helper.c b/drivers/common/cpt/cpt_pmd_ops_helper.c new file mode 100644 index 0000000..1c18180 --- /dev/null +++ b/drivers/common/cpt/cpt_pmd_ops_helper.c @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#include + +#include "cpt_common.h" +#include "cpt_hw_types.h" +#include "cpt_mcode_defines.h" +#include "cpt_pmd_ops_helper.h" + +#define CPT_MAX_IV_LEN 16 +#define CPT_OFFSET_CONTROL_BYTES 8 + +int32_t +cpt_pmd_ops_helper_get_mlen_direct_mode(void) +{ + uint32_t len = 0; + + /* Request structure */ + len = sizeof(struct cpt_request_info); + + /* CPT HW result structure plus extra as it is aligned */ + len += 2*sizeof(cpt_res_s_t); + + return len; +} + +int +cpt_pmd_ops_helper_get_mlen_sg_mode(void) +{ + uint32_t len = 0; + + len += sizeof(struct cpt_request_info); + len += CPT_OFFSET_CONTROL_BYTES + CPT_MAX_IV_LEN; + len += ROUNDUP8(SG_LIST_HDR_SIZE + + (ROUNDUP4(CPT_MAX_SG_IN_OUT_CNT) >> 2) * SG_ENTRY_SIZE); + len += 2 * COMPLETION_CODE_SIZE; + len += 2 * sizeof(cpt_res_s_t); + return len; +} diff --git a/drivers/common/cpt/cpt_pmd_ops_helper.h b/drivers/common/cpt/cpt_pmd_ops_helper.h new file mode 100644 index 0000000..dd32f9a --- /dev/null +++ b/drivers/common/cpt/cpt_pmd_ops_helper.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#ifndef _CPT_PMD_OPS_HELPER_H_ +#define _CPT_PMD_OPS_HELPER_H_ + +/* + * This file defines the agreement between the common layer and the individual + * crypto drivers for OCTEON TX series. Control path in otx* directory can + * directly call functions declared here. + */ + +/* + * Get meta length required when operating in direct mode (single buffer + * in-place) + * + * @return + * - length + */ + +int32_t +cpt_pmd_ops_helper_get_mlen_direct_mode(void); + +/* + * Get size of contiguous meta buffer to be allocated when working in scatter + * gather mode. + * + * @return + * - length + */ +int +cpt_pmd_ops_helper_get_mlen_sg_mode(void); +#endif /* _CPT_PMD_OPS_HELPER_H_ */ diff --git a/drivers/common/cpt/meson.build b/drivers/common/cpt/meson.build new file mode 100644 index 0000000..0a905aa --- /dev/null +++ b/drivers/common/cpt/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Cavium, Inc + +sources = files('cpt_pmd_ops_helper.c') + +deps = ['kvargs', 'pci', 'cryptodev'] +includes += include_directories('../../crypto/octeontx') +allow_experimental_apis = true diff --git a/drivers/common/cpt/rte_common_cpt_version.map b/drivers/common/cpt/rte_common_cpt_version.map new file mode 100644 index 0000000..dec614f --- /dev/null +++ b/drivers/common/cpt/rte_common_cpt_version.map @@ -0,0 +1,6 @@ +DPDK_18.11 { + global: + + cpt_pmd_ops_helper_get_mlen_direct_mode; + cpt_pmd_ops_helper_get_mlen_sg_mode; +}; diff --git a/drivers/common/meson.build b/drivers/common/meson.build index f828ce7..dd14f85 100644 --- a/drivers/common/meson.build +++ b/drivers/common/meson.build @@ -2,6 +2,6 @@ # Copyright(c) 2018 Cavium, Inc std_deps = ['eal'] -drivers = ['mvep', 'octeontx', 'qat'] +drivers = ['cpt', 'mvep', 'octeontx', 'qat'] config_flag_fmt = 'RTE_LIBRTE_@0@_COMMON' driver_name_fmt = 'rte_common_@0@' diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 9661cdf..946d3e9 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -94,6 +94,10 @@ ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni endif +ifeq ($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO),y) +_LDLIBS-y += -lrte_common_cpt +endif + ifeq ($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF)$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL),yy) _LDLIBS-y += -lrte_common_octeontx endif -- 2.7.4