get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 13117,
    "url": "http://patches.dpdk.org/api/patches/13117/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1464685789-8386-3-git-send-email-roy.fan.zhang@intel.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": "<1464685789-8386-3-git-send-email-roy.fan.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1464685789-8386-3-git-send-email-roy.fan.zhang@intel.com",
    "date": "2016-05-31T09:09:46",
    "name": "[dpdk-dev,2/5] app/test: add unified crypto aes test",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a0e85f6f519b6312d68bca5e32e5cf0ea98200ba",
    "submitter": {
        "id": 304,
        "url": "http://patches.dpdk.org/api/people/304/?format=api",
        "name": "Fan Zhang",
        "email": "roy.fan.zhang@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1464685789-8386-3-git-send-email-roy.fan.zhang@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/13117/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/13117/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 01D575AA5;\n\tTue, 31 May 2016 11:09:58 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 75B6B58C3\n\tfor <dev@dpdk.org>; Tue, 31 May 2016 11:09:54 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga101.jf.intel.com with ESMTP; 31 May 2016 02:09:54 -0700",
            "from sie-lab-212-071.ir.intel.com (HELO silvfanzhan2.ir.intel.com)\n\t([10.237.212.71])\n\tby FMSMGA003.fm.intel.com with ESMTP; 31 May 2016 02:09:53 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.26,395,1459839600\"; d=\"scan'208\";a=\"711471826\"",
        "From": "Fan Zhang <roy.fan.zhang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "declan.doherty@intel.com",
        "Date": "Tue, 31 May 2016 10:09:46 +0100",
        "Message-Id": "<1464685789-8386-3-git-send-email-roy.fan.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1464685789-8386-1-git-send-email-roy.fan.zhang@intel.com>",
        "References": "<1464685789-8386-1-git-send-email-roy.fan.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/5] app/test: add unified crypto aes test",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch adds a new crypto AES unified test function.\n\nSigned-off-by: Fan Zhang <roy.fan.zhang@intel.com>\n---\n app/test/Makefile             |   1 +\n app/test/test_cryptodev_aes.c | 662 ++++++++++++++++++++++++++++++++++++++++++\n app/test/test_cryptodev_aes.h |   6 +\n 3 files changed, 669 insertions(+)\n create mode 100755 app/test/test_cryptodev_aes.c",
    "diff": "diff --git a/app/test/Makefile b/app/test/Makefile\nindex f269fe0..fd193df 100644\n--- a/app/test/Makefile\n+++ b/app/test/Makefile\n@@ -153,6 +153,7 @@ endif\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c\n SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring_perf.c\n \n+SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_aes.c\n SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_perf.c\n SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c\n \ndiff --git a/app/test/test_cryptodev_aes.c b/app/test/test_cryptodev_aes.c\nnew file mode 100755\nindex 0000000..a152004\n--- /dev/null\n+++ b/app/test/test_cryptodev_aes.c\n@@ -0,0 +1,662 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2015-2016 Intel Corporation. All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *\t * Redistributions of source code must retain the above copyright\n+ *\t   notice, this list of conditions and the following disclaimer.\n+ *\t * Redistributions in binary form must reproduce the above copyright\n+ *\t   notice, this list of conditions and the following disclaimer in\n+ *\t   the documentation and/or other materials provided with the\n+ *\t   distribution.\n+ *\t * Neither the name of Intel Corporation nor the names of its\n+ *\t   contributors may be used to endorse or promote products derived\n+ *\t   from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <rte_common.h>\n+#include <rte_hexdump.h>\n+#include <rte_mbuf.h>\n+#include <rte_malloc.h>\n+#include <rte_memcpy.h>\n+\n+#include <rte_crypto.h>\n+#include <rte_cryptodev.h>\n+#include <rte_cryptodev_pmd.h>\n+\n+#include \"test.h\"\n+#include \"test_cryptodev_aes.h\"\n+\n+#ifndef MAX_N_AES_TESTS\n+#define MAX_N_AES_TESTS\t\t\t256\n+#endif\n+\n+#ifndef AES_TEST_MSG_LEN\n+#define AES_TEST_MSG_LEN\t\t256\n+#endif\n+\n+#define AES_TEST_OP_ENCRYPT\t\t0x01\n+#define AES_TEST_OP_DECRYPT\t\t0x02\n+#define AES_TEST_OP_AUTH_GEN\t\t0x04\n+#define AES_TEST_OP_AUTH_VERIFY\t\t0x08\n+\n+#define AES_TEST_FEATURE_OOP\t\t0x01\n+#define AES_TEST_FEATURE_SESSIONLESS\t0x02\n+#define AES_TEST_FEATURE_STOPPER\t0x04 /* stop upon failing */\n+\n+#define AES_TEST_TARGET_PMD_MB\t\t0x0001 /* Multi-buffer flag */\n+#define AES_TEST_TARGET_PMD_QAT\t\t0x0002 /* QAT flag */\n+\n+#define AES_TEST_OP_CIPHER\t\t(AES_TEST_OP_ENCRYPT |\t\t\\\n+\t\t\t\t\tAES_TEST_OP_DECRYPT)\n+\n+#define AES_TEST_OP_AUTH\t\t(AES_TEST_OP_AUTH_GEN |\t\t\\\n+\t\t\t\t\tAES_TEST_OP_AUTH_VERIFY)\n+\n+#define AES_TEST_OP_ENC_AUTH_GEN\t(AES_TEST_OP_ENCRYPT |\t\t\\\n+\t\t\t\t\tAES_TEST_OP_AUTH_GEN)\n+\n+#define AES_TEST_OP_AUTH_VERIFY_DEC\t(AES_TEST_OP_DECRYPT |\t\t\\\n+\t\t\t\t\tAES_TEST_OP_AUTH_VERIFY)\n+\n+struct aes_test_case {\n+\tconst char *test_descr; /* test description */\n+\tconst struct aes_test_data *test_data;\n+\tuint8_t op_mask; /* operation mask */\n+\tuint8_t feature_mask;\n+\tuint32_t pmd_mask;\n+};\n+\n+static const struct aes_test_case aes_test_cases[] = {\n+\t{\n+\t\t.test_descr = \"AES-128-CTR HMAC-SHA1 Encryption Digest\",\n+\t\t.test_data = &aes_test_data_1,\n+\t\t.op_mask = AES_TEST_OP_ENC_AUTH_GEN,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CTR HMAC-SHA1 Decryption Digest \"\n+\t\t\t\"Verify\",\n+\t\t.test_data = &aes_test_data_1,\n+\t\t.op_mask = AES_TEST_OP_AUTH_VERIFY_DEC,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-192-CTR XCBC Encryption Digest\",\n+\t\t.test_data = &aes_test_data_2,\n+\t\t.op_mask = AES_TEST_OP_ENC_AUTH_GEN,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-192-CTR XCBC Decryption Digest Verify\",\n+\t\t.test_data = &aes_test_data_2,\n+\t\t.op_mask = AES_TEST_OP_AUTH_VERIFY_DEC,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-256-CTR HMAC-SHA1 Encryption Digest\",\n+\t\t.test_data = &aes_test_data_3,\n+\t\t.op_mask = AES_TEST_OP_ENC_AUTH_GEN,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-256-CTR HMAC-SHA1 Decryption Digest \"\n+\t\t\t\"Verify\",\n+\t\t.test_data = &aes_test_data_3,\n+\t\t.op_mask = AES_TEST_OP_AUTH_VERIFY_DEC,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC HMAC-SHA1 Encryption Digest\",\n+\t\t.test_data = &aes_test_data_4,\n+\t\t.op_mask = AES_TEST_OP_ENC_AUTH_GEN,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC HMAC-SHA1 Decryption Digest \"\n+\t\t\t\"Verify\",\n+\t\t.test_data = &aes_test_data_4,\n+\t\t.op_mask = AES_TEST_OP_AUTH_VERIFY_DEC,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC HMAC-SHA256 Encryption Digest\",\n+\t\t.test_data = &aes_test_data_5,\n+\t\t.op_mask = AES_TEST_OP_ENC_AUTH_GEN,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC HMAC-SHA256 Decryption Digest \"\n+\t\t\t\"Verify\",\n+\t\t.test_data = &aes_test_data_5,\n+\t\t.op_mask = AES_TEST_OP_AUTH_VERIFY_DEC,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC HMAC-SHA512 Encryption Digest\",\n+\t\t.test_data = &aes_test_data_6,\n+\t\t.op_mask = AES_TEST_OP_ENC_AUTH_GEN,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC HMAC-SHA512 Encryption Digest \"\n+\t\t\t\"Sessionless\",\n+\t\t.test_data = &aes_test_data_6,\n+\t\t.op_mask = AES_TEST_OP_ENC_AUTH_GEN,\n+\t\t.feature_mask = AES_TEST_FEATURE_SESSIONLESS,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC HMAC-SHA512 Decryption Digest \"\n+\t\t\t\"Verify\",\n+\t\t.test_data = &aes_test_data_6,\n+\t\t.op_mask = AES_TEST_OP_AUTH_VERIFY_DEC,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC XCBC Encryption Digest\",\n+\t\t.test_data = &aes_test_data_7,\n+\t\t.op_mask = AES_TEST_OP_ENC_AUTH_GEN,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC XCBC Decryption Digest Verify\",\n+\t\t.test_data = &aes_test_data_7,\n+\t\t.op_mask = AES_TEST_OP_AUTH_VERIFY_DEC,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_MB |\n+\t\t\tAES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC HMAC-SHA1 Encryption Digest \"\n+\t\t\t\"OOP\",\n+\t\t.test_data = &aes_test_data_4,\n+\t\t.op_mask = AES_TEST_OP_ENC_AUTH_GEN,\n+\t\t.feature_mask = AES_TEST_FEATURE_OOP,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_QAT\n+\t},\n+\t{\n+\t\t.test_descr = \"AES-128-CBC HMAC-SHA1 Decryption Digest \"\n+\t\t\t\"Verify OOP\",\n+\t\t.test_data = &aes_test_data_4,\n+\t\t.op_mask = AES_TEST_OP_AUTH_VERIFY_DEC,\n+\t\t.feature_mask = AES_TEST_FEATURE_OOP,\n+\t\t.pmd_mask = AES_TEST_TARGET_PMD_QAT\n+\t},\n+};\n+\n+static int\n+test_AES_one_case(const struct aes_test_case *t,\n+\tstruct rte_mempool *mbuf_pool,\n+\tstruct rte_mempool *op_mpool,\n+\tuint8_t dev_id,\n+\tenum rte_cryptodev_type cryptodev_type,\n+\tchar *test_msg)\n+{\n+\tstruct rte_mbuf *ibuf = NULL;\n+\tstruct rte_mbuf *obuf = NULL;\n+\tstruct rte_mbuf *iobuf;\n+\tstruct rte_crypto_sym_xform *cipher_xform = NULL;\n+\tstruct rte_crypto_sym_xform *auth_xform = NULL;\n+\tstruct rte_crypto_sym_xform *init_xform = NULL;\n+\tstruct rte_crypto_sym_op *sym_op;\n+\tstruct rte_crypto_op *op;\n+\n+\tint status = TEST_SUCCESS;\n+\tconst struct aes_test_data *tdata = t->test_data;\n+\tuint8_t cipher_key[tdata->cipher_key.len];\n+\tuint8_t auth_key[tdata->auth_key.len];\n+\tuint32_t buf_len = tdata->ciphertext.len;\n+\tuint32_t digest_len = 0;\n+\tchar *buf_p;\n+\n+\tif (tdata->cipher_key.len)\n+\t\tmemcpy(cipher_key, tdata->cipher_key.data,\n+\t\t\ttdata->cipher_key.len);\n+\tif (tdata->auth_key.len)\n+\t\tmemcpy(auth_key, tdata->auth_key.data,\n+\t\t\ttdata->auth_key.len);\n+\n+\tswitch (cryptodev_type) {\n+\tcase RTE_CRYPTODEV_QAT_SYM_PMD:\n+\t\tdigest_len = tdata->digest.len;\n+\t\tbreak;\n+\tcase RTE_CRYPTODEV_AESNI_MB_PMD:\n+\t\tdigest_len = tdata->digest.truncated_len;\n+\t\tbreak;\n+\tdefault:\n+\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u FAILED: %s\",\n+\t\t\t__LINE__, \"Unsupported PMD type\");\n+\t\tstatus = TEST_FAILED;\n+\t\tgoto error_exit;\n+\t}\n+\n+\t/* preparing data */\n+\tibuf = rte_pktmbuf_alloc(mbuf_pool);\n+\tif (!ibuf) {\n+\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u FAILED: %s\",\n+\t\t\t__LINE__, \"Allocation of rte_mbuf failed\");\n+\t\tstatus = TEST_FAILED;\n+\t\tgoto error_exit;\n+\t}\n+\n+\tif (t->op_mask & AES_TEST_OP_CIPHER)\n+\t\tbuf_len += tdata->iv.len;\n+\tif (t->op_mask & AES_TEST_OP_AUTH)\n+\t\tbuf_len += digest_len;\n+\n+\tbuf_p = rte_pktmbuf_append(ibuf, buf_len);\n+\tif (!buf_p) {\n+\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u FAILED: %s\",\n+\t\t\t__LINE__, \"No room to append mbuf\");\n+\t\tstatus = TEST_FAILED;\n+\t\tgoto error_exit;\n+\t}\n+\n+\tif (t->op_mask & AES_TEST_OP_CIPHER) {\n+\t\trte_memcpy(buf_p, tdata->iv.data, tdata->iv.len);\n+\t\tbuf_p += tdata->iv.len;\n+\t}\n+\n+\t/* only encryption requires plaintext.data input,\n+\t * decryption/(digest gen)/(digest verify) use ciphertext.data\n+\t * to be computed */\n+\tif (t->op_mask & AES_TEST_OP_ENCRYPT) {\n+\t\trte_memcpy(buf_p, tdata->plaintext.data,\n+\t\t\ttdata->plaintext.len);\n+\t\tbuf_p += tdata->plaintext.len;\n+\t} else {\n+\t\trte_memcpy(buf_p, tdata->ciphertext.data,\n+\t\t\ttdata->ciphertext.len);\n+\t\tbuf_p += tdata->ciphertext.len;\n+\t}\n+\n+\tif (t->op_mask & AES_TEST_OP_AUTH_VERIFY)\n+\t\trte_memcpy(buf_p, tdata->digest.data, digest_len);\n+\telse\n+\t\tmemset(buf_p, 0, digest_len);\n+\n+\tif (t->feature_mask & AES_TEST_FEATURE_OOP) {\n+\t\tobuf = rte_pktmbuf_alloc(mbuf_pool);\n+\t\tif (!obuf) {\n+\t\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u \"\n+\t\t\t\t\"FAILED: %s\", __LINE__,\n+\t\t\t\t\"Allocation of rte_mbuf failed\");\n+\t\t\tstatus = TEST_FAILED;\n+\t\t\tgoto error_exit;\n+\t\t}\n+\n+\t\tbuf_p = rte_pktmbuf_append(obuf, buf_len);\n+\t\tif (!buf_p) {\n+\t\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u \"\n+\t\t\t\t\"FAILED: %s\", __LINE__,\n+\t\t\t\t\"No room to append mbuf\");\n+\t\t\tstatus = TEST_FAILED;\n+\t\t\tgoto error_exit;\n+\t\t}\n+\t\tmemset(buf_p, 0, buf_len);\n+\t}\n+\n+\t/* Generate Crypto op data structure */\n+\top = rte_crypto_op_alloc(op_mpool, RTE_CRYPTO_OP_TYPE_SYMMETRIC);\n+\tif (!op) {\n+\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u FAILED: %s\",\n+\t\t\t__LINE__, \"Failed to allocate symmetric crypto \"\n+\t\t\t\"operation struct\");\n+\t\tstatus = TEST_FAILED;\n+\t\tgoto error_exit;\n+\t}\n+\n+\tsym_op = op->sym;\n+\n+\tsym_op->m_src = ibuf;\n+\n+\tif (t->feature_mask & AES_TEST_FEATURE_OOP) {\n+\t\tsym_op->m_dst = obuf;\n+\t\tiobuf = obuf;\n+\t} else {\n+\t\tsym_op->m_dst = NULL;\n+\t\tiobuf = ibuf;\n+\t}\n+\n+\t/* sessionless op requires allocate xform using\n+\t * rte_crypto_op_sym_xforms_alloc(), otherwise rte_zmalloc()\n+\t * is used */\n+\tif (t->feature_mask & AES_TEST_FEATURE_SESSIONLESS) {\n+\t\tuint32_t n_xforms = 0;\n+\n+\t\tif (t->op_mask & AES_TEST_OP_CIPHER)\n+\t\t\tn_xforms++;\n+\t\tif (t->op_mask & AES_TEST_OP_AUTH)\n+\t\t\tn_xforms++;\n+\n+\t\tif (rte_crypto_op_sym_xforms_alloc(op, n_xforms)\n+\t\t\t== NULL) {\n+\t\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u \"\n+\t\t\t\t\"FAILED: %s\", __LINE__, \"Failed to \"\n+\t\t\t\t\"allocate space for crypto transforms\");\n+\t\t\tstatus = TEST_FAILED;\n+\t\t\tgoto error_exit;\n+\t\t}\n+\t} else {\n+\t\tcipher_xform = rte_zmalloc(NULL,\n+\t\t\tsizeof(struct rte_crypto_sym_xform), 0);\n+\n+\t\tauth_xform = rte_zmalloc(NULL,\n+\t\t\tsizeof(struct rte_crypto_sym_xform), 0);\n+\n+\t\tif (!cipher_xform || !auth_xform) {\n+\t\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u \"\n+\t\t\t\t\"FAILED: %s\", __LINE__, \"Failed to \"\n+\t\t\t\t\"allocate memory for crypto transforms\");\n+\t\t\tstatus = TEST_FAILED;\n+\t\t\tgoto error_exit;\n+\t\t}\n+\t}\n+\n+\t/* preparing xform, for sessioned op, init_xform is initialized\n+\t * here and later as param in rte_cryptodev_sym_session_create()\n+\t * call */\n+\tif (t->op_mask == AES_TEST_OP_ENC_AUTH_GEN) {\n+\t\tif (t->feature_mask & AES_TEST_FEATURE_SESSIONLESS) {\n+\t\t\tcipher_xform = op->sym->xform;\n+\t\t\tauth_xform = cipher_xform->next;\n+\t\t\tauth_xform->next = NULL;\n+\t\t} else {\n+\t\t\tcipher_xform->next = auth_xform;\n+\t\t\tauth_xform->next = NULL;\n+\t\t\tinit_xform = cipher_xform;\n+\t\t}\n+\t} else if (t->op_mask == AES_TEST_OP_AUTH_VERIFY_DEC) {\n+\t\tif (t->feature_mask & AES_TEST_FEATURE_SESSIONLESS) {\n+\t\t\tauth_xform = op->sym->xform;\n+\t\t\tcipher_xform = auth_xform->next;\n+\t\t\tcipher_xform->next = NULL;\n+\t\t} else {\n+\t\t\tauth_xform->next = cipher_xform;\n+\t\t\tcipher_xform->next = NULL;\n+\t\t\tinit_xform = auth_xform;\n+\t\t}\n+\t} else if ((t->op_mask == AES_TEST_OP_ENCRYPT) ||\n+\t\t\t(t->op_mask == AES_TEST_OP_DECRYPT)) {\n+\t\tif (t->feature_mask & AES_TEST_FEATURE_SESSIONLESS)\n+\t\t\tcipher_xform = op->sym->xform;\n+\t\telse\n+\t\t\tinit_xform = cipher_xform;\n+\t\tcipher_xform->next = NULL;\n+\t} else if ((t->op_mask == AES_TEST_OP_AUTH_GEN) ||\n+\t\t\t(t->op_mask == AES_TEST_OP_AUTH_VERIFY)) {\n+\t\tif (t->feature_mask & AES_TEST_FEATURE_SESSIONLESS)\n+\t\t\tauth_xform = op->sym->xform;\n+\t\telse\n+\t\t\tinit_xform = auth_xform;\n+\t\tauth_xform->next = NULL;\n+\t} else {\n+\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u FAILED: %s\",\n+\t\t\t__LINE__, \"Unrecognized operation\");\n+\t\tstatus = TEST_FAILED;\n+\t\tgoto error_exit;\n+\t}\n+\n+\t/*configure xforms & sym_op cipher and auth data*/\n+\tif (t->op_mask & AES_TEST_OP_CIPHER) {\n+\t\tcipher_xform->type = RTE_CRYPTO_SYM_XFORM_CIPHER;\n+\t\tcipher_xform->cipher.algo = tdata->crypto_algo;\n+\t\tif (t->op_mask & AES_TEST_OP_ENCRYPT)\n+\t\t\tcipher_xform->cipher.op =\n+\t\t\t\tRTE_CRYPTO_CIPHER_OP_ENCRYPT;\n+\t\telse\n+\t\t\tcipher_xform->cipher.op =\n+\t\t\t\tRTE_CRYPTO_CIPHER_OP_DECRYPT;\n+\t\tcipher_xform->cipher.key.data = cipher_key;\n+\t\tcipher_xform->cipher.key.length = tdata->cipher_key.len;\n+\n+\t\tsym_op->cipher.data.offset = tdata->iv.len;\n+\t\tsym_op->cipher.data.length = tdata->ciphertext.len;\n+\t\tsym_op->cipher.iv.data = rte_pktmbuf_mtod(sym_op->m_src,\n+\t\t\tuint8_t *);\n+\t\tsym_op->cipher.iv.length = tdata->iv.len;\n+\t\tsym_op->cipher.iv.phys_addr = rte_pktmbuf_mtophys(\n+\t\t\tsym_op->m_src);\n+\t}\n+\n+\tif (t->op_mask & AES_TEST_OP_AUTH) {\n+\t\tuint32_t auth_data_offset = 0;\n+\t\tuint32_t digest_offset = tdata->ciphertext.len;\n+\n+\t\tif (t->op_mask & AES_TEST_OP_CIPHER) {\n+\t\t\tdigest_offset += tdata->iv.len;\n+\t\t\tauth_data_offset += tdata->iv.len;\n+\t\t}\n+\n+\t\tauth_xform->type = RTE_CRYPTO_SYM_XFORM_AUTH;\n+\t\tauth_xform->auth.algo = tdata->auth_algo;\n+\t\tauth_xform->auth.key.length = tdata->auth_key.len;\n+\t\tauth_xform->auth.key.data = auth_key;\n+\t\tauth_xform->auth.digest_length = digest_len;\n+\n+\t\tif (t->op_mask & AES_TEST_OP_AUTH_GEN) {\n+\t\t\tauth_xform->auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;\n+\t\t\tsym_op->auth.digest.data = rte_pktmbuf_mtod_offset\n+\t\t\t\t(iobuf, uint8_t *, digest_offset);\n+\t\t\tsym_op->auth.digest.phys_addr =\n+\t\t\t\trte_pktmbuf_mtophys_offset(iobuf,\n+\t\t\t\t\tdigest_offset);\n+\t\t} else {\n+\t\t\tauth_xform->auth.op = RTE_CRYPTO_AUTH_OP_VERIFY;\n+\t\t\tsym_op->auth.digest.data = rte_pktmbuf_mtod_offset\n+\t\t\t\t(sym_op->m_src, uint8_t *, digest_offset);\n+\t\t\tsym_op->auth.digest.phys_addr =\n+\t\t\t\trte_pktmbuf_mtophys_offset(sym_op->m_src,\n+\t\t\t\t\tdigest_offset);\n+\t\t}\n+\n+\t\tsym_op->auth.data.offset = auth_data_offset;\n+\t\tsym_op->auth.data.length = tdata->ciphertext.len;\n+\t\tsym_op->auth.digest.length = digest_len;\n+\t}\n+\n+\t/* create session for sessioned op */\n+\tif (!(t->feature_mask & AES_TEST_FEATURE_SESSIONLESS)) {\n+\t\tstruct rte_cryptodev_sym_session *sess;\n+\n+\t\tsess = rte_cryptodev_sym_session_create(dev_id,\n+\t\t\tinit_xform);\n+\t\tif (!sess) {\n+\t\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u \"\n+\t\t\t\t\"FAILED: %s\", __LINE__,\n+\t\t\t\t\"Session creation failed\");\n+\t\t\tstatus = TEST_FAILED;\n+\t\t\tgoto error_exit;\n+\t\t}\n+\n+\t\t/* attach symmetric crypto session to crypto operations */\n+\t\trte_crypto_op_attach_sym_session(op, sess);\n+\t}\n+\n+\t/* Process crypto operation */\n+\tif (rte_cryptodev_enqueue_burst(dev_id, 0, &op, 1) != 1) {\n+\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u FAILED: %s\",\n+\t\t\t__LINE__, \"Error sending packet for encryption\");\n+\t\tstatus = TEST_FAILED;\n+\t\tgoto error_exit;\n+\t}\n+\n+\top = NULL;\n+\n+\twhile (rte_cryptodev_dequeue_burst(dev_id, 0, &op, 1) == 0)\n+\t\trte_pause();\n+\n+\tif (!op) {\n+\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u FAILED: %s\",\n+\t\t\t__LINE__, \"Failed to process sym crypto op\");\n+\t\tstatus = TEST_FAILED;\n+\t\tgoto error_exit;\n+\t}\n+\n+#ifdef RTE_APP_TEST_DEBUG\n+\trte_hexdump(stdout, \"m_src:\",\n+\t\trte_pktmbuf_mtod(sym_op->m_src, uint8_t *), buf_len);\n+\tif (t->feature_mask & AES_TEST_FEATURE_OOP)\n+\t\trte_hexdump(stdout, \"m_dst:\",\n+\t\t\trte_pktmbuf_mtod(sym_op->m_dst, uint8_t *),\n+\t\t\tbuf_len);\n+#endif\n+\n+\t/* Verify results */\n+\tif (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\tif (t->op_mask & AES_TEST_OP_AUTH_VERIFY)\n+\t\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u \"\n+\t\t\t\t\"FAILED: Digest verification failed \"\n+\t\t\t\t\"(0x%X)\", __LINE__, op->status);\n+\t\telse\n+\t\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u \"\n+\t\t\t\t\"FAILED: Digest verification failed \"\n+\t\t\t\t\"(0x%X)\", __LINE__, op->status);\n+\t\tstatus = TEST_FAILED;\n+\t\tgoto error_exit;\n+\t}\n+\n+\tif (t->op_mask & AES_TEST_OP_CIPHER) {\n+\t\tuint8_t *crypto_res;\n+\t\tconst uint8_t *compare_ref;\n+\t\tuint32_t compare_len;\n+\n+\t\tcrypto_res = rte_pktmbuf_mtod_offset(iobuf, uint8_t *,\n+\t\t\ttdata->iv.len);\n+\n+\t\tif (t->op_mask & AES_TEST_OP_ENCRYPT) {\n+\t\t\tcompare_ref = tdata->ciphertext.data;\n+\t\t\tcompare_len = tdata->ciphertext.len;\n+\t\t} else {\n+\t\t\tcompare_ref = tdata->plaintext.data;\n+\t\t\tcompare_len = tdata->plaintext.len;\n+\t\t}\n+\n+\t\tif (memcmp(crypto_res, compare_ref, compare_len)) {\n+\t\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u \"\n+\t\t\t\t\"FAILED: %s\", __LINE__,\n+\t\t\t\t\"Crypto data not as expected\");\n+\t\t\tstatus = TEST_FAILED;\n+\t\t\tgoto error_exit;\n+\t\t}\n+\t}\n+\n+\tif (t->op_mask & AES_TEST_OP_AUTH_GEN) {\n+\t\tuint8_t *auth_res;\n+\n+\t\tif (t->op_mask & AES_TEST_OP_CIPHER)\n+\t\t\tauth_res = rte_pktmbuf_mtod_offset(iobuf,\n+\t\t\t\tuint8_t *,\n+\t\t\t\ttdata->iv.len + tdata->ciphertext.len);\n+\t\telse\n+\t\t\tauth_res = rte_pktmbuf_mtod_offset(iobuf,\n+\t\t\t\tuint8_t *, tdata->ciphertext.len);\n+\n+\t\tif (memcmp(auth_res, tdata->digest.data, digest_len)) {\n+\t\t\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"line %u \"\n+\t\t\t\t\"FAILED: %s\", __LINE__, \"Generated \"\n+\t\t\t\t\"digest data not as expected\");\n+\t\t\tstatus = TEST_FAILED;\n+\t\t\tgoto error_exit;\n+\t\t}\n+\t}\n+\n+\tsnprintf(test_msg, AES_TEST_MSG_LEN, \"PASS\");\n+\n+error_exit:\n+\tif (!(t->feature_mask & AES_TEST_FEATURE_SESSIONLESS)) {\n+\t\tif (cipher_xform)\n+\t\t\trte_free(cipher_xform);\n+\t\tif (auth_xform)\n+\t\t\trte_free(auth_xform);\n+\t}\n+\n+\tif (op)\n+\t\trte_crypto_op_free(op);\n+\n+\tif (obuf)\n+\t\trte_pktmbuf_free(obuf);\n+\n+\tif (ibuf)\n+\t\trte_pktmbuf_free(ibuf);\n+\n+\treturn status;\n+}\n+\n+int\n+test_AES_all_tests(struct rte_mempool *mbuf_pool,\n+\tstruct rte_mempool *op_mpool,\n+\tuint8_t dev_id,\n+\tenum rte_cryptodev_type cryptodev_type)\n+{\n+\tint status, overall_status = TEST_SUCCESS;\n+\tuint32_t i, test_index = 0;\n+\tchar test_msg[AES_TEST_MSG_LEN + 1];\n+\tuint32_t n_test_cases = sizeof(aes_test_cases) /\n+\t\t\tsizeof(aes_test_cases[0]);\n+\tuint32_t target_pmd_mask = 0;\n+\n+\tswitch (cryptodev_type) {\n+\tcase RTE_CRYPTODEV_AESNI_MB_PMD:\n+\t\ttarget_pmd_mask = AES_TEST_TARGET_PMD_MB;\n+\t\tbreak;\n+\tcase RTE_CRYPTODEV_QAT_SYM_PMD:\n+\t\ttarget_pmd_mask = AES_TEST_TARGET_PMD_QAT;\n+\t\tbreak;\n+\tdefault:\n+\t\tTEST_ASSERT(-1, \"Unrecognized cryptodev type\");\n+\t\tbreak;\n+\t}\n+\n+\tfor (i = 0; i < n_test_cases; i++) {\n+\t\tconst struct aes_test_case *tc = &aes_test_cases[i];\n+\n+\t\tif (!(tc->pmd_mask & target_pmd_mask))\n+\t\t\tcontinue;\n+\n+\t\tstatus = test_AES_one_case(tc, mbuf_pool, op_mpool,\n+\t\t\tdev_id, cryptodev_type, test_msg);\n+\n+\t\tprintf(\"  %u) TestCase %s %s\\n\", test_index ++,\n+\t\t\ttc->test_descr, test_msg);\n+\n+\t\tif (status != TEST_SUCCESS) {\n+\t\t\tif (overall_status == TEST_SUCCESS)\n+\t\t\t\toverall_status = status;\n+\n+\t\t\tif (tc->feature_mask & AES_TEST_FEATURE_STOPPER)\n+\t\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn overall_status;\n+}\ndiff --git a/app/test/test_cryptodev_aes.h b/app/test/test_cryptodev_aes.h\nindex 8fc6dd0..c3b439b 100755\n--- a/app/test/test_cryptodev_aes.h\n+++ b/app/test/test_cryptodev_aes.h\n@@ -70,6 +70,12 @@ struct aes_test_data {\n \t} digest;\n };\n \n+int\n+test_AES_all_tests(struct rte_mempool *mbuf_pool,\n+\tstruct rte_mempool *op_mpool,\n+\tuint8_t dev_id,\n+\tenum rte_cryptodev_type cryptodev_type);\n+\n /* test vectors */\n /* AES128-CTR-SHA1 test vector */\n static const struct aes_test_data aes_test_data_1 = {\n",
    "prefixes": [
        "dpdk-dev",
        "2/5"
    ]
}