From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 23EC242BA3; Fri, 26 May 2023 05:16:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88EFC42D35; Fri, 26 May 2023 05:15:51 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2045.outbound.protection.outlook.com [40.107.244.45]) by mails.dpdk.org (Postfix) with ESMTP id E973842BDA for ; Fri, 26 May 2023 05:15:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dWI0V9e8Ydy9Zk7mPqLdx19fnZJTlmcz242AYByby/wKaM/GkVClHxspn666vmX458fY6Q00+iGIsIXsX+EevjlG3gppTsKtsJfzsDvXPCCVOwDo2nNLeV1JzyBU1UA3bQTIGCCf7KF4Fxwuw36rJSyd3hswlySdn/upZMEpR8EmjLFc05iY6Rhr4FriY/0ukuvmoi52QGZAENwrRX9H8kGnYs1qswfcXFSw5jkg2Y8RgtmR5dequWCY7r4dCB8sorXVBebBuZe9C9FuF3CpTi5XdBAOS00i4rLdO5w/Nu9MMFGk4Mf/j0feBpqzzrU53f68zKmpmUsTkrK/37lWRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=82PhRJ2t2i073GYi/DJQaF3yPORlODVW5vZK4bF1Afo=; b=JoZR4irLCdBc7NeiuEawCc7v4KX1KLHVyv+Q57DmKOb3CqQsl1/hUuhxRdQp+ylBkai3wkaLARGTPHzqmQoYvny0WlLQd8vqh5EAtBwg7sIlBIMmToltr2ieiOt0ruZn847mBAUI3VKM6gGETP+6lMvSpa5gamYh0JsJPMOddMDhFtrEO9TuZGE+ERaOX8Kqx15bTs435PeN0RllDdtTVGQ659DHhgTMLO3FdOj8NmeT5NDKC6jaP72V/L1YUW8k7m7Wqnw5XJJvWE+JnY1KwrJ+gJtj6i5n0d6VCVFsdoYsTvGDPljtTm7ihkYtqK1qX3p6b6WqvOACr5JceFxbKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=82PhRJ2t2i073GYi/DJQaF3yPORlODVW5vZK4bF1Afo=; b=Kbdqr9eVKZAa3KVM95FMWcMaIp/SK9cM+Ky7X0R+9MCS4nwtI9Erph6La1IgbU9SEo8LrmnzS0VQk0SZIaPjYVaF02yu+6viSuwISSRxEaiUfHUoJac+C4ik9N6GClxq2U7OOeK/ORr5idCythUdaCRhSniRQloqhWYaE2Nw7gdTcG63q38kiW6Uqzf0MA2OEpYlHVVNeXyEFK2qkDgZWjLnEW5lgqMkjoQ1VtPKEpzoa2+v1ZqH3rCpwxDacFNkrLTr4LKdYVFAQVSuPT/jG4wJnGD8V/kJ20Y/A/lb1BV+RIunL/8mBoHA3iPjLm121LINam8N0+N12mld7ykzcg== Received: from BN8PR04CA0006.namprd04.prod.outlook.com (2603:10b6:408:70::19) by DM6PR12MB4911.namprd12.prod.outlook.com (2603:10b6:5:20e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.16; Fri, 26 May 2023 03:15:45 +0000 Received: from BN8NAM11FT113.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::fb) by BN8PR04CA0006.outlook.office365.com (2603:10b6:408:70::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.18 via Frontend Transport; Fri, 26 May 2023 03:15:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT113.mail.protection.outlook.com (10.13.176.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.17 via Frontend Transport; Fri, 26 May 2023 03:15:45 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Thu, 25 May 2023 20:15:30 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Thu, 25 May 2023 20:15:28 -0700 From: Suanming Mou To: Matan Azrad CC: , Subject: [PATCH v2 4/9] crypto/mlx5: add AES-GCM encryption key Date: Fri, 26 May 2023 06:14:16 +0300 Message-ID: <20230526031422.913377-5-suanmingm@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230526031422.913377-1-suanmingm@nvidia.com> References: <20230418092325.2578712-1-suanmingm@nvidia.com> <20230526031422.913377-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT113:EE_|DM6PR12MB4911:EE_ X-MS-Office365-Filtering-Correlation-Id: f1917107-5362-4899-5165-08db5d977f16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9FVQXoXDEsoUX8rMJ+RWgJZe8CSmHXojF5ZCf+RvurbVsRBrmz7SmrG8KTlSAqGyO6gjqXVboOyDcIghjxpmvtiWM0U9Sgo+Bvk4NScfMf37En6yVXB/ObuaFixqGlzc3uBFoTbUZ1icYiriFHxJwLpc0nFnZ385PKxrg4ZGLk1kLqfsx1+McUjOcCk0vc1Sp24IWn8iLnqgeW88ra6t1CA1BO+i1ibH2gDB6OrMIkPh9+3Cja8pAoZ5gSsSHvE7sCNCuraLhXk1jUmEvqSeqPrANXvUFfBaRWbmo5us8+K8B+W4C6TQX/ORg8Z3Npx6OJt0OVXUx3uPLT6GovAnx8Au2UMVyYLTwUTTkUUoPHQSH9A/cLPAmtJ5pZKp4tvx+Avhfb1p9GvhlZm/asbxdMVgz2x8P9UzT7v352/Pv0pzXLJU/Scwp7oWFzd7KWYVxYY9TcaZCIYixki+HFUHxaHzitFjucpVAoNIIZMOYyT5jMVPdTb6haU56T2jonuaBs6YnXmDZ6uKa6mOg/F5rMh/zRgT8mAxkLu3acg50qlXfQ0looFN34aYa9IW0RU7crHgbgn8i+2KgA+LvOumiXxI+IyPMF+75PVPFji8JFMq3jZx95rcTTVRuvCpnS1smxa3V4JTNtgY/meI2Ei9F26Ujc3ythFwFPeGGfr5Gz9dUI+RaxwwSLlutHgvUPDsdXl+alqncXOvukW6rE3DDJLlC6EimYh0Lj8SMxzgfA7xRvevhlQ5Vbv1oGXdd+3E X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(37006003)(478600001)(70206006)(16526019)(70586007)(7696005)(4326008)(6636002)(41300700001)(6862004)(8936002)(8676002)(5660300002)(336012)(426003)(83380400001)(6286002)(2616005)(47076005)(2906002)(36860700001)(316002)(6666004)(54906003)(82740400003)(186003)(82310400005)(356005)(7636003)(86362001)(26005)(36756003)(107886003)(1076003)(40460700003)(40480700001)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2023 03:15:45.4796 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1917107-5362-4899-5165-08db5d977f16 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT113.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4911 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The crypto device requires the DEK(data encryption key) object for data encryption/decryption operation. This commit adds the AES-GCM DEK object management support. Signed-off-by: Suanming Mou --- drivers/crypto/mlx5/mlx5_crypto.h | 17 ++++- drivers/crypto/mlx5/mlx5_crypto_dek.c | 102 +++++++++++++------------- drivers/crypto/mlx5/mlx5_crypto_gcm.c | 31 ++++++++ drivers/crypto/mlx5/mlx5_crypto_xts.c | 53 ++++++++++++- 4 files changed, 148 insertions(+), 55 deletions(-) diff --git a/drivers/crypto/mlx5/mlx5_crypto.h b/drivers/crypto/mlx5/mlx5_crypto.h index 76f368ee91..bb5a557a38 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.h +++ b/drivers/crypto/mlx5/mlx5_crypto.h @@ -86,6 +86,11 @@ struct mlx5_crypto_session { uint32_t dek_id; /**< DEK ID */ } __rte_packed; +struct mlx5_crypto_dek_ctx { + struct rte_crypto_sym_xform *xform; + struct mlx5_crypto_priv *priv; +}; + typedef void *(*mlx5_crypto_mkey_update_t)(struct mlx5_crypto_priv *priv, struct mlx5_crypto_qp *qp, uint32_t idx); @@ -106,7 +111,7 @@ mlx5_crypto_dek_destroy(struct mlx5_crypto_priv *priv, struct mlx5_crypto_dek * mlx5_crypto_dek_prepare(struct mlx5_crypto_priv *priv, - struct rte_crypto_cipher_xform *cipher); + struct rte_crypto_sym_xform *xform); int mlx5_crypto_dek_setup(struct mlx5_crypto_priv *priv); @@ -120,4 +125,14 @@ mlx5_crypto_xts_init(struct mlx5_crypto_priv *priv); int mlx5_crypto_gcm_init(struct mlx5_crypto_priv *priv); +int +mlx5_crypto_dek_fill_xts_attr(struct mlx5_crypto_dek *dek, + struct mlx5_devx_dek_attr *dek_attr, + void *cb_ctx); + +int +mlx5_crypto_dek_fill_gcm_attr(struct mlx5_crypto_dek *dek, + struct mlx5_devx_dek_attr *dek_attr, + void *cb_ctx); + #endif /* MLX5_CRYPTO_H_ */ diff --git a/drivers/crypto/mlx5/mlx5_crypto_dek.c b/drivers/crypto/mlx5/mlx5_crypto_dek.c index 7339ef2bd9..716bcc0545 100644 --- a/drivers/crypto/mlx5/mlx5_crypto_dek.c +++ b/drivers/crypto/mlx5/mlx5_crypto_dek.c @@ -13,10 +13,24 @@ #include "mlx5_crypto_utils.h" #include "mlx5_crypto.h" -struct mlx5_crypto_dek_ctx { - struct rte_crypto_cipher_xform *cipher; - struct mlx5_crypto_priv *priv; -}; +static int +mlx5_crypto_dek_get_key(struct rte_crypto_sym_xform *xform, + const uint8_t **key, + uint16_t *key_len) +{ + if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) { + *key = xform->cipher.key.data; + *key_len = xform->cipher.key.length; + } else if (xform->type == RTE_CRYPTO_SYM_XFORM_AEAD) { + *key = xform->aead.key.data; + *key_len = xform->aead.key.length; + } else { + DRV_LOG(ERR, "Xform dek type not supported."); + rte_errno = -EINVAL; + return -1; + } + return 0; +} int mlx5_crypto_dek_destroy(struct mlx5_crypto_priv *priv, @@ -27,19 +41,22 @@ mlx5_crypto_dek_destroy(struct mlx5_crypto_priv *priv, struct mlx5_crypto_dek * mlx5_crypto_dek_prepare(struct mlx5_crypto_priv *priv, - struct rte_crypto_cipher_xform *cipher) + struct rte_crypto_sym_xform *xform) { + const uint8_t *key; + uint16_t key_len; struct mlx5_hlist *dek_hlist = priv->dek_hlist; struct mlx5_crypto_dek_ctx dek_ctx = { - .cipher = cipher, + .xform = xform, .priv = priv, }; - struct rte_crypto_cipher_xform *cipher_ctx = cipher; - uint64_t key64 = __rte_raw_cksum(cipher_ctx->key.data, - cipher_ctx->key.length, 0); - struct mlx5_list_entry *entry = mlx5_hlist_register(dek_hlist, - key64, &dek_ctx); + uint64_t key64; + struct mlx5_list_entry *entry; + if (mlx5_crypto_dek_get_key(xform, &key, &key_len)) + return NULL; + key64 = __rte_raw_cksum(key, key_len, 0); + entry = mlx5_hlist_register(dek_hlist, key64, &dek_ctx); return entry == NULL ? NULL : container_of(entry, struct mlx5_crypto_dek, entry); } @@ -76,76 +93,55 @@ mlx5_crypto_dek_match_cb(void *tool_ctx __rte_unused, struct mlx5_list_entry *entry, void *cb_ctx) { struct mlx5_crypto_dek_ctx *ctx = cb_ctx; - struct rte_crypto_cipher_xform *cipher_ctx = ctx->cipher; + struct rte_crypto_sym_xform *xform = ctx->xform; struct mlx5_crypto_dek *dek = container_of(entry, typeof(*dek), entry); uint32_t key_len = dek->size; + uint16_t xkey_len; + const uint8_t *key; - if (key_len != cipher_ctx->key.length) + if (mlx5_crypto_dek_get_key(xform, &key, &xkey_len)) + return -1; + if (key_len != xkey_len) return -1; - return memcmp(cipher_ctx->key.data, dek->data, cipher_ctx->key.length); + return memcmp(key, dek->data, xkey_len); } static struct mlx5_list_entry * mlx5_crypto_dek_create_cb(void *tool_ctx __rte_unused, void *cb_ctx) { struct mlx5_crypto_dek_ctx *ctx = cb_ctx; - struct rte_crypto_cipher_xform *cipher_ctx = ctx->cipher; + struct rte_crypto_sym_xform *xform = ctx->xform; struct mlx5_crypto_dek *dek = rte_zmalloc(__func__, sizeof(*dek), RTE_CACHE_LINE_SIZE); struct mlx5_devx_dek_attr dek_attr = { .pd = ctx->priv->cdev->pdn, - .key_purpose = MLX5_CRYPTO_KEY_PURPOSE_AES_XTS, - .has_keytag = 1, }; - bool is_wrapped = ctx->priv->is_wrapped_mode; + int ret = -1; if (dek == NULL) { DRV_LOG(ERR, "Failed to allocate dek memory."); return NULL; } - if (is_wrapped) { - switch (cipher_ctx->key.length) { - case 48: - dek->size = 48; - dek_attr.key_size = MLX5_CRYPTO_KEY_SIZE_128b; - break; - case 80: - dek->size = 80; - dek_attr.key_size = MLX5_CRYPTO_KEY_SIZE_256b; - break; - default: - DRV_LOG(ERR, "Wrapped key size not supported."); - return NULL; - } - } else { - switch (cipher_ctx->key.length) { - case 32: - dek->size = 40; - dek_attr.key_size = MLX5_CRYPTO_KEY_SIZE_128b; - break; - case 64: - dek->size = 72; - dek_attr.key_size = MLX5_CRYPTO_KEY_SIZE_256b; - break; - default: - DRV_LOG(ERR, "Key size not supported."); - return NULL; - } - memcpy(&dek_attr.key[cipher_ctx->key.length], - &ctx->priv->keytag, 8); - } - memcpy(&dek_attr.key, cipher_ctx->key.data, cipher_ctx->key.length); + if (xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) + ret = mlx5_crypto_dek_fill_xts_attr(dek, &dek_attr, cb_ctx); + else if (xform->type == RTE_CRYPTO_SYM_XFORM_AEAD) + ret = mlx5_crypto_dek_fill_gcm_attr(dek, &dek_attr, cb_ctx); + if (ret) + goto fail; dek->obj = mlx5_devx_cmd_create_dek_obj(ctx->priv->cdev->ctx, &dek_attr); if (dek->obj == NULL) { - rte_free(dek); - return NULL; + DRV_LOG(ERR, "Failed to create dek obj."); + goto fail; } - memcpy(&dek->data, cipher_ctx->key.data, cipher_ctx->key.length); return &dek->entry; +fail: + rte_free(dek); + return NULL; } + static void mlx5_crypto_dek_remove_cb(void *tool_ctx __rte_unused, struct mlx5_list_entry *entry) diff --git a/drivers/crypto/mlx5/mlx5_crypto_gcm.c b/drivers/crypto/mlx5/mlx5_crypto_gcm.c index bd78c6d66b..676bec6b18 100644 --- a/drivers/crypto/mlx5/mlx5_crypto_gcm.c +++ b/drivers/crypto/mlx5/mlx5_crypto_gcm.c @@ -27,6 +27,37 @@ static struct rte_cryptodev_capabilities mlx5_crypto_gcm_caps[] = { } }; +int +mlx5_crypto_dek_fill_gcm_attr(struct mlx5_crypto_dek *dek, + struct mlx5_devx_dek_attr *dek_attr, + void *cb_ctx) +{ + struct mlx5_crypto_dek_ctx *ctx = cb_ctx; + struct rte_crypto_aead_xform *aead_ctx = &ctx->xform->aead; + + if (aead_ctx->algo != RTE_CRYPTO_AEAD_AES_GCM) { + DRV_LOG(ERR, "Only AES-GCM algo supported."); + return -EINVAL; + } + dek_attr->key_purpose = MLX5_CRYPTO_KEY_PURPOSE_GCM; + switch (aead_ctx->key.length) { + case 16: + dek->size = 16; + dek_attr->key_size = MLX5_CRYPTO_KEY_SIZE_128b; + break; + case 32: + dek->size = 32; + dek_attr->key_size = MLX5_CRYPTO_KEY_SIZE_256b; + break; + default: + DRV_LOG(ERR, "Wrapped key size not supported."); + return -EINVAL; + } + memcpy(&dek_attr->key, aead_ctx->key.data, aead_ctx->key.length); + memcpy(&dek->data, aead_ctx->key.data, aead_ctx->key.length); + return 0; +} + int mlx5_crypto_gcm_init(struct mlx5_crypto_priv *priv) { diff --git a/drivers/crypto/mlx5/mlx5_crypto_xts.c b/drivers/crypto/mlx5/mlx5_crypto_xts.c index 964d02e6ed..661da5f589 100644 --- a/drivers/crypto/mlx5/mlx5_crypto_xts.c +++ b/drivers/crypto/mlx5/mlx5_crypto_xts.c @@ -45,6 +45,57 @@ const struct rte_cryptodev_capabilities mlx5_crypto_caps[] = { }, }; +int +mlx5_crypto_dek_fill_xts_attr(struct mlx5_crypto_dek *dek, + struct mlx5_devx_dek_attr *dek_attr, + void *cb_ctx) +{ + struct mlx5_crypto_dek_ctx *ctx = cb_ctx; + struct rte_crypto_cipher_xform *cipher_ctx = &ctx->xform->cipher; + bool is_wrapped = ctx->priv->is_wrapped_mode; + + if (cipher_ctx->algo != RTE_CRYPTO_CIPHER_AES_XTS) { + DRV_LOG(ERR, "Only AES-XTS algo supported."); + return -EINVAL; + } + dek_attr->key_purpose = MLX5_CRYPTO_KEY_PURPOSE_AES_XTS; + dek_attr->has_keytag = 1; + if (is_wrapped) { + switch (cipher_ctx->key.length) { + case 48: + dek->size = 48; + dek_attr->key_size = MLX5_CRYPTO_KEY_SIZE_128b; + break; + case 80: + dek->size = 80; + dek_attr->key_size = MLX5_CRYPTO_KEY_SIZE_256b; + break; + default: + DRV_LOG(ERR, "Wrapped key size not supported."); + return -EINVAL; + } + } else { + switch (cipher_ctx->key.length) { + case 32: + dek->size = 40; + dek_attr->key_size = MLX5_CRYPTO_KEY_SIZE_128b; + break; + case 64: + dek->size = 72; + dek_attr->key_size = MLX5_CRYPTO_KEY_SIZE_256b; + break; + default: + DRV_LOG(ERR, "Key size not supported."); + return -EINVAL; + } + memcpy(&dek_attr->key[cipher_ctx->key.length], + &ctx->priv->keytag, 8); + } + memcpy(&dek_attr->key, cipher_ctx->key.data, cipher_ctx->key.length); + memcpy(&dek->data, cipher_ctx->key.data, cipher_ctx->key.length); + return 0; +} + static int mlx5_crypto_xts_sym_session_configure(struct rte_cryptodev *dev, struct rte_crypto_sym_xform *xform, @@ -66,7 +117,7 @@ mlx5_crypto_xts_sym_session_configure(struct rte_cryptodev *dev, return -ENOTSUP; } cipher = &xform->cipher; - sess_private_data->dek = mlx5_crypto_dek_prepare(priv, cipher); + sess_private_data->dek = mlx5_crypto_dek_prepare(priv, xform); if (sess_private_data->dek == NULL) { DRV_LOG(ERR, "Failed to prepare dek."); return -ENOMEM; -- 2.25.1