Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/57533/?format=api
https://patches.dpdk.org/api/patches/57533/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/afdf82d5439c5129dd3a3c10be59cd2bbe9d3553.1565188248.git.thierry.herbelot@6wind.com/", "project": { "id": 1, "url": "https://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": "<afdf82d5439c5129dd3a3c10be59cd2bbe9d3553.1565188248.git.thierry.herbelot@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/afdf82d5439c5129dd3a3c10be59cd2bbe9d3553.1565188248.git.thierry.herbelot@6wind.com", "date": "2019-08-07T14:37:29", "name": "[19.11,10/12] drivers/crypto/openssl: use a local copy for the session contexts", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "a394d417b5d6540c7981be68fd3ea8cb78e7ed95", "submitter": { "id": 897, "url": "https://patches.dpdk.org/api/people/897/?format=api", "name": "Thierry Herbelot", "email": "thierry.herbelot@6wind.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/afdf82d5439c5129dd3a3c10be59cd2bbe9d3553.1565188248.git.thierry.herbelot@6wind.com/mbox/", "series": [ { "id": 5973, "url": "https://patches.dpdk.org/api/series/5973/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5973", "date": "2019-08-07T14:37:19", "name": "Miscellaneous fixes", "version": 1, "mbox": "https://patches.dpdk.org/series/5973/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/57533/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/57533/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 011FC1B9A0;\n\tWed, 7 Aug 2019 16:38:21 +0200 (CEST)", "from mail-wr1-f68.google.com (mail-wr1-f68.google.com\n\t[209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 23D6E2B9E\n\tfor <dev@dpdk.org>; Wed, 7 Aug 2019 16:38:01 +0200 (CEST)", "by mail-wr1-f68.google.com with SMTP id r1so91598995wrl.7\n\tfor <dev@dpdk.org>; Wed, 07 Aug 2019 07:38:01 -0700 (PDT)", "from ascain.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\t2sm133441211wrn.29.2019.08.07.07.37.59\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 07 Aug 2019 07:37:59 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:in-reply-to:references;\n\tbh=FVzZjSZCwjtSjhN39Ardbr6yKifb6QHpQkNIuBKoh2Q=;\n\tb=hEFT+/qvcpnYk6VEF1UCYyL6fJmF/86rmXAxJ3GCx1Crrih8O0E3+auSeY2wSLkEcL\n\tAxvDvGEE/Thq5lSW5GZAMrPfduCx1Ui/JpeK0tvTNsmuLiqE+FR0WbhXP/83e+RVaaLD\n\t8aD6i51M+8T+xeg7iq6HjDlbH9xCj6jbs6C1++61yJDRhz9WrcZrp4vwyUvgon0V2eiM\n\t2m5fYwW5oT4hgwjNwJaj+bSkbprEEYiqRSQDixrdCgTS6a3wvjim+5qrnFglyeQso/ok\n\t5pcjOzt/HQtaVe1SsmYjgnV9kiLp9cjuKZGw6oGJI+LGwlcvA7WA1IGpuvc3noY43C6y\n\tFGmA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:in-reply-to:references;\n\tbh=FVzZjSZCwjtSjhN39Ardbr6yKifb6QHpQkNIuBKoh2Q=;\n\tb=G69quTDJTUp3kH1pCETxsGJi/BlKtdtMMgKyueXujAr59Soqkm+jvd0/OnY0Apn3k7\n\t85cQ8S/IG4VrJCJgA9ePyHiEs/c51JL0SLlN3nX8r2M3nzE2fEn5Y72tWPFpRLtqHW48\n\t67p+GcA5YASQv+2BmO76DB48O8yU5I3XIjsu+Jf/64YLhHyCasODf/nQepCDTfMp7Dqe\n\tv6qWOdgJG4ga1u5Ly9/G5pmUUukDjzyXAEh3/Id5uBIh3UM6eoL9QcNLST4LNXix2zKq\n\th7XhMq0TnEc77guRO54MyT35KS/jak64sXG0Nv90ezh4t47CwY3owmu1CbpJPuz6Njvi\n\t3O1Q==", "X-Gm-Message-State": "APjAAAWTmlP/Yje3yCOYh6YvzOfG1ELx7iGnVqvc8/S53Y2FsvoyTrru\n\thgc7lqr2+MEEJcBwRn1ARluae/7Zjw==", "X-Google-Smtp-Source": "APXvYqxWfoeibiwRsJAQbvEaxjLQlXcV6GWaiiv5zipZGROsBtgX1AHPDO9/scZvqpuYBRos8jZLyQ==", "X-Received": "by 2002:adf:e691:: with SMTP id\n\tr17mr11541284wrm.67.1565188680467; \n\tWed, 07 Aug 2019 07:38:00 -0700 (PDT)", "From": "Thierry Herbelot <thierry.herbelot@6wind.com>", "To": "dev@dpdk.org", "Cc": "stable@dpdk.org,\n\tThomas Monjalon <thomas@monjalon.net>", "Date": "Wed, 7 Aug 2019 16:37:29 +0200", "Message-Id": "<afdf82d5439c5129dd3a3c10be59cd2bbe9d3553.1565188248.git.thierry.herbelot@6wind.com>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": [ "<cover.1565188248.git.thierry.herbelot@6wind.com>", "<cover.1565188248.git.thierry.herbelot@6wind.com>" ], "References": [ "<cover.1565188248.git.thierry.herbelot@6wind.com>", "<cover.1565188248.git.thierry.herbelot@6wind.com>" ], "Subject": "[dpdk-dev] [PATCH 19.11 10/12] drivers/crypto/openssl: use a local\n\tcopy for the session contexts", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Session contexts are used for temporary storage when processing a\npacket.\nIf packets for the same session are to be processed simultaneously on\nmultiple cores, separate contexts must be used.\n\nNote: with openssl 1.1.1 EVP_CIPHER_CTX can no longer be defined as a\nvariable on the stack: it must be allocated. This in turn reduces the\nperformance.\n\nFixes: d61f70b4c918 ('crypto/libcrypto: add driver for OpenSSL library')\nCc: stable at dpdk.org\n\nSigned-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>\n---\n drivers/crypto/openssl/rte_openssl_pmd.c | 34 +++++++++++++++++++++++---------\n 1 file changed, 25 insertions(+), 9 deletions(-)", "diff": "diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c\nindex 2f5552840741..ce2d12347737 100644\n--- a/drivers/crypto/openssl/rte_openssl_pmd.c\n+++ b/drivers/crypto/openssl/rte_openssl_pmd.c\n@@ -1290,6 +1290,7 @@ process_openssl_combined_op\n \tint srclen, aadlen, status = -1;\n \tuint32_t offset;\n \tuint8_t taglen;\n+\tEVP_CIPHER_CTX *ctx_copy;\n \n \t/*\n \t * Segmented destination buffer is not supported for\n@@ -1326,6 +1327,8 @@ process_openssl_combined_op\n \t}\n \n \ttaglen = sess->auth.digest_length;\n+\tctx_copy = EVP_CIPHER_CTX_new();\n+\tEVP_CIPHER_CTX_copy(ctx_copy, sess->cipher.ctx);\n \n \tif (sess->cipher.direction == RTE_CRYPTO_CIPHER_OP_ENCRYPT) {\n \t\tif (sess->auth.algo == RTE_CRYPTO_AUTH_AES_GMAC ||\n@@ -1333,12 +1336,12 @@ process_openssl_combined_op\n \t\t\tstatus = process_openssl_auth_encryption_gcm(\n \t\t\t\t\tmbuf_src, offset, srclen,\n \t\t\t\t\taad, aadlen, iv,\n-\t\t\t\t\tdst, tag, sess->cipher.ctx);\n+\t\t\t\t\tdst, tag, ctx_copy);\n \t\telse\n \t\t\tstatus = process_openssl_auth_encryption_ccm(\n \t\t\t\t\tmbuf_src, offset, srclen,\n \t\t\t\t\taad, aadlen, iv,\n-\t\t\t\t\tdst, tag, taglen, sess->cipher.ctx);\n+\t\t\t\t\tdst, tag, taglen, ctx_copy);\n \n \t} else {\n \t\tif (sess->auth.algo == RTE_CRYPTO_AUTH_AES_GMAC ||\n@@ -1346,14 +1349,15 @@ process_openssl_combined_op\n \t\t\tstatus = process_openssl_auth_decryption_gcm(\n \t\t\t\t\tmbuf_src, offset, srclen,\n \t\t\t\t\taad, aadlen, iv,\n-\t\t\t\t\tdst, tag, sess->cipher.ctx);\n+\t\t\t\t\tdst, tag, ctx_copy);\n \t\telse\n \t\t\tstatus = process_openssl_auth_decryption_ccm(\n \t\t\t\t\tmbuf_src, offset, srclen,\n \t\t\t\t\taad, aadlen, iv,\n-\t\t\t\t\tdst, tag, taglen, sess->cipher.ctx);\n+\t\t\t\t\tdst, tag, taglen, ctx_copy);\n \t}\n \n+\tEVP_CIPHER_CTX_free(ctx_copy);\n \tif (status != 0) {\n \t\tif (status == (-EFAULT) &&\n \t\t\t\tsess->auth.operation ==\n@@ -1372,6 +1376,7 @@ process_openssl_cipher_op\n {\n \tuint8_t *dst, *iv;\n \tint srclen, status;\n+\tEVP_CIPHER_CTX *ctx_copy;\n \n \t/*\n \t * Segmented destination buffer is not supported for\n@@ -1388,22 +1393,25 @@ process_openssl_cipher_op\n \n \tiv = rte_crypto_op_ctod_offset(op, uint8_t *,\n \t\t\tsess->iv.offset);\n+\tctx_copy = EVP_CIPHER_CTX_new();\n+\tEVP_CIPHER_CTX_copy(ctx_copy, sess->cipher.ctx);\n \n \tif (sess->cipher.mode == OPENSSL_CIPHER_LIB)\n \t\tif (sess->cipher.direction == RTE_CRYPTO_CIPHER_OP_ENCRYPT)\n \t\t\tstatus = process_openssl_cipher_encrypt(mbuf_src, dst,\n \t\t\t\t\top->sym->cipher.data.offset, iv,\n-\t\t\t\t\tsrclen, sess->cipher.ctx);\n+\t\t\t\t\tsrclen, ctx_copy);\n \t\telse\n \t\t\tstatus = process_openssl_cipher_decrypt(mbuf_src, dst,\n \t\t\t\t\top->sym->cipher.data.offset, iv,\n-\t\t\t\t\tsrclen, sess->cipher.ctx);\n+\t\t\t\t\tsrclen, ctx_copy);\n \telse\n \t\tstatus = process_openssl_cipher_des3ctr(mbuf_src, dst,\n \t\t\t\top->sym->cipher.data.offset, iv,\n \t\t\t\tsess->cipher.key.data, srclen,\n-\t\t\t\tsess->cipher.ctx);\n+\t\t\t\tctx_copy);\n \n+\tEVP_CIPHER_CTX_free(ctx_copy);\n \tif (status != 0)\n \t\top->status = RTE_CRYPTO_OP_STATUS_ERROR;\n }\n@@ -1507,6 +1515,8 @@ process_openssl_auth_op(struct openssl_qp *qp, struct rte_crypto_op *op,\n {\n \tuint8_t *dst;\n \tint srclen, status;\n+\tEVP_MD_CTX *ctx_a;\n+\tHMAC_CTX *ctx_h;\n \n \tsrclen = op->sym->auth.data.length;\n \n@@ -1514,14 +1524,20 @@ process_openssl_auth_op(struct openssl_qp *qp, struct rte_crypto_op *op,\n \n \tswitch (sess->auth.mode) {\n \tcase OPENSSL_AUTH_AS_AUTH:\n+\t\tctx_a = EVP_MD_CTX_create();\n+\t\tEVP_MD_CTX_copy_ex(ctx_a, sess->auth.auth.ctx);\n \t\tstatus = process_openssl_auth(mbuf_src, dst,\n \t\t\t\top->sym->auth.data.offset, NULL, NULL, srclen,\n-\t\t\t\tsess->auth.auth.ctx, sess->auth.auth.evp_algo);\n+\t\t\t\tctx_a, sess->auth.auth.evp_algo);\n+\t\tEVP_MD_CTX_destroy(ctx_a);\n \t\tbreak;\n \tcase OPENSSL_AUTH_AS_HMAC:\n+\t\tctx_h = HMAC_CTX_new();\n+\t\tHMAC_CTX_copy(ctx_h, sess->auth.hmac.ctx);\n \t\tstatus = process_openssl_auth_hmac(mbuf_src, dst,\n \t\t\t\top->sym->auth.data.offset, srclen,\n-\t\t\t\tsess->auth.hmac.ctx);\n+\t\t\t\tctx_h);\n+\t\tHMAC_CTX_free(ctx_h);\n \t\tbreak;\n \tdefault:\n \t\tstatus = -1;\n", "prefixes": [ "19.11", "10/12" ] }{ "id": 57533, "url": "