From patchwork Thu Sep 13 06:08:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gagandeep Singh X-Patchwork-Id: 146604 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp214942ljw; Wed, 12 Sep 2018 23:10:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbUBgxFIbQLHZgynQmbFU4O9AvbnyP27nB64n4YLdv3YXpl3JA9djswMk/vlzvS1u8t2OL3 X-Received: by 2002:a1c:e5cf:: with SMTP id c198-v6mr3880979wmh.113.1536819010314; Wed, 12 Sep 2018 23:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536819010; cv=none; d=google.com; s=arc-20160816; b=Lx6kqBXcqVMSjo9lMu/bEmRz2bwbEna0URHA7Z4TtBqokLi89kCgTYorcYDd0ENAGQ mSFdUsAVGOO53M/qbh3mS9q+K/iitA30Z8kj3XOzgVIf9XfVaabBPmb/dR3ahwyk2c0k XlFaxxtOLysFQdAPoF2xAe+z2J0ydmdt89oeSCPLxcgq0KVQ0U2Lp74MO5ul00CH98Za rYrU8B6z/PVqz2Wv3ryAtUiQsTTLc0FvYB/glCpC4/LTmhIr4L7lKY/yjY5OBCINwerW vsowbbNDBTxarRzjw1E80qIZfxRU7WmbTFxu52wo5HTutlFokcJwv27xUo84bBTNuZo5 dKmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=sDYqw5pVCChmD0OKhIJDY0iIdS9PrmwKGbUVvCL1bgw=; b=X9quWfIG5uD9A6Z9AIJfHkA8CA8E3MaGPD7WRilLEB1EXbnWaA+zr/x/ESSdhXPXmN JFBrK2IkzFM3uCrNCzFOSNwi184i58aF6cb9AFqvio4arlECOrUwNhyVMaDKqhqG0YFl KpWipqysCNP64uNKHrrQSU7YoTJ4qJO1wyaGgcC0jMn986gbhSIwvZXI4r1Ba4KGDXgq u7fvenrgZ4/gOt0jIzBaJC2MGXrGzlVZzxxaAitbhBIMGGA79q6G2nULue/7I68uAu75 //8G0eOEAcAUOrRlR4t7YxEgMY9BKhL2IAhoFwR9aFzpzPwgrWgb4Ote+H7Bu/M1WFtH g1Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=dq7mancO; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id x206-v6si2825639wmb.72.2018.09.12.23.10.10; Wed, 12 Sep 2018 23:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=dq7mancO; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0A50B58FE; Thu, 13 Sep 2018 08:09:40 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20074.outbound.protection.outlook.com [40.107.2.74]) by dpdk.org (Postfix) with ESMTP id 2B2275592 for ; Thu, 13 Sep 2018 08:09:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sDYqw5pVCChmD0OKhIJDY0iIdS9PrmwKGbUVvCL1bgw=; b=dq7mancOmIyOBnXCbyzjMPu3BwHqMcW8QJIhu+rjz3GRP3KsnFm2lbivu6Gxh1pVatvvW57/aSRIbc6Hk/jBe0uY5eZvZ3rBm4NOfjitN4/TslZgS6m/1V3V5d6PPHHmku02GPmUepmAS2NDMhBeK4vzeSd82UI6gP53BtLJCIU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=G.Singh@nxp.com; Received: from Tophie.ap.freescale.net (14.142.187.166) by HE1PR04MB1529.eurprd04.prod.outlook.com (2a01:111:e400:59a8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Thu, 13 Sep 2018 06:09:28 +0000 From: Gagandeep Singh To: dev@dpdk.org, akhil.goyal@nxp.com Cc: Hemant Agrawal , Gagandeep Singh Date: Thu, 13 Sep 2018 11:38:40 +0530 Message-Id: <20180913060846.29930-5-g.singh@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180913060846.29930-1-g.singh@nxp.com> References: <20180913060846.29930-1-g.singh@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0095.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::11) To HE1PR04MB1529.eurprd04.prod.outlook.com (2a01:111:e400:59a8::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b1242390-c0df-48c2-912f-08d6193f772a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:HE1PR04MB1529; X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1529; 3:2C2toBe9hwsurp1J/FDhBaxRVHHnsIuy+M84z/Q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9xjN3fhlFcn1a85drXDhaNpbBeXliN5DJlpUF6eCrpVeFXGbVs9K1VUTqoTHvOEQI/z+jlNRsOykdQJ5hl3kkD8+jqs6Zs5T2SKwHQ+k6iG5rhjNq00Tm3kK/k47SGfwa+kqNcd6e8O7LLidCwXjkNPD0OAy0vSVAelVRtni5vyeg7+E0mDNiCQxNsFx0X9c7znpKijJLe4r20m7PXdLgKVgowCYKfJ0QtJPRicmuc5LYaEXbaZ7kTsdAtmDYucjFFWNEdSIGjV4U5GuTlJm3Oa2XaLRLzCHK3FMgk/9f9DNHi8SU; 4:rBLESxUUHPIaKJy65xeHl/LZjdycAJM+3fcorevDGbg+F/xPdZTmcESYC33GUblPTv1H8M/tE3aCCGL6EPWJbAkTNzG1P1C7ZiF+uGynE1N1r2D0j3GTm/7QsuY5CTjmoXUDH+CqkFyXDpT1Rbq8t+2dofz+nEiNACVkKj0MyNYnGj+xkZpxtMI8ZBfSH5w5Ctg5WxvsIkjScgkXlXDM5mMnZhuyNC/TRuew/li5ZhOs4BuR6qqBx2is84cmjPZjUN+WbWy3Xvage8VcrVM7DqnfgcU/P6V15ZHKi5melgzeqykjqYQ5LUIOh+F6X1x1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:HE1PR04MB1529; BCL:0; PCL:0; RULEID:; SRVR:HE1PR04MB1529; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(136003)(346002)(396003)(189003)(199004)(2906002)(6506007)(386003)(5009440100003)(6486002)(51416003)(6512007)(52116002)(486006)(2616005)(68736007)(956004)(53936002)(476003)(446003)(11346002)(305945005)(26005)(7736002)(55236004)(76176011)(186003)(16526019)(50226002)(478600001)(47776003)(1076002)(3846002)(6116002)(48376002)(105586002)(106356001)(25786009)(14444005)(50466002)(5660300001)(36756003)(72206003)(66066001)(316002)(97736004)(8936002)(81166006)(4326008)(8676002)(86362001)(6636002)(6666003)(54906003)(81156014)(16586007)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1529; H:Tophie.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR04MB1529; 23:tmJ9Ve1aBMtEmBFU9+ho0oiinmdPmkVwoQamk4Ki8?= MCsyiH4zrY6DQBH5z55jZMPtBJhRK8lO/YMWbuECthbTvMsWH9F0EoXUKKx2oqObcopwyvtHsQMdi3u65g1bIqcbZC2lTPFMZjkcSfoHS9HxTpyERMEW9lWgTKcJ0PKaqQIWWk7YU0aFjAau7BnmqKCgs2YC1ROs9Dh98Yw0B74UCgCt9QN83/NxPDUqu4haxunxtdWBy96FlJo8NlUHVjLfcO2dwZEFIxCI8oZIbiG8TZcYG6KxuxKcZ6qLcODwpNhxDFtAsSVaDRWnEBB08SHyoHPd2/SCNiB9yqNQvKltV11ORt/x+FwvDI9jCcv/s3P7MRKkCyGbJ6rqIrzBA6+8NqAwho5I7awi2TXcLmRjiJKj+5TvWaOecgY5y79E+g7Ag2cu9YfC/wzHW2wXrREqEdHGBLSv7QDHKuBMgk/toSnP9lYWejyVXj8ruPhP7ljMQk9Z8AFeCRJkPVHqsj98IUcYmupko0YC1LLdhlbWF4C7PZGcOZTASsAPZxlMNtuAhJIkPDtjPkavhuTgh13bpmDsLG6OvY7Itl3ZM2X2OsnI6zZahdN9c/HSxzMUCS2xRwMZ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r0kwriCvpJGWVuGFV1JUWQ= X-Microsoft-Exchange-Diagnostics: 1; HE1PR04MB1529; 6:B7uDqctSI9eGRN0Z2W+B9kfqh1Iv6anijiqJEXcimLpgubXrMn5S88ajk1X/IXNfRLiY9m4zhw78RCDWwEVyZobMABSRTXhgQd2nLPKwlXkcKcZ/j1RLwhBB2kDlWZT5d/XoBSESek+qFyWzBo+c5D9/kK4JbqkrGc/vocbbRtUO8pUsEY7swWL6VjZuCoQEWCqOgzqOOjakBTTPRTpb5Vw6oWKRdEfRNMIsQtE4MD0Qhce3n3CO+VOUTH9ot+wVnNsKk7OFYssNhP2hOY06ljQ3Y3/IINCkUr2SnGleNzt6BXfmwc8F93VmGxQ4SAhG22e1arMrzeqgTuXEzeesn4v212mJvbfz+fIFPlTqiquQY1qTK7C8dyiHqLsb9t46Xd7LcznrNNeuTYFKPyyRXYT/WRslboCW5Sa0pe6E4pnJA250lZLWe0XEbJ/hXLEoihmZMYieuaAT7zPNKmWonA==; 5:LdZTfd+7FMmghlsE6zIndSpT6TG89cUc4P3BXMWkoHdZmoLOMcgrgOgsiHca2QQH6IeI2sC58wBWBbYU+ukLLxfXMv2N0fHsm9Zwc4Qu/XQARGb9i9pV45DS3CbhKhr1bIeFNAnt6nMHwDcFmXB60kB98jchoOjIhJWuNwsWmcw=; 7:bav5vzRFr9YYkJyOYR4Fe3Rdowhor2LMTQuQesw3q1xMj8WFS6lLxtzwJNes7fvB2Ks5w236LRkUGjQIVDW67ZSfD9H9p6UraJawybBbB+dXrE6dgSfWc8/NnEg1/5lT3grditg3Hrm0XlUntj7oPvvDn2QK2tau7/iH/53X3jI86l9UMykGSBIi9p4nn9qrK++mT/gdErg//XxxlDovog7dWbLhn9SGo36RdZgkZWtkleFMmd4rXejgLtdigCCH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 06:09:28.0696 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b1242390-c0df-48c2-912f-08d6193f772a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB1529 Subject: [dpdk-dev] [PATCH 04/10] crypto/caam_jr: add device configuration routines 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: Hemant Agrawal Signed-off-by: Gagandeep Singh Signed-off-by: Hemant Agrawal --- drivers/crypto/caam_jr/caam_jr.c | 100 +++++++++++- drivers/crypto/caam_jr/caam_jr.h | 257 +++++++++++++++++++++++++++++++ 2 files changed, 356 insertions(+), 1 deletion(-) create mode 100644 drivers/crypto/caam_jr/caam_jr.h -- 2.17.1 diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index 9d5f5b79b..43fe5233b 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -104,6 +105,90 @@ static void hw_flush_job_ring(struct sec_job_ring_t *job_ring, } +static int +caam_jr_dev_configure(struct rte_cryptodev *dev, + struct rte_cryptodev_config *config __rte_unused) +{ + char str[20]; + struct sec_job_ring_t *internals; + + PMD_INIT_FUNC_TRACE(); + + internals = dev->data->dev_private; + sprintf(str, "ctx_pool_%d", dev->data->dev_id); + if (!internals->ctx_pool) { + internals->ctx_pool = rte_mempool_create((const char *)str, + CTX_POOL_NUM_BUFS, + sizeof(struct caam_jr_op_ctx), + CTX_POOL_CACHE_SIZE, 0, + NULL, NULL, NULL, NULL, + SOCKET_ID_ANY, 0); + if (!internals->ctx_pool) { + CAAM_JR_ERR("%s create failed\n", str); + return -ENOMEM; + } + } else + CAAM_JR_INFO("mempool already created for dev_id : %d", + dev->data->dev_id); + + return 0; +} + +static int +caam_jr_dev_start(struct rte_cryptodev *dev __rte_unused) +{ + PMD_INIT_FUNC_TRACE(); + return 0; +} + +static void +caam_jr_dev_stop(struct rte_cryptodev *dev __rte_unused) +{ + PMD_INIT_FUNC_TRACE(); +} + +static int +caam_jr_dev_close(struct rte_cryptodev *dev) +{ + struct sec_job_ring_t *internals; + + PMD_INIT_FUNC_TRACE(); + + if (dev == NULL) + return -ENOMEM; + + internals = dev->data->dev_private; + rte_mempool_free(internals->ctx_pool); + internals->ctx_pool = NULL; + + return 0; +} + +static void +caam_jr_dev_infos_get(struct rte_cryptodev *dev, + struct rte_cryptodev_info *info) +{ + struct sec_job_ring_t *internals = dev->data->dev_private; + + PMD_INIT_FUNC_TRACE(); + if (info != NULL) { + info->max_nb_queue_pairs = internals->max_nb_queue_pairs; + info->feature_flags = dev->feature_flags; + info->capabilities = caam_jr_capabilities; + info->sym.max_nb_sessions = internals->max_nb_sessions; + info->driver_id = cryptodev_driver_id; + } +} + +static struct rte_cryptodev_ops caam_jr_ops = { + .dev_configure = caam_jr_dev_configure, + .dev_start = caam_jr_dev_start, + .dev_stop = caam_jr_dev_stop, + .dev_close = caam_jr_dev_close, + .dev_infos_get = caam_jr_dev_infos_get, +}; + + /* @brief Flush job rings of any processed descs. * The processed descs are silently dropped, * WITHOUT being notified to UA. @@ -366,7 +451,20 @@ caam_jr_dev_init(const char *name, } dev->driver_id = cryptodev_driver_id; - dev->dev_ops = NULL; + dev->dev_ops = &caam_jr_ops; + + /* register rx/tx burst functions for data path */ + dev->dequeue_burst = NULL; + dev->enqueue_burst = NULL; + dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | + RTE_CRYPTODEV_FF_HW_ACCELERATED | + RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | + RTE_CRYPTODEV_FF_SECURITY | + RTE_CRYPTODEV_FF_IN_PLACE_SGL | + RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | + RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | + RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT | + RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT; /* For secondary processes, we don't initialise any further as primary * has already done this work. Only check we don't need a different diff --git a/drivers/crypto/caam_jr/caam_jr.h b/drivers/crypto/caam_jr/caam_jr.h new file mode 100644 index 000000000..d7c36ca9d --- /dev/null +++ b/drivers/crypto/caam_jr/caam_jr.h @@ -0,0 +1,257 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017-2018 NXP + */ + +#ifndef CAAM_JR_H +#define CAAM_JR_H + +static const struct rte_cryptodev_capabilities caam_jr_capabilities[] = { + { /* MD5 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_MD5_HMAC, + .block_size = 64, + .key_size = { + .min = 1, + .max = 64, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 16, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* 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 = 1, + .max = 64, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 20, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* SHA224 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA224_HMAC, + .block_size = 64, + .key_size = { + .min = 1, + .max = 64, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 28, + .increment = 1 + }, + .iv_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 = 1, + .max = 64, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 32, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* SHA384 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA384_HMAC, + .block_size = 128, + .key_size = { + .min = 1, + .max = 128, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 48, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* SHA512 HMAC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AUTH, + {.auth = { + .algo = RTE_CRYPTO_AUTH_SHA512_HMAC, + .block_size = 128, + .key_size = { + .min = 1, + .max = 128, + .increment = 1 + }, + .digest_size = { + .min = 1, + .max = 64, + .increment = 1 + }, + .iv_size = { 0 } + }, } + }, } + }, + { /* AES GCM */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_AEAD, + {.aead = { + .algo = RTE_CRYPTO_AEAD_AES_GCM, + .block_size = 16, + .key_size = { + .min = 16, + .max = 32, + .increment = 8 + }, + .digest_size = { + .min = 8, + .max = 16, + .increment = 4 + }, + .aad_size = { + .min = 0, + .max = 240, + .increment = 1 + }, + .iv_size = { + .min = 12, + .max = 12, + .increment = 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 = 32, + .increment = 8 + }, + .iv_size = { + .min = 16, + .max = 16, + .increment = 0 + } + }, } + }, } + }, + { /* AES CTR */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_AES_CTR, + .block_size = 16, + .key_size = { + .min = 16, + .max = 32, + .increment = 8 + }, + .iv_size = { + .min = 16, + .max = 16, + .increment = 0 + } + }, } + }, } + }, + { /* 3DES CBC */ + .op = RTE_CRYPTO_OP_TYPE_SYMMETRIC, + {.sym = { + .xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER, + {.cipher = { + .algo = RTE_CRYPTO_CIPHER_3DES_CBC, + .block_size = 8, + .key_size = { + .min = 16, + .max = 24, + .increment = 8 + }, + .iv_size = { + .min = 8, + .max = 8, + .increment = 0 + } + }, } + }, } + }, + + RTE_CRYPTODEV_END_OF_CAPABILITIES_LIST() +}; + +static const struct rte_security_capability caam_jr_security_cap[] = { + { /* IPsec Lookaside Protocol offload ESP Transport Egress */ + .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, + .protocol = RTE_SECURITY_PROTOCOL_IPSEC, + .ipsec = { + .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP, + .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, + .direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS, + .options = { 0 } + }, + .crypto_capabilities = caam_jr_capabilities + }, + { /* IPsec Lookaside Protocol offload ESP Tunnel Ingress */ + .action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, + .protocol = RTE_SECURITY_PROTOCOL_IPSEC, + .ipsec = { + .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP, + .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, + .direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS, + .options = { 0 } + }, + .crypto_capabilities = caam_jr_capabilities + }, + { + .action = RTE_SECURITY_ACTION_TYPE_NONE + } +}; + +#endif