Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/57565/?format=api
https://patches.dpdk.org/api/patches/57565/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/98dc35313971d49c5f1f06f7a074b024eb974e90.1565252336.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": "<98dc35313971d49c5f1f06f7a074b024eb974e90.1565252336.git.thierry.herbelot@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/98dc35313971d49c5f1f06f7a074b024eb974e90.1565252336.git.thierry.herbelot@6wind.com", "date": "2019-08-08T08:22:15", "name": "[19.11,V3,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/98dc35313971d49c5f1f06f7a074b024eb974e90.1565252336.git.thierry.herbelot@6wind.com/mbox/", "series": [ { "id": 5981, "url": "https://patches.dpdk.org/api/series/5981/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5981", "date": "2019-08-08T08:22:05", "name": "Miscellaneous fixes", "version": 3, "mbox": "https://patches.dpdk.org/series/5981/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/57565/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/57565/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 1013E5B34;\n\tThu, 8 Aug 2019 10:23:15 +0200 (CEST)", "from mail-wr1-f67.google.com (mail-wr1-f67.google.com\n\t[209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 3F33B2BAF\n\tfor <dev@dpdk.org>; Thu, 8 Aug 2019 10:23:01 +0200 (CEST)", "by mail-wr1-f67.google.com with SMTP id q12so3715924wrj.12\n\tfor <dev@dpdk.org>; Thu, 08 Aug 2019 01:23: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\tt13sm111437018wrr.0.2019.08.08.01.22.59\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 08 Aug 2019 01:22: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=wgarJcXvidJ78ZEw1ta+Nge5CEfZ3EqDvpTZDWMalDE=;\n\tb=RfJZOt44eAJWzahOTXm56LtLjUObC2gAZnENTBo8NGFfoePsKZ9Ynbn4uPthI39pX7\n\trOsOwoeWrqOMj3CZdKYWD1cFeU11MjoszmDBHvXhpKpqGSy1GornlzCZi3+WYSPlVTUN\n\tPEX1xzanyk5kmx5Cj+gAHl4/ZSIrLVqTYUVrReWZ66lJIMI4YUj0ttjDmIErf5Q5SBRA\n\tpnqqCKdXjLimAJLjNLNw6ih60gkIbx42qMi/k46ovw79coy9Fki8DTv4Xb5xvP6Tn3wW\n\tQoZ4oSCBKzADAQO0d3k5RraESACCXPD/MYOw5p8nu+LwPy/lKSm6fX6p4jMzAvBdmE1n\n\tnBlA==", "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=wgarJcXvidJ78ZEw1ta+Nge5CEfZ3EqDvpTZDWMalDE=;\n\tb=QC5cLR0i9fmQwHRs8CNK4NuchjUG/znnGVcLB586ErSBvWLpjflGoLoVNtXfmE6kM2\n\tE/toiVsdjAL6E2hmDWnuPTEh4ASLdMCDJwTiHqEOsr6/B6+MHBlM5ANjaN3wC3wiJ2qP\n\toumbb0qPbaXuwoFcIa/vMmW+lKgzMG6ZNBu0VU0FW9J5U1+4akyuvYdmRrVOtVENnrz5\n\t/wqv5syWFwHjbtiCiiq/YZO3X7k9UV20ST+J4Ui7yqp7DxIaSOO7/6HFbXvKQ+DOj1Ym\n\tmpg34iwg3zw82lmM2Q8kk6OZT8Gk540+e7jydXTOKblZ5xFm4sIUO7zWtURb0+DTlWhR\n\tUbEg==", "X-Gm-Message-State": "APjAAAUkkcc02/KNp/jmfs++f/a4CtsK9jYCphvyFJ4CCJp6ADbjwrlY\n\tpyQnWJHTqpdHfXIa8GNqYfMtp2pWaw==", "X-Google-Smtp-Source": "APXvYqzXMwGMEPGlFDkLDeNkUgyVOQ9gUf6hFyQbq/hoJ0jxbTtaI08+f3VurHaUmjn7L5/1TL4T5Q==", "X-Received": "by 2002:adf:d081:: with SMTP id y1mr16244511wrh.34.1565252580728;\n\tThu, 08 Aug 2019 01:23: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": "Thu, 8 Aug 2019 10:22:15 +0200", "Message-Id": "<98dc35313971d49c5f1f06f7a074b024eb974e90.1565252336.git.thierry.herbelot@6wind.com>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": [ "<cover.1565252336.git.thierry.herbelot@6wind.com>", "<cover.1565252336.git.thierry.herbelot@6wind.com>" ], "References": [ "<cover.1565252336.git.thierry.herbelot@6wind.com>", "<cover.1565190405.git.thierry.herbelot@6wind.com>\n\t<cover.1565252336.git.thierry.herbelot@6wind.com>" ], "Subject": "[dpdk-dev] [PATCH 19.11 V3 10/12] drivers/crypto/openssl: use a\n\tlocal copy 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@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", "V3", "10/12" ] }{ "id": 57565, "url": "