get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/95909/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 95909,
    "url": "http://patches.dpdk.org/api/patches/95909/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210715164126.54073-4-shirik@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210715164126.54073-4-shirik@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210715164126.54073-4-shirik@nvidia.com",
    "date": "2021-07-15T16:41:13",
    "name": "[v8,03/16] crypto/mlx5: add session operations",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "af5d756dad5555d5da10502a7d728c06b65e1df6",
    "submitter": {
        "id": 1894,
        "url": "http://patches.dpdk.org/api/people/1894/?format=api",
        "name": "Shiri Kuzin",
        "email": "shirik@nvidia.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210715164126.54073-4-shirik@nvidia.com/mbox/",
    "series": [
        {
            "id": 17843,
            "url": "http://patches.dpdk.org/api/series/17843/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=17843",
            "date": "2021-07-15T16:41:10",
            "name": "drivers: introduce mlx5 crypto PMD",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/17843/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/95909/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/95909/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 31917A0C41;\n\tThu, 15 Jul 2021 18:42:24 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6512F41287;\n\tThu, 15 Jul 2021 18:42:11 +0200 (CEST)",
            "from NAM10-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam10on2081.outbound.protection.outlook.com [40.107.94.81])\n by mails.dpdk.org (Postfix) with ESMTP id F129141275\n for <dev@dpdk.org>; Thu, 15 Jul 2021 18:42:07 +0200 (CEST)",
            "from MW4PR04CA0025.namprd04.prod.outlook.com (2603:10b6:303:69::30)\n by MWHPR12MB1533.namprd12.prod.outlook.com (2603:10b6:301:f::8) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.23; Thu, 15 Jul\n 2021 16:42:06 +0000",
            "from CO1NAM11FT066.eop-nam11.prod.protection.outlook.com\n (2603:10b6:303:69:cafe::57) by MW4PR04CA0025.outlook.office365.com\n (2603:10b6:303:69::30) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23 via Frontend\n Transport; Thu, 15 Jul 2021 16:42:06 +0000",
            "from mail.nvidia.com (216.228.112.34) by\n CO1NAM11FT066.mail.protection.outlook.com (10.13.175.18) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4331.21 via Frontend Transport; Thu, 15 Jul 2021 16:42:06 +0000",
            "from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com\n (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 15 Jul\n 2021 16:42:04 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=m013+Ijig8x70LtkuRW1l6GLuLmwN3IACTO/fYWZcf2RSvXbh5d8ig59eVLlKPX7UYoeCi8EONEuiAA7+271NBP7c//Gw13iTAOEXIkhr/BtQM3+/mSupK9YS3i+8/BHRSXFKNmd7GLCsev8ODyonZMtJiSEKSfLHe3vqPhLwUDLkoFZu+sRv4RYjwU6kqbDhil7QxNDmi2p6/cllG9ifYOTdCbsUUzq2/K0oBFF5dmSfE31q5u6JpXAc0yCDKd24xv26K28jgFKljoGIHluXayptTE1T2vDanS0cEA2JrP8iLShhnpCKktMLR+zx11n+FngxOb2c+zLaZ8Ef8QFOg==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=Z5sTuWNkYl+cn/A8iRmfa/C7SaLLwniaRU/Q8FxplZo=;\n b=cP2ZeazIPq1YQUMMivAuHnw1hnwlU31ef9CwcWNqiiJHC40ALfvK/Rry3z1/zgQZ3ojz1Q6gsSC/tHBE7MIyzhHF/k1NNfyx7iVTw6bn7xwmyuIHrJWxn2BZE889/YB2lBlZk/vjn/d5Hkb5YcI0KJlOe/uGyE1cmshOyITnawawq1vPgDVlaKIacQbgg6zytVnCeKW9D39jtgAHClJFFKFQ2yVwW0cXQX9xpMs7ipWpZ7pHQgnmTxcHrWIVD4SycfnHg1TTdF5FKxhEgENODAGCdQAvXcdPyPbhWPWfrlae6qsQYdXcRjcJNxRtdSYokL3oSxOxXBrBLf5EqbZ8Xw==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.112.34) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com;\n dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com;\n dkim=none (message not signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=Z5sTuWNkYl+cn/A8iRmfa/C7SaLLwniaRU/Q8FxplZo=;\n b=kVVoBtLg0uwB6f/HTtA4KwGKMc+CB27cRJ4w85Rdu2GkmP6jrzkiQckkXvFrYy+n9gcpApGfbFMYMvgXMOd94gMkG9PkLrNxKsm45Kic6TSXwoKy2j2EUkEqP97By4PTpcJo5w0PB20TYoxduxTgxC0H+9ZqWau9dybr2EZ1eBOLKd4yJ89etiPxSkOOZ+3+df1NybxCDqkfN1PdSXykvPwD7xsMLDgDnKvJWmaumBgjO8svaNiU5vM2xSFjxPY+jjqlE4J/V194dmd6oNOUI+OfeXHGJ7MvwHTF4kaHBwb3+CCh8e5QsSokWc7qcW9xyFOlpq+Ghyl5kqjKwuU0RA==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.112.34)\n smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed)\n header.d=none;redhat.com; dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.112.34 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.112.34; helo=mail.nvidia.com;",
        "From": "Shiri Kuzin <shirik@nvidia.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<matan@nvidia.com>, <gakhil@marvell.com>, <suanmingm@nvidia.com>,\n <david.marchand@redhat.com>",
        "Date": "Thu, 15 Jul 2021 19:41:13 +0300",
        "Message-ID": "<20210715164126.54073-4-shirik@nvidia.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210715164126.54073-1-shirik@nvidia.com>",
        "References": "<20210715150817.51485-1-shirik@nvidia.com>\n <20210715164126.54073-1-shirik@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[172.20.187.6]",
        "X-ClientProxiedBy": "HQMAIL105.nvidia.com (172.20.187.12) To\n HQMAIL107.nvidia.com (172.20.187.13)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "1cd0b00b-a4b7-4158-0bff-08d947af7b42",
        "X-MS-TrafficTypeDiagnostic": "MWHPR12MB1533:",
        "X-Microsoft-Antispam-PRVS": "\n <MWHPR12MB15338FC3070798B4BF72B90FAA129@MWHPR12MB1533.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:8273;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n D25bhYYM8MveKs0BGQ/rvgAvYo+iiO/27UqwmuMLuuP6futc6EpVwwlUB3724C/ivM5aHRV88tpCGaOmQ5mz7UcZlQH9pP9awRqIvNlsITdGDNrbAfmhNZDo0zoenxAvO+PGjYbRojOt2ED2W6Bdqdz3fys80+PbgWnp37+ZPVxTJI1T6oh7e4j1RqJRqoNmnZSQZzDnMQAtdpTC2XcJ3GK3l41/kiQc+XO3Olneal3JaFNgN8G5MfTJ2YeayfTBhVJyqLcwArFOADH7eLsoVKQTh6Gmq3WIDGg52196pEAee6iknIVs4ZzNrhHVbHvO8IUIG5CQG5HVibX0Qv5oabmUxM5mm1k2o/FkP9Cj9Y7CdJuxU9OqNZbajRscA+Y841QB0qtjYfBc4dXe8J6drXrryBicytzjGmPWafGJdnAyKkUPiR+lkQa+iW+mw2dKSJcP0g9PENDtonMGWP20kef30NfB7ONECxhhfepJcL+DdQLmHma2CSsxgLVeOQAScIUh7QtZ2QL9LJglMzMOOX1azJZVZJLkWZalv+qAokclptbWPPsrGK+/THW9uPsBRXgQjS7jyfzhVGuIwfN7ZCTGAOolfy/nnY3kVJprFFBTOOPjLUcoBXYlmF8aG3WRZuEAcXLu/5efNfpaSNZvfzDy0xIGs2mgaUUpWN6KKkymjSd7ME0GGuudB2MwbHZbQH5KLDWWvmr6pKI+tObwP4aHTWVOMLVnok8LDbRHOk8=",
        "X-Forefront-Antispam-Report": "CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE;\n SFS:(4636009)(396003)(39860400002)(136003)(346002)(376002)(36840700001)(46966006)(8936002)(2616005)(1076003)(356005)(7636003)(36860700001)(6666004)(55016002)(4326008)(47076005)(8676002)(86362001)(426003)(336012)(36906005)(478600001)(5660300002)(26005)(83380400001)(7696005)(70586007)(54906003)(6286002)(70206006)(2906002)(34020700004)(82740400003)(36756003)(6916009)(16526019)(186003)(82310400003)(316002);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "15 Jul 2021 16:42:06.1371 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 1cd0b00b-a4b7-4158-0bff-08d947af7b42",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT066.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "MWHPR12MB1533",
        "Subject": "[dpdk-dev] [PATCH v8 03/16] crypto/mlx5: add session operations",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Sessions are used in symmetric transformations in order to prepare\nobjects and data for packet processing stage.\n\nA mlx5 session includes iv_offset, pointer to mlx5_crypto_dek struct,\nbsf_size, bsf_p_type, block size index, encryption_order and encryption\nstandard.\n\nImplement the next session operations:\n        mlx5_crypto_sym_session_get_size- returns the size of the mlx5\n\tsession struct.\n\tmlx5_crypto_sym_session_configure- prepares the DEK hash-list\n\tand saves all the session data.\n\tmlx5_crypto_sym_session_clear - destroys the DEK hash-list.\n\nSigned-off-by: Shiri Kuzin <shirik@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n doc/guides/cryptodevs/features/mlx5.ini |   5 +\n doc/guides/cryptodevs/mlx5.rst          |  10 ++\n drivers/crypto/mlx5/mlx5_crypto.c       | 172 +++++++++++++++++++++++-\n 3 files changed, 182 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/doc/guides/cryptodevs/features/mlx5.ini b/doc/guides/cryptodevs/features/mlx5.ini\nindex ceadd967b6..bd757b5211 100644\n--- a/doc/guides/cryptodevs/features/mlx5.ini\n+++ b/doc/guides/cryptodevs/features/mlx5.ini\n@@ -4,12 +4,17 @@\n ; Refer to default.ini for the full list of available PMD features.\n ;\n [Features]\n+Symmetric crypto       = Y\n HW Accelerated         = Y\n+Cipher multiple data units = Y\n+Cipher wrapped key     = Y\n \n ;\n ; Supported crypto algorithms of a mlx5 crypto driver.\n ;\n [Cipher]\n+AES XTS (128)  = Y\n+AES XTS (256)  = Y\n \n ;\n ; Supported authentication algorithms of a mlx5 crypto driver.\ndiff --git a/doc/guides/cryptodevs/mlx5.rst b/doc/guides/cryptodevs/mlx5.rst\nindex 05a0a449e2..dd1d1a615d 100644\n--- a/doc/guides/cryptodevs/mlx5.rst\n+++ b/doc/guides/cryptodevs/mlx5.rst\n@@ -53,6 +53,16 @@ Supported NICs\n \n * Mellanox\\ |reg| ConnectX\\ |reg|-6 200G MCX654106A-HCAT (2x200G)\n \n+\n+Limitations\n+-----------\n+\n+- AES-XTS keys provided in xform must include keytag and should be wrappend.\n+- The supported data-unit lengths are 512B and 1KB. In case the `dataunit_len`\n+  is not provided in the cipher xform, the OP length is limited to the above\n+  values and 1MB.\n+\n+\n Prerequisites\n -------------\n \ndiff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c\nindex d2d82c7b15..3f0c97d081 100644\n--- a/drivers/crypto/mlx5/mlx5_crypto.c\n+++ b/drivers/crypto/mlx5/mlx5_crypto.c\n@@ -3,6 +3,7 @@\n  */\n \n #include <rte_malloc.h>\n+#include <rte_mempool.h>\n #include <rte_errno.h>\n #include <rte_log.h>\n #include <rte_pci.h>\n@@ -20,7 +21,9 @@\n #define MLX5_CRYPTO_LOG_NAME pmd.crypto.mlx5\n \n #define MLX5_CRYPTO_FEATURE_FLAGS \\\n-\tRTE_CRYPTODEV_FF_HW_ACCELERATED\n+\t(RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_HW_ACCELERATED | \\\n+\t RTE_CRYPTODEV_FF_CIPHER_WRAPPED_KEY | \\\n+\t RTE_CRYPTODEV_FF_CIPHER_MULTIPLE_DATA_UNITS)\n \n TAILQ_HEAD(mlx5_crypto_privs, mlx5_crypto_priv) mlx5_crypto_priv_list =\n \t\t\t\tTAILQ_HEAD_INITIALIZER(mlx5_crypto_priv_list);\n@@ -30,6 +33,32 @@ int mlx5_crypto_logtype;\n \n uint8_t mlx5_crypto_driver_id;\n \n+const struct rte_cryptodev_capabilities mlx5_crypto_caps[] = {\n+\t{\t\t/* AES XTS */\n+\t\t.op = RTE_CRYPTO_OP_TYPE_SYMMETRIC,\n+\t\t{.sym = {\n+\t\t\t.xform_type = RTE_CRYPTO_SYM_XFORM_CIPHER,\n+\t\t\t{.cipher = {\n+\t\t\t\t.algo = RTE_CRYPTO_CIPHER_AES_XTS,\n+\t\t\t\t.block_size = 16,\n+\t\t\t\t.key_size = {\n+\t\t\t\t\t.min = 32,\n+\t\t\t\t\t.max = 64,\n+\t\t\t\t\t.increment = 32\n+\t\t\t\t},\n+\t\t\t\t.iv_size = {\n+\t\t\t\t\t.min = 16,\n+\t\t\t\t\t.max = 16,\n+\t\t\t\t\t.increment = 0\n+\t\t\t\t},\n+\t\t\t\t.dataunit_set =\n+\t\t\t\tRTE_CRYPTO_CIPHER_DATA_UNIT_LEN_512_BYTES |\n+\t\t\t\tRTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES,\n+\t\t\t}, }\n+\t\t}, }\n+\t},\n+};\n+\n static const char mlx5_crypto_drv_name[] = RTE_STR(MLX5_CRYPTO_DRIVER_NAME);\n \n static const struct rte_driver mlx5_drv = {\n@@ -39,6 +68,49 @@ static const struct rte_driver mlx5_drv = {\n \n static struct cryptodev_driver mlx5_cryptodev_driver;\n \n+struct mlx5_crypto_session {\n+\tuint32_t bs_bpt_eo_es;\n+\t/*\n+\t * bsf_size, bsf_p_type, encryption_order and encryption standard,\n+\t * saved in big endian format.\n+\t */\n+\tuint32_t bsp_res;\n+\t/*\n+\t * crypto_block_size_pointer and reserved 24 bits saved in big endian\n+\t * format.\n+\t */\n+\tuint32_t iv_offset:16;\n+\t/* Starting point for Initialisation Vector. */\n+\tstruct mlx5_crypto_dek *dek; /* Pointer to dek struct. */\n+\tuint32_t dek_id; /* DEK ID */\n+} __rte_packed;\n+\n+static void\n+mlx5_crypto_dev_infos_get(struct rte_cryptodev *dev,\n+\t\t\t  struct rte_cryptodev_info *dev_info)\n+{\n+\tRTE_SET_USED(dev);\n+\tif (dev_info != NULL) {\n+\t\tdev_info->driver_id = mlx5_crypto_driver_id;\n+\t\tdev_info->feature_flags = MLX5_CRYPTO_FEATURE_FLAGS;\n+\t\tdev_info->capabilities = mlx5_crypto_caps;\n+\t\tdev_info->max_nb_queue_pairs = 0;\n+\t\tdev_info->min_mbuf_headroom_req = 0;\n+\t\tdev_info->min_mbuf_tailroom_req = 0;\n+\t\tdev_info->sym.max_nb_sessions = 0;\n+\t\t/*\n+\t\t * If 0, the device does not have any limitation in number of\n+\t\t * sessions that can be used.\n+\t\t */\n+\t}\n+}\n+\n+static unsigned int\n+mlx5_crypto_sym_session_get_size(struct rte_cryptodev *dev __rte_unused)\n+{\n+\treturn sizeof(struct mlx5_crypto_session);\n+}\n+\n static int\n mlx5_crypto_dev_configure(struct rte_cryptodev *dev,\n \t\tstruct rte_cryptodev_config *config __rte_unused)\n@@ -61,19 +133,109 @@ mlx5_crypto_dev_close(struct rte_cryptodev *dev)\n \treturn 0;\n }\n \n+static int\n+mlx5_crypto_sym_session_configure(struct rte_cryptodev *dev,\n+\t\t\t\t  struct rte_crypto_sym_xform *xform,\n+\t\t\t\t  struct rte_cryptodev_sym_session *session,\n+\t\t\t\t  struct rte_mempool *mp)\n+{\n+\tstruct mlx5_crypto_priv *priv = dev->data->dev_private;\n+\tstruct mlx5_crypto_session *sess_private_data;\n+\tstruct rte_crypto_cipher_xform *cipher;\n+\tuint8_t encryption_order;\n+\tint ret;\n+\n+\tif (unlikely(xform->next != NULL)) {\n+\t\tDRV_LOG(ERR, \"Xform next is not supported.\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\tif (unlikely((xform->type != RTE_CRYPTO_SYM_XFORM_CIPHER) ||\n+\t\t     (xform->cipher.algo != RTE_CRYPTO_CIPHER_AES_XTS))) {\n+\t\tDRV_LOG(ERR, \"Only AES-XTS algorithm is supported.\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\tret = rte_mempool_get(mp, (void *)&sess_private_data);\n+\tif (ret != 0) {\n+\t\tDRV_LOG(ERR,\n+\t\t\t\"Failed to get session %p private data from mempool.\",\n+\t\t\tsess_private_data);\n+\t\treturn -ENOMEM;\n+\t}\n+\tcipher = &xform->cipher;\n+\tsess_private_data->dek = mlx5_crypto_dek_prepare(priv, cipher);\n+\tif (sess_private_data->dek == NULL) {\n+\t\trte_mempool_put(mp, sess_private_data);\n+\t\tDRV_LOG(ERR, \"Failed to prepare dek.\");\n+\t\treturn -ENOMEM;\n+\t}\n+\tif (cipher->op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)\n+\t\tencryption_order = MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_MEMORY;\n+\telse\n+\t\tencryption_order = MLX5_ENCRYPTION_ORDER_ENCRYPTED_RAW_WIRE;\n+\tsess_private_data->bs_bpt_eo_es = rte_cpu_to_be_32\n+\t\t\t(MLX5_BSF_SIZE_64B << MLX5_BSF_SIZE_OFFSET |\n+\t\t\t MLX5_BSF_P_TYPE_CRYPTO << MLX5_BSF_P_TYPE_OFFSET |\n+\t\t\t encryption_order << MLX5_ENCRYPTION_ORDER_OFFSET |\n+\t\t\t MLX5_ENCRYPTION_STANDARD_AES_XTS);\n+\tswitch (xform->cipher.dataunit_len) {\n+\tcase 0:\n+\t\tsess_private_data->bsp_res = 0;\n+\t\tbreak;\n+\tcase 512:\n+\t\tsess_private_data->bsp_res = rte_cpu_to_be_32\n+\t\t\t\t\t     ((uint32_t)MLX5_BLOCK_SIZE_512B <<\n+\t\t\t\t\t     MLX5_BLOCK_SIZE_OFFSET);\n+\t\tbreak;\n+\tcase 4096:\n+\t\tsess_private_data->bsp_res = rte_cpu_to_be_32\n+\t\t\t\t\t     ((uint32_t)MLX5_BLOCK_SIZE_4096B <<\n+\t\t\t\t\t     MLX5_BLOCK_SIZE_OFFSET);\n+\t\tbreak;\n+\tdefault:\n+\t\tDRV_LOG(ERR, \"Cipher data unit length is not supported.\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\tsess_private_data->iv_offset = cipher->iv.offset;\n+\tsess_private_data->dek_id =\n+\t\t\trte_cpu_to_be_32(sess_private_data->dek->obj->id &\n+\t\t\t\t\t 0xffffff);\n+\tset_sym_session_private_data(session, dev->driver_id,\n+\t\t\t\t     sess_private_data);\n+\tDRV_LOG(DEBUG, \"Session %p was configured.\", sess_private_data);\n+\treturn 0;\n+}\n+\n+static void\n+mlx5_crypto_sym_session_clear(struct rte_cryptodev *dev,\n+\t\t\t      struct rte_cryptodev_sym_session *sess)\n+{\n+\tstruct mlx5_crypto_priv *priv = dev->data->dev_private;\n+\tstruct mlx5_crypto_session *spriv = get_sym_session_private_data(sess,\n+\t\t\t\t\t\t\t\tdev->driver_id);\n+\n+\tif (unlikely(spriv == NULL)) {\n+\t\tDRV_LOG(ERR, \"Failed to get session %p private data.\", spriv);\n+\t\treturn;\n+\t}\n+\tmlx5_crypto_dek_destroy(priv, spriv->dek);\n+\tset_sym_session_private_data(sess, dev->driver_id, NULL);\n+\trte_mempool_put(rte_mempool_from_obj(spriv), spriv);\n+\tDRV_LOG(DEBUG, \"Session %p was cleared.\", spriv);\n+}\n+\n static struct rte_cryptodev_ops mlx5_crypto_ops = {\n \t.dev_configure\t\t\t= mlx5_crypto_dev_configure,\n \t.dev_start\t\t\t= NULL,\n \t.dev_stop\t\t\t= NULL,\n \t.dev_close\t\t\t= mlx5_crypto_dev_close,\n-\t.dev_infos_get\t\t\t= NULL,\n+\t.dev_infos_get\t\t\t= mlx5_crypto_dev_infos_get,\n \t.stats_get\t\t\t= NULL,\n \t.stats_reset\t\t\t= NULL,\n \t.queue_pair_setup\t\t= NULL,\n \t.queue_pair_release\t\t= NULL,\n-\t.sym_session_get_size\t\t= NULL,\n-\t.sym_session_configure\t\t= NULL,\n-\t.sym_session_clear\t\t= NULL,\n+\t.sym_session_get_size\t\t= mlx5_crypto_sym_session_get_size,\n+\t.sym_session_configure\t\t= mlx5_crypto_sym_session_configure,\n+\t.sym_session_clear\t\t= mlx5_crypto_sym_session_clear,\n \t.sym_get_raw_dp_ctx_size\t= NULL,\n \t.sym_configure_raw_dp_ctx\t= NULL,\n };\n",
    "prefixes": [
        "v8",
        "03/16"
    ]
}