get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74120,
    "url": "http://patches.dpdk.org/api/patches/74120/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200715155043.12476-5-arkadiuszx.kusztal@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": "<20200715155043.12476-5-arkadiuszx.kusztal@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200715155043.12476-5-arkadiuszx.kusztal@intel.com",
    "date": "2020-07-15T15:50:42",
    "name": "[v3,4/5] app/mp_crypto: add enqueue-dequeue functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "538f05d66cfaa5ef5369e834db12007ada6273bd",
    "submitter": {
        "id": 452,
        "url": "http://patches.dpdk.org/api/people/452/?format=api",
        "name": "Arkadiusz Kusztal",
        "email": "arkadiuszx.kusztal@intel.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/20200715155043.12476-5-arkadiuszx.kusztal@intel.com/mbox/",
    "series": [
        {
            "id": 11057,
            "url": "http://patches.dpdk.org/api/series/11057/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11057",
            "date": "2020-07-15T15:50:38",
            "name": "app: add multi process crypto application",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/11057/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74120/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/74120/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 223D9A0547;\n\tWed, 15 Jul 2020 17:51:30 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 07BEA1BEA8;\n\tWed, 15 Jul 2020 17:51:00 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id 52DCE1BE95\n for <dev@dpdk.org>; Wed, 15 Jul 2020 17:50:58 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 Jul 2020 08:50:57 -0700",
            "from akusztax-mobl.ger.corp.intel.com ([10.104.121.32])\n by fmsmga002.fm.intel.com with ESMTP; 15 Jul 2020 08:50:55 -0700"
        ],
        "IronPort-SDR": [
            "\n 1j9gUlufFT4pHPZMDK2ZYFY6aPnsxfZHlsrBp7LH1bBYkzQbffdCd9mk6konnxi2y1NtNlzp94\n 3MDJZxlPZlpQ==",
            "\n xHYpfOBK9Qivgac0/igyDY6zDp6X1hDfCKH9oGfD4Wm6JWDy3p67Sjw6zzaxP119v09L3MenwM\n bnukPGMTzJHg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9683\"; a=\"167303567\"",
            "E=Sophos;i=\"5.75,355,1589266800\"; d=\"scan'208\";a=\"167303567\"",
            "E=Sophos;i=\"5.75,355,1589266800\"; d=\"scan'208\";a=\"318102552\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Arek Kusztal <arkadiuszx.kusztal@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "akhil.goyal@nxp.com, fiona.trahe@intel.com,\n Arek Kusztal <arkadiuszx.kusztal@intel.com>",
        "Date": "Wed, 15 Jul 2020 17:50:42 +0200",
        "Message-Id": "<20200715155043.12476-5-arkadiuszx.kusztal@intel.com>",
        "X-Mailer": "git-send-email 2.19.1.windows.1",
        "In-Reply-To": "<20200715155043.12476-1-arkadiuszx.kusztal@intel.com>",
        "References": "<20200715155043.12476-1-arkadiuszx.kusztal@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 4/5] app/mp_crypto: add enqueue-dequeue\n\tfunctions",
        "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 <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": "Add enqueue/dequeue functions and related dependency functions\nto multi process crypto app. Command line options to use are\ndescribed in mp_crypto.rst file.\n\nSigned-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>\n---\n app/test-mp-crypto/Makefile            |   2 +-\n app/test-mp-crypto/main.c              | 544 +++++++++++++++++++++++++++++++++\n app/test-mp-crypto/meson.build         |   3 +-\n app/test-mp-crypto/mp_crypto.c         |  91 ++++++\n app/test-mp-crypto/mp_crypto.h         |  27 ++\n app/test-mp-crypto/mp_crypto_vectors.c | 174 +++++++++++\n app/test-mp-crypto/mp_crypto_vectors.h |  66 ++++\n 7 files changed, 905 insertions(+), 2 deletions(-)\n create mode 100644 app/test-mp-crypto/mp_crypto_vectors.c\n create mode 100644 app/test-mp-crypto/mp_crypto_vectors.h",
    "diff": "diff --git a/app/test-mp-crypto/Makefile b/app/test-mp-crypto/Makefile\nindex 9fc1f3c..5d59503 100644\n--- a/app/test-mp-crypto/Makefile\n+++ b/app/test-mp-crypto/Makefile\n@@ -10,6 +10,6 @@ CFLAGS += $(WERROR_FLAGS)\n CFLAGS += -O3\n \n # all source are stored in SRCS-y\n-SRCS-y := main.c mp_crypto.c mp_crypto_parser.c mp_crypto_ipc.c\n+SRCS-y := main.c mp_crypto.c mp_crypto_parser.c mp_crypto_ipc.c mp_crypto_vectors.c\n \n include $(RTE_SDK)/mk/rte.app.mk\ndiff --git a/app/test-mp-crypto/main.c b/app/test-mp-crypto/main.c\nindex 46c8055..25833d6 100644\n--- a/app/test-mp-crypto/main.c\n+++ b/app/test-mp-crypto/main.c\n@@ -562,6 +562,533 @@ int mp_crypto_setup_mpool(void)\n \treturn 0;\n }\n \n+static int check_capabilities(int dev_id,\n+\t\t\tconst struct mp_crypto_session_vector *vector)\n+{\n+\tstruct rte_cryptodev_sym_capability_idx cap_idx;\n+\n+\tcap_idx.type = vector->x_type;\n+\tif (vector->x_type == RTE_CRYPTO_SYM_XFORM_AEAD)\n+\t\tcap_idx.algo.aead = vector->aead_algo;\n+\n+\t/* For now rescricted only to AEAD */\n+\n+\tif (rte_cryptodev_sym_capability_get(dev_id, &cap_idx) == NULL)\n+\t\treturn -ENOTSUP;\n+\n+\treturn 0;\n+}\n+\n+int\n+mp_crypto_init_sessions(void)\n+{\n+\tuint64_t session_mask_id;\n+\tuint64_t session_id;\n+\tint i;\n+\tint capabiliy_checked = 1;\n+\t/* Check if all devices support vector 0 */\n+\tfor (i = 0; i < MP_APP_MAX_VECTORS; i++) {\n+\t\tint dev_id = mp_app_devs[i].id;\n+\t\t/* TODO use proper vector(s), not hardcoded one */\n+\t\tif (dev_id < 0)\n+\t\t\tcontinue;\n+\n+\t\tint k = 0;\n+\n+\t\twhile (mp_app_params->enq_param.vector_number[k] >= 0 &&\n+\t\t\t\tk < MP_APP_MAX_VECTORS) {\n+\t\t\tint vector_number =\n+\t\t\t\tmp_app_params->enq_param.vector_number[k];\n+\n+\t\t\tif (vector_number >= (int)mp_app_numof_ops) {\n+\t\t\t\tMP_APP_LOG(ERR, COL_RED,\n+\t\t\t\t\t\"Not recognized test vector %d\",\n+\t\t\t\t\tvector_number);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tif (check_capabilities(dev_id,\n+\t\t\t\t\t&session_vectors[vectors[\n+\t\t\t\t\tvector_number].session])) {\n+\t\t\t\tMP_APP_LOG(ERR, COL_RED,\n+\t\t\t\t\t\"Algorithm unsupported on dev %d\",\n+\t\t\t\t\tdev_id);\n+\t\t\t\tcapabiliy_checked = 0;\n+\t\t\t}\n+\t\t\tk++;\n+\t\t}\n+\t}\n+\tif (capabiliy_checked == 0)\n+\t\treturn -1;\n+\n+\tfor (session_mask_id = 1, session_id = 0;\n+\t\t\tsession_id <= mp_app_numof_sessions;\n+\t\t\tsession_mask_id <<= 1, session_id++) {\n+\n+\t\tif (session_mask_id & mp_app_params->session_mask) {\n+\t\t\tstruct rte_cryptodev_sym_session *sess =\n+\t\t\t\tmp_app_create_session(mp_app_device_id,\n+\t\t\t\t&session_vectors[session_id]);\n+\t\t\tif (sess == NULL) {\n+\t\t\t\tMP_APP_LOG(ERR, COL_RED,\n+\t\t\t\t\t\"Error when creating session = %p\",\n+\t\t\t\t\tsess);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\trte_spinlock_lock(&mp_shared_data->sessions.lock);\n+\t\t\tint clear_session = 1;\n+\n+\t\t\tif (mp_shared_data->sessions.sym_sessions[\n+\t\t\t\t\tsession_id].session\n+\t\t\t\t\t\t== NULL) {\n+\t\t\t\tmp_shared_data->sessions.sym_sessions[\n+\t\t\t\t\tsession_id].session\n+\t\t\t\t\t= sess;\n+\t\t\t\tclear_session = 0;\n+\t\t\t\tMP_APP_LOG(INFO, COL_BLUE,\n+\t\t\t\t\t\"Initialized session = %\"PRIu64,\n+\t\t\t\t\tsession_id);\n+\t\t\t} else {\n+\t\t\t\t/* Actually refcnt should be incremented\n+\t\t\t\t * on demand mp_shared_data->sessions.\n+\t\t\t\t * sym_sessions [session_id].refcnt++;\n+\t\t\t\t */\n+\t\t\t}\n+\t\t\trte_spinlock_unlock(&mp_shared_data->sessions.lock);\n+\t\t\tif (clear_session)\n+\t\t\t\trte_cryptodev_sym_session_free(sess);\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+static void\n+setup_ops_main_loop(int session_id, int vector_number)\n+{\n+\twhile (1) {\n+\t\trte_spinlock_lock(&mp_shared_data->sessions.lock);\n+\t\tif (mp_shared_data->sessions.sym_sessions[\n+\t\t\t\tsession_id].session\n+\t\t\t\t\t!= NULL) {\n+\t\t\tmp_shared_data->sessions.sym_sessions[\n+\t\t\t\tsession_id].refcnt++;\n+\t\t\trte_spinlock_unlock(&mp_shared_data->sessions.lock);\n+\t\t\treturn;\n+\t\t}\n+\t\trte_spinlock_unlock(&mp_shared_data->sessions.lock);\n+\n+\t\tMP_APP_LOG(WARNING, COL_YEL,\n+\t\t\t\"Session %d was not yet created, vector %d\",\n+\t\t\tsession_id, vector_number);\n+\t\tchar c;\n+\n+\t\tMP_APP_LOG(INFO, COL_NORM,\n+\t\t\t\"Session %d not yet created.\\n - Press 'w' to wait until other process will create it\\n - Press 'n' to create local session\",\n+\t\t\tvectors[session_id].session);\n+\t\tint __rte_unused r = scanf(\"%c\", &c);\n+\n+\t\tif (c == 'n') {\n+\t\t\tstruct rte_cryptodev_sym_session *sess =\n+\t\t\t\tmp_app_create_session(\n+\t\t\t\t\tmp_app_device_id,\n+\t\t\t\t&session_vectors[session_id]);\n+\t\t\tmp_crypto_local_sessions[session_id] =\n+\t\t\t\tsess;\n+\t\t\treturn;\n+\t\t} else if (c == 'w') {\n+\t\t\tint timeout = 3;\n+\t\t\tint counter = 1;\n+\n+\t\t\twhile (counter <= timeout) {\n+\t\t\t\trte_delay_ms(1000);\n+\t\t\t\tMP_APP_LOG(INFO, COL_NORM,\n+\t\t\t\t\"Waiting for %d out of %d seconds\",\n+\t\t\t\tcounter++, timeout);\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n+int mp_crypto_setup_ops(void)\n+{\n+\tint i;\n+\tint used_vectors = 0;\n+\tint selected_vectors[MP_APP_MAX_VECTORS];\n+\n+\tfor (i = 0; i < MP_APP_MAX_VECTORS; i++)\n+\t\tselected_vectors[i] = -1;\n+\n+\ti = 0;\n+\twhile (mp_app_params->enq_param.vector_number[i] >= 0 &&\n+\t\t\ti < MP_APP_MAX_VECTORS)\t{\n+\t\tint vector_number = mp_app_params->enq_param.vector_number[i];\n+\n+\t\tif (mp_app_params->enq_param.vector_number[i] >=\n+\t\t\t(int)mp_app_numof_ops) {\n+\t\t\tMP_APP_LOG(ERR, COL_RED,\n+\t\t\t\"Crypto vector %d not defined, skipping\",\n+\t\t\tmp_app_params->enq_param.vector_number[i]);\n+\t\t\ti++;\n+\t\t\tcontinue;\n+\t\t}\n+\t\t/* Aquire session */\n+\t\tint session_id = vectors[vector_number].session;\n+\n+\t\tsetup_ops_main_loop(vectors[vector_number].session,\n+\t\t\t\tvector_number);\n+\t\tMP_APP_LOG(INFO, COL_BLUE,\n+\t\t\t\t\"Configuring vector %d, using session %d\",\n+\t\t\t\tvector_number, session_id);\n+\n+\t\tselected_vectors[used_vectors++] = vector_number;\n+\t\ti++;\n+\t}\n+\n+\tif (used_vectors == 0)\n+\t\treturn 0;\n+\n+\tint curr_vector = 0;\n+\t/* Create vectors and attach to sessions */\n+\n+\tfor (i = 0; i < MP_CRYPTO_QP_DESC_NUM; i++)\t{\n+\t\tint session_id =\n+\t\t\tvectors[selected_vectors[curr_vector]].session;\n+\t\tif (mp_crypto_local_sessions[session_id] != NULL) {\n+\t\t\tmp_crypto_create_op(mp_crypto_ops[i],\n+\t\t\t\t\tmp_crypto_mbufs[i],\n+\t\t\t\t\tselected_vectors[curr_vector],\n+\t\t\t\t\tmp_crypto_local_sessions[session_id]);\n+\t\t} else {\n+\t\t\tmp_crypto_create_op(mp_crypto_ops[i],\n+\t\t\t\t\tmp_crypto_mbufs[i],\n+\t\t\t\t\tselected_vectors[curr_vector],\n+\t\t\t\t\tmp_shared_data->sessions.sym_sessions\n+\t\t\t\t\t[session_id].session);\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+static int check_for_queue(int dev_id, int qp_id)\n+{\n+\tint ret = rte_cryptodev_get_qp_status(dev_id, qp_id);\n+\n+\tif (ret <= 0) {\n+\t\tMP_APP_LOG(WARNING, COL_YEL,\n+\t\t\t\"Queue %d on dev %d not initialized\",\n+\t\t\tqp_id, dev_id);\n+\t\tprintf(\n+\t\t\"\\n - Press 'w' to wait until other process will initialize it\");\n+\t\tprintf(\"\\n - Press 'x' to exit\");\n+\t\tchar c;\n+\t\tint __rte_unused r = scanf(\"%s\", &c);\n+\n+\t\tif (c == 'w') {\n+\t\t\tint timeout = 3;\n+\t\t\tint counter = 1;\n+\n+\t\t\twhile (counter <= timeout) {\n+\t\t\t\trte_delay_ms(1000);\n+\t\t\t\tMP_APP_LOG(INFO, COL_NORM,\n+\t\t\t\t\"Waiting for %d out of %d seconds\",\n+\t\t\t\t\tcounter++, 3);\n+\t\t\t}\n+\t\t\treturn -1;\n+\t\t} else if (c == 'x')\n+\t\t\treturn -2;\n+\t\telse\n+\t\t\treturn -2;\n+\t}\n+\treturn 0;\n+}\n+\n+static void enqueue(int enq_dev_id, int enq_qp_id, uint64_t *enqueued,\n+\t\t\tuint64_t pcks_to_enq, uint64_t *curr_offset_enq,\n+\t\t\tint *enq_livesign, int process_enq, int process_deq,\n+\t\t\tint *livesign_print_idx, int *livesign_deq_print_idx)\n+{\n+\tif (*enqueued < pcks_to_enq || pcks_to_enq == 0) {\n+\t\t/* Consider clearing param above */\n+\t\tuint64_t enq;\n+\t\tuint64_t to_enq = (MP_CRYPTO_QP_DESC_NUM -\n+\t\t\t*curr_offset_enq) > MP_CRYPTO_BURST_NUM ?\n+\t\t\tMP_CRYPTO_BURST_NUM : MP_CRYPTO_QP_DESC_NUM\n+\t\t\t- *curr_offset_enq;\n+\n+\t\tif (pcks_to_enq && to_enq > pcks_to_enq - *enqueued)\n+\t\t\tto_enq = pcks_to_enq - *enqueued;\n+\t\tenq = rte_cryptodev_enqueue_burst(enq_dev_id,\n+\t\t\tenq_qp_id, &mp_crypto_ops[*curr_offset_enq],\n+\t\t\tto_enq);\n+\n+\t\t*enqueued += enq;\n+\t\t*enq_livesign += enq;\n+\t\t*curr_offset_enq = *enqueued % MP_CRYPTO_QP_DESC_NUM;\n+\t\tif (*enq_livesign > mp_app_params->enq_param.checkpoint) {\n+\n+\t\t\tif (process_enq && !process_deq) {\n+\t\t\t\tMP_APP_LOG_NO_RET(INFO, COL_NORM,\n+\t\t\t\t\"Enqueuing %c\",\n+\t\t\t\tlivesign_print_char[*livesign_print_idx]);\n+\t\t\t}\n+\t\t\tif (process_enq && process_deq) {\n+\t\t\t\tMP_APP_LOG_NO_RET(INFO, COL_NORM,\n+\t\t\t\t\"Enqueuing %c Dequeueing %c\",\n+\t\t\t\tlivesign_print_char[*livesign_print_idx],\n+\t\t\t\tlivesign_print_char[*livesign_deq_print_idx]);\n+\t\t\t}\n+\n+\t\t\t(*livesign_print_idx)++;\n+\t\t\t*livesign_print_idx = *livesign_print_idx % 4;\n+\t\t\t*enq_livesign = 0;\n+\t\t}\n+\t}\n+}\n+\n+static int dequeue(int deq_dev_id, int deq_qp_id, uint64_t *dequeued,\n+\t\t\tuint64_t pcks_to_deq, uint64_t *curr_offset_deq,\n+\t\t\tint *deq_livesign, int process_enq, int process_deq,\n+\t\t\tint *livesign_print_idx, int *livesign_deq_print_idx,\n+\t\t\tint64_t *deq_stall_counter, uint64_t *deq_threshold)\n+{\n+\tif (*dequeued < pcks_to_deq || pcks_to_deq == 0) {\n+\t\tuint64_t deq;\n+\t\tuint64_t to_deq = (MP_CRYPTO_QP_DESC_NUM -\n+\t\t\t*curr_offset_deq)\n+\t\t\t> MP_CRYPTO_BURST_NUM ?\tMP_CRYPTO_BURST_NUM :\n+\t\t\tMP_CRYPTO_QP_DESC_NUM - *curr_offset_deq;\n+\n+\t\tif (pcks_to_deq && to_deq > pcks_to_deq - *dequeued)\n+\t\t\tto_deq = pcks_to_deq - *dequeued;\n+\t\tdeq = rte_cryptodev_dequeue_burst(deq_dev_id,\n+\t\t\tdeq_qp_id, &mp_crypto_ops_ret[*curr_offset_deq],\n+\t\t\tto_deq);\n+\t\t*dequeued += deq;\n+\t\t*deq_livesign += deq;\n+\t\t*curr_offset_deq = *dequeued % MP_CRYPTO_QP_DESC_NUM;\n+\t\tif (*deq_livesign > mp_app_params->deq_param.checkpoint) {\n+\t\t\tif (process_deq && !process_enq) {\n+\t\t\t\tMP_APP_LOG_NO_RET(INFO, COL_NORM,\n+\t\t\t\t\"Dequeueing %c\",\n+\t\t\t\tlivesign_print_char[*livesign_deq_print_idx]);\n+\t\t\t}\n+\t\t\tif (process_enq && process_deq) {\n+\t\t\t\tMP_APP_LOG_NO_RET(INFO, COL_NORM,\n+\t\t\t\t\"Enqueuing %c Dequeueing %c\",\n+\t\t\t\tlivesign_print_char[*livesign_print_idx],\n+\t\t\t\tlivesign_print_char[*livesign_deq_print_idx]);\n+\t\t\t}\n+\t\t\t(*livesign_deq_print_idx)++;\n+\t\t\t*livesign_deq_print_idx %= 4;\n+\t\t\t*deq_livesign = 0;\n+\t\t}\n+\t\tif (deq == 0)\n+\t\t\t(*deq_stall_counter)++;\n+\t\telse\n+\t\t\t*deq_stall_counter = 0;\n+\t\tif (mp_crypto_exit_flag) {\n+\t\t\t*deq_threshold += deq;\n+\t\t\tif (*deq_threshold > DEQ_THRESHOLD)\n+\t\t\t\treturn -1;\n+\t\t\tif (*deq_stall_counter > DEQ_THRESHOLD)\n+\t\t\t\treturn -1;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n+int mp_crypto_flow(void)\n+{\n+\tint process_enq = 0, process_deq = 0;\n+\tuint64_t curr_offset_enq = 0;\n+\tuint64_t curr_offset_deq = 0;\n+\tuint64_t enqueued = 0;\n+\tuint64_t dequeued = 0;\n+\tuint64_t deq_threshold = 0;\n+\tchar c = 0;\n+\tuint64_t pcks_to_enq = 0, pcks_to_deq = 0;\n+\n+\tint enq_dev_id = mp_app_devs[mp_app_params->enq_param.dev_id].id;\n+\tint deq_dev_id = mp_app_devs[mp_app_params->deq_param.dev_id].id;\n+\tint enq_qp_id = mp_app_params->enq_param.qp_id;\n+\tint deq_qp_id = mp_app_params->deq_param.qp_id;\n+\tint enq_livesign = 0, deq_livesign = 0;\n+\tint64_t deq_stall_counter = 0;\n+\tint livesign_print_idx = 0;\n+\tint livesign_deq_print_idx = 0;\n+\n+\tif (mp_app_params->enq_param.dev_id >= 0 &&\n+\t\t\t!mp_app_devs[mp_app_params->enq_param.dev_id].probed) {\n+\t\tMP_APP_LOG(ERR, COL_RED, \"Incorrect enq device provided %d\",\n+\t\t\t\tmp_app_params->enq_param.dev_id);\n+\t} else if (mp_app_params->enq_param.dev_id >= 0) {\n+\t\tMP_APP_LOG(INFO, COL_BLUE,\n+\t\t\t\"Start enqueuing packets on dev %d qp %d\",\n+\t\t\tmp_app_params->enq_param.dev_id,\n+\t\t\tmp_app_params->enq_param.qp_id);\n+\t\tpcks_to_enq = mp_app_params->enq_param.ops_no;\n+\t\tprocess_enq = 1;\n+\t}\n+\tif (mp_app_params->deq_param.dev_id >= 0 &&\n+\t\t\t!mp_app_devs[mp_app_params->deq_param.dev_id].probed) {\n+\t\tMP_APP_LOG(ERR, COL_RED, \"Incorrect deq device provided %d\",\n+\t\t\t\tmp_app_params->deq_param.dev_id);\n+\t} else if (mp_app_params->deq_param.dev_id >= 0) {\n+\t\tMP_APP_LOG(INFO, COL_BLUE,\n+\t\t\t\"Start dequeuing packets on dev %d qp %d\",\n+\t\t\tmp_app_params->deq_param.dev_id,\n+\t\t\tmp_app_params->deq_param.qp_id);\n+\t\tpcks_to_deq = mp_app_params->deq_param.ops_no;\n+\t\tprocess_deq = 1;\n+\t}\n+\n+\tif (process_enq == 0 && process_deq == 0) {\n+\t\tMP_APP_LOG_2(WARNING, COL_YEL, \"Nothing to process\");\n+\t\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n+\t\t\twhile (c != 'k') {\n+\t\t\t\tprintf(\"\\nPress 'k' to exit: \");\n+\t\t\t\tint __rte_unused r = scanf(\"%c\", &c);\n+\t\t\t}\n+\t\t}\n+\t\treturn 0;\n+\t}\n+\n+\t/* Check if enq queue was configured */\n+\twhile (process_enq) {\n+\t\tint v = check_for_queue(enq_dev_id, enq_qp_id);\n+\n+\t\tif (v == -1)\n+\t\t\tcontinue;\n+\t\telse if (v == 0)\n+\t\t\tbreak;\n+\t\telse\n+\t\t\treturn -1;\n+\t}\n+\n+\t/* Check if deq queue was configured */\n+\twhile (process_deq) {\n+\t\tint v = check_for_queue(deq_dev_id, deq_qp_id);\n+\n+\t\tif (v == -1)\n+\t\t\tcontinue;\n+\t\telse if (v == 0)\n+\t\t\tbreak;\n+\t\telse\n+\t\t\treturn -1;\n+\t}\n+\n+\tif (process_enq && !process_deq) {\n+\t\tMP_APP_LOG_NO_RET(INFO, COL_NORM, \"Enqueuing %c\",\n+\t\t\tlivesign_print_char[livesign_print_idx]);\n+\t} else if (process_deq && !process_enq) {\n+\t\tMP_APP_LOG_NO_RET(INFO, COL_NORM, \"Dequeuing %c\",\n+\t\t\tlivesign_print_char[livesign_deq_print_idx]);\n+\t} else if (process_enq && process_deq) {\n+\t\tMP_APP_LOG_NO_RET(INFO, COL_NORM, \"Enqueuing %c Dequeueing %c\",\n+\t\t\tlivesign_print_char[livesign_print_idx],\n+\t\t\tlivesign_print_char[livesign_deq_print_idx]);\n+\t}\n+\twhile (1) {\n+\t\tif (process_enq && !mp_crypto_exit_flag) {\n+\t\t\tenqueue(enq_dev_id, enq_qp_id, &enqueued,\n+\t\t\t\tpcks_to_enq, &curr_offset_enq,\n+\t\t\t\t&enq_livesign, process_enq, process_deq,\n+\t\t\t\t&livesign_print_idx, &livesign_deq_print_idx);\n+\t\t}\n+\n+\t\tif (process_deq) {\n+\t\t\tint ret = dequeue(deq_dev_id, deq_qp_id, &dequeued,\n+\t\t\t\tpcks_to_deq, &curr_offset_deq,\n+\t\t\t\t&deq_livesign, process_enq, process_deq,\n+\t\t\t\t&livesign_print_idx, &livesign_deq_print_idx,\n+\t\t\t\t&deq_stall_counter, &deq_threshold);\n+\n+\t\t\tif (ret < 0)\n+\t\t\t\tbreak;\n+\t\t}\n+\n+\t\tif (((dequeued == pcks_to_deq && process_deq)) &&\n+\t\t\t ((enqueued == pcks_to_enq && process_enq))) {\n+\t\t\tMP_APP_LOG(INFO, COL_GREEN,\n+\t\t\t\t\t\"\\nEnqueued %\"PRIu64\", dequeued %\"PRIu64\" packets\",\n+\t\t\t\t\tenqueued, dequeued);\n+\t\t\tbreak;\n+\t\t} else if (dequeued == pcks_to_deq && process_deq &&\n+\t\t\t\t!process_enq && pcks_to_deq)  {\n+\t\t\tMP_APP_LOG(INFO, COL_GREEN, \"\\nDequeued %\"PRIu64\" packets\",\n+\t\t\t\tdequeued);\n+\t\t\tbreak;\n+\t\t} else if (enqueued == pcks_to_enq && process_enq &&\n+\t\t\t\t!process_deq && process_enq)  {\n+\t\t\tMP_APP_LOG(INFO, COL_GREEN, \"\\nEnqueued %\"PRIu64\" packets\",\n+\t\t\t\tenqueued);\n+\t\t\tbreak;\n+\t\t}\n+\t\tif (mp_crypto_exit_flag && !process_deq)\n+\t\t\tbreak;\n+\t}\n+\n+\t/* Verify if all packets are correct */\n+\tif (process_deq) {\n+\t\tuint64_t last_packet = pcks_to_deq > MP_CRYPTO_QP_DESC_NUM ?\n+\t\t\tMP_CRYPTO_QP_DESC_NUM : pcks_to_deq;\n+\t\tif (pcks_to_deq == 0)\n+\t\t\tlast_packet = MP_CRYPTO_QP_DESC_NUM;\n+\t\tif (last_packet >= dequeued)\n+\t\t\tlast_packet = dequeued;\n+\t\tuint64_t k;\n+\t\tint err = 0;\n+\n+\t\tfor (k = 0; k < last_packet; k++) {\n+\t\t\tif (mp_crypto_ops_ret[k]->status !=\n+\t\t\t\tRTE_CRYPTO_OP_STATUS_SUCCESS) {\n+\t\t\t\tMP_APP_LOG(ERR, COL_RED,\n+\t\t\t\t\t\"error when checking status of %\"PRIu64\" packet out of last %\"PRIu64\" packets\",\n+\t\t\t\t\tk, last_packet);\n+\t\t\t\t\terr = 1;\n+\t\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t\tif (err == 0) {\n+\t\t\tMP_APP_LOG(INFO, COL_GREEN,\n+\t\t\t\t\"\\nAll %\"PRIu64\" last packets verified correctly\",\n+\t\t\t\tlast_packet);\n+\t\t}\n+\t}\n+\n+\tif (mp_app_params->print_stats) {\n+\t\tstruct rte_cryptodev_stats stats;\n+\n+\t\tif (enq_qp_id >= 0) {\n+\t\t\trte_cryptodev_stats_get(enq_dev_id, &stats);\n+\t\t\tMP_APP_LOG(INFO, COL_BLUE,\n+\t\t\t\t\"STATS: Enqueued on dev %d = %\"PRIu64,\n+\t\t\t\tenq_dev_id, stats.enqueued_count);\n+\t\t\tMP_APP_LOG(INFO, COL_BLUE,\n+\t\t\t\t\"STATS: Enqueue err count on dev %d = %\"PRIu64,\n+\t\t\t\tenq_dev_id,\n+\t\t\t\tstats.enqueue_err_count);\n+\t\t}\n+\t\tif (deq_qp_id >= 0) {\n+\t\t\trte_cryptodev_stats_get(deq_dev_id, &stats);\n+\t\t\tMP_APP_LOG(INFO, COL_BLUE,\n+\t\t\t\t\"STATS: Dequeued on dev %d = %\"PRIu64,\n+\t\t\t\tdeq_dev_id, stats.dequeued_count);\n+\t\t\tMP_APP_LOG(INFO, COL_BLUE,\n+\t\t\t\t\"STATS: Dequeue err count on dev %d = %\"PRIu64,\n+\t\t\t\tdeq_dev_id, stats.dequeue_err_count);\n+\t\t}\n+\n+\t\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n+\t\t\twhile (c != 'k') {\n+\t\t\t\tprintf(\"\\nPress 'k' to exit: \");\n+\t\t\t\tint __rte_unused r = scanf(\"%c\", &c);\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n int main(int argc, char *argv[])\n {\n \n@@ -587,6 +1114,23 @@ int main(int argc, char *argv[])\n \t\tMP_APP_LOG_2(ERR, COL_RED, \"Cannot create mempools\");\n \t\tgoto err;\n \t}\n+\tret = mp_crypto_init_sessions();\n+\tif (ret < 0) {\n+\t\tMP_APP_LOG_2(ERR, COL_RED, \"Cannot initialize sessions\");\n+\t\tgoto err;\n+\t}\n+\n+\tret = mp_crypto_setup_ops();\n+\tif (ret < 0) {\n+\t\tMP_APP_LOG_2(ERR, COL_RED, \"Cannot setup ops\");\n+\t\tgoto err;\n+\t}\n+\n+\tret = mp_crypto_flow();\n+\tif (ret < 0) {\n+\t\tMP_APP_LOG_2(ERR, COL_RED, \"Cannot enq/deq\");\n+\t\tgoto err;\n+\t}\n \n \tmp_crypto_exit_app();\n \treturn 0;\ndiff --git a/app/test-mp-crypto/meson.build b/app/test-mp-crypto/meson.build\nindex 12a6d49..885668b 100644\n--- a/app/test-mp-crypto/meson.build\n+++ b/app/test-mp-crypto/meson.build\n@@ -1,7 +1,8 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2020 Intel Corporation\n \n-sources = files('mp_crypto.c',\n+sources = files('mp_crypto_vectors.c',\n+\t\t'mp_crypto.c',\n \t\t'mp_crypto_parser.c',\n \t\t'mp_crypto_ipc.c',\n \t\t'main.c')\ndiff --git a/app/test-mp-crypto/mp_crypto.c b/app/test-mp-crypto/mp_crypto.c\nindex b996cf5..efa2634 100644\n--- a/app/test-mp-crypto/mp_crypto.c\n+++ b/app/test-mp-crypto/mp_crypto.c\n@@ -43,3 +43,94 @@ struct rte_crypto_op *mp_crypto_ops_ret[MP_CRYPTO_OPS_NUM];\n /* Per process set of return rte crypto ops */\n struct rte_mbuf *mp_crypto_mbufs[MP_CRYPTO_OPS_NUM];\n /* Per process set of rte mbufs */\n+struct rte_cryptodev_sym_session *mp_crypto_local_sessions[MAX_NUM_OF_SESSIONS];\n+/* Array of private sessions */\n+\n+/* Function for creating sessions */\n+struct rte_cryptodev_sym_session *mp_app_create_session\n+\t(int dev_id, const struct mp_crypto_session_vector *vector)\n+{\n+\tif (vector->x_type == RTE_CRYPTO_SYM_XFORM_AEAD)\n+\t\treturn mp_app_create_aead_session(dev_id, vector);\n+\tMP_APP_LOG_2(ERR, COL_RED, \"Invalid xform type\");\n+\treturn NULL;\n+}\n+\n+/* Create AEAD session */\n+struct rte_cryptodev_sym_session*\n+mp_app_create_aead_session(int dev_id,\n+\t\tconst struct mp_crypto_session_vector *vector)\n+{\n+\tstruct rte_cryptodev_sym_session *session;\n+\tstruct rte_crypto_sym_xform xform;\n+\n+\txform.next = NULL;\n+\txform.type = RTE_CRYPTO_SYM_XFORM_AEAD;\n+\txform.aead.key.length = vector->crypto_key.len;\n+\txform.aead.key.data = vector->crypto_key.data;\n+\txform.aead.algo = vector->aead_algo;\n+\txform.aead.digest_length = vector->digest_len;\n+\txform.aead.iv.length = vector->iv_len;\n+\txform.aead.iv.offset = IV_OFFSET;\n+\txform.aead.aad_length = vector->aad_len;\n+\txform.aead.op = RTE_CRYPTO_AEAD_OP_ENCRYPT;\n+\n+\tsession = rte_cryptodev_sym_session_create(mp_crypto_session_mempool);\n+\tif (session == NULL) {\n+\t\tMP_APP_LOG_2(ERR, COL_RED, \"Failed to create session\");\n+\t\treturn NULL;\n+\t}\n+\tint status = rte_cryptodev_sym_session_init(dev_id, session,\n+\t\t\t&xform,\tmp_crypto_priv_session_mp);\n+\tif (status < 0) {\n+\t\tMP_APP_LOG_2(ERR, COL_RED, \"Failed to init session\");\n+\t\treturn NULL;\n+\t}\n+\n+\treturn session;\n+}\n+\n+int\n+mp_crypto_create_op(struct rte_crypto_op *op, struct rte_mbuf *mbuf,\n+\t\t\tuint16_t vector_number,\n+\t\t\tstruct rte_cryptodev_sym_session *sess)\n+{\n+\tuint8_t *plaintext;\n+\tuint32_t aad_pad_len =\n+\t\tRTE_ALIGN_CEIL(session_vectors[vectors[vector_number].\n+\t\t\t\tsession].aad_len, 16);\n+\n+\tmemset(rte_pktmbuf_mtod(mbuf, uint8_t *), 0,\n+\t\t\trte_pktmbuf_tailroom(mbuf));\n+\tstruct rte_crypto_sym_op *sym_op = op->sym;\n+\n+\tsym_op->aead.aad.data = (uint8_t *)rte_pktmbuf_append(mbuf,\n+\t\t\taad_pad_len);\n+\tsym_op->aead.aad.phys_addr =\n+\t\t\trte_pktmbuf_iova(mbuf);\n+\tmemcpy(sym_op->aead.aad.data, vectors[vector_number].aad.data,\n+\t\tsession_vectors[vectors[vector_number].session].aad_len);\n+\tuint8_t *iv_ptr = rte_crypto_op_ctod_offset(op,\n+\t\t\tuint8_t *, IV_OFFSET);\n+\trte_memcpy(iv_ptr, vectors[vector_number].iv,\n+\t\tsession_vectors[vectors[vector_number].session].iv_len);\n+\n+\tplaintext = (uint8_t *)rte_pktmbuf_append(mbuf,\n+\t\t\tvectors[vector_number].plaintext.len);\n+\trte_memcpy(plaintext, vectors[vector_number].plaintext.data,\n+\t\t\tvectors[vector_number].plaintext.len);\n+\n+\tsym_op->aead.digest.phys_addr =\n+\t\trte_pktmbuf_iova_offset(mbuf,\n+\t\t\tvectors[vector_number].plaintext.len);\n+\n+\tsym_op->aead.digest.data = (uint8_t *)rte_pktmbuf_append(\n+\t\t\tmbuf, vectors[vector_number].digest.len);\n+\n+\tsym_op->aead.data.length = vectors[vector_number].plaintext.len;\n+\tsym_op->aead.data.offset = 0;\n+\n+\tif (rte_crypto_op_attach_sym_session(op, sess))\n+\t\treturn -1;\n+\treturn 0;\n+}\ndiff --git a/app/test-mp-crypto/mp_crypto.h b/app/test-mp-crypto/mp_crypto.h\nindex fad0230..2616052 100644\n--- a/app/test-mp-crypto/mp_crypto.h\n+++ b/app/test-mp-crypto/mp_crypto.h\n@@ -7,6 +7,7 @@\n #include <stdint.h>\n #include <rte_hexdump.h>\n #include <rte_cryptodev.h>\n+#include \"mp_crypto_vectors.h\"\n \n /* Intel QuickAssist Technology Symmetric service PMD name */\n #define CRYPTODEV_NAME_QAT_SYM_PMD\t\"crypto_qat\"\n@@ -32,6 +33,8 @@\n #define MP_APP_CRYPTO_OP_POOL_NAME\t\"MP_APP_OP_NAME\"\n /* Mbuf information */\n #define MP_APP_MBUFPOOL_NAME\t\t\"MP_APP_MBUF_NAME\"\n+/* How long to weit before quit when exit flag set */\n+#define DEQ_THRESHOLD\t\t\t100000\n \n extern int mp_crypto_exit_flag;\n /* Global exit flag */\n@@ -189,6 +192,30 @@ int mp_crypto_init_devs(void);\n int mp_crypto_setup_mpool(void);\n /* Function to set or lookup for mempools */\n \n+int mp_crypto_init_sessions(void);\n+/* Function to setup session according to mask */\n+\n+int mp_crypto_setup_ops(void);\n+/* Function to setup opse according to input string enq=[] */\n+\n+/* Create and init symmetric session */\n+struct rte_cryptodev_sym_session *mp_app_create_session\n+\t\t(int dev_id, const struct mp_crypto_session_vector *vector);\n+\n+/* Create AEAD session */\n+struct rte_cryptodev_sym_session*\n+\t\tmp_app_create_aead_session(int dev_id,\n+\t\tconst struct mp_crypto_session_vector *vector);\n+\n+/* Create op */\n+int\n+mp_crypto_create_op(struct rte_crypto_op *op, struct rte_mbuf *mbuf,\n+\t\t\t\t\tuint16_t vector_number,\n+\t\t\t\t\tstruct rte_cryptodev_sym_session *sess);\n+\n+int mp_crypto_flow(void);\n+/* Flow function for enqueue dequeue */\n+\n #define IV_OFFSET\t\t\t(sizeof(struct rte_crypto_op) + \\\n \t\tsizeof(struct rte_crypto_sym_op) + DEFAULT_NUM_XFORMS * \\\n \t\tsizeof(struct rte_crypto_sym_xform))\ndiff --git a/app/test-mp-crypto/mp_crypto_vectors.c b/app/test-mp-crypto/mp_crypto_vectors.c\nnew file mode 100644\nindex 0000000..37a4f68\n--- /dev/null\n+++ b/app/test-mp-crypto/mp_crypto_vectors.c\n@@ -0,0 +1,174 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation\n+ */\n+#include \"mp_crypto_vectors.h\"\n+\n+const struct mp_crypto_session_vector session_vectors[] = {\n+\t{ /* Session 0 */\n+\t\t.aead_op = RTE_CRYPTO_AEAD_OP_ENCRYPT,\n+\t\t.x_type = RTE_CRYPTO_SYM_XFORM_AEAD,\n+\t\t.aead_algo = RTE_CRYPTO_AEAD_AES_GCM,\n+\t\t.crypto_key = {\n+\t\t\t.data = {\n+\t\t\t\t0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,\n+\t\t\t\t0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08\n+\t\t\t},\n+\t\t\t.len = 16,\n+\t\t},\n+\t\t.aad_len = 0,\n+\t\t.iv_len = 12,\n+\t\t.digest_len = 16,\n+\t},\n+\t{ /* Session 1 */\n+\t\t.aead_op = RTE_CRYPTO_AEAD_OP_ENCRYPT,\n+\t\t.x_type = RTE_CRYPTO_SYM_XFORM_AEAD,\n+\t\t.aead_algo = RTE_CRYPTO_AEAD_AES_GCM,\n+\t\t.crypto_key = {\n+\t\t\t.data = {\n+\t\t\t\t0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C,\n+\t\t\t\t0x6D, 0x6A, 0x8F, 0x94, 0x67, 0x30, 0x83, 0x08,\n+\t\t\t\t0xFE, 0xFF, 0xE9, 0x92, 0x86, 0x65, 0x73, 0x1C\n+\t\t\t},\n+\t\t\t.len = 24,\n+\t\t},\n+\t\t.aad_len = 0,\n+\t\t.iv_len = 12,\n+\t\t.digest_len = 16,\n+\t},\n+};\n+const uint64_t mp_app_numof_sessions =\n+\t\t\t\tRTE_DIM(session_vectors);\n+/* Number of all sessions in array */\n+\n+const struct mp_crypto_vector vectors[] = {\n+\t\t{ /* Vector 0 AES128-GCM */\n+\t\t\t.session = 0,\n+\t\t\t.plaintext = {\n+\t\t\t\t.data = {\n+\t\t\t\t\t0xd9, 0x31, 0x32, 0x25,\n+\t\t\t\t\t0xf8, 0x84, 0x06, 0xe5,\n+\t\t\t\t\t0xa5, 0x59, 0x09, 0xc5,\n+\t\t\t\t\t0xaf, 0xf5, 0x26, 0x9a,\n+\t\t\t\t\t0x86, 0xa7, 0xa9, 0x53,\n+\t\t\t\t\t0x15, 0x34, 0xf7, 0xda,\n+\t\t\t\t\t0x2e, 0x4c, 0x30, 0x3d,\n+\t\t\t\t\t0x8a, 0x31, 0x8a, 0x72,\n+\t\t\t\t\t0x1c, 0x3c, 0x0c, 0x95,\n+\t\t\t\t\t0x95, 0x68, 0x09, 0x53,\n+\t\t\t\t\t0x2f, 0xcf, 0x0e, 0x24,\n+\t\t\t\t\t0x49, 0xa6, 0xb5, 0x25,\n+\t\t\t\t\t0xb1, 0x6a, 0xed, 0xf5,\n+\t\t\t\t\t0xaa, 0x0d, 0xe6, 0x57,\n+\t\t\t\t\t0xba, 0x63, 0x7b, 0x39,\n+\t\t\t\t},\n+\t\t\t\t.len = 60,\n+\t\t\t},\n+\t\t\t.iv = {\n+\t\t\t\t\t0xca, 0xfe, 0xba, 0xbe,\n+\t\t\t\t\t0xfa, 0xce, 0xdb, 0xad,\n+\t\t\t\t\t0xde, 0xca, 0xf8, 0x88\n+\t\t\t},\n+\t\t\t.ciphertext = {\n+\t\t\t\t.data = {\n+\t\t\t\t\t0x42, 0x83, 0x1e, 0xc2,\n+\t\t\t\t\t0x21, 0x77, 0x74, 0x24,\n+\t\t\t\t\t0x4b, 0x72, 0x21, 0xb7,\n+\t\t\t\t\t0x84, 0xd0, 0xd4, 0x9c,\n+\t\t\t\t\t0xe3, 0xaa, 0x21, 0x2f,\n+\t\t\t\t\t0x2c, 0x02, 0xa4, 0xe0,\n+\t\t\t\t\t0x35, 0xc1, 0x7e, 0x23,\n+\t\t\t\t\t0x29, 0xac, 0xa1, 0x2e,\n+\t\t\t\t\t0x21, 0xd5, 0x14, 0xb2,\n+\t\t\t\t\t0x54, 0x66, 0x93, 0x1c,\n+\t\t\t\t\t0x7d, 0x8f, 0x6a, 0x5a,\n+\t\t\t\t\t0xac, 0x84, 0xaa, 0x05,\n+\t\t\t\t\t0x1b, 0xa3, 0x0b, 0x39,\n+\t\t\t\t\t0x6a, 0x0a, 0xac, 0x97,\n+\t\t\t\t\t0x3d, 0x58, 0xe0, 0x91\n+\t\t\t\t},\n+\t\t\t\t.len = 60\n+\t\t\t},\n+\t\t\t.aad = {\n+\t\t\t\t.data = {\n+\n+\t\t\t\t},\n+\t\t\t},\n+\t\t\t.digest = {\n+\t\t\t\t.data = {\n+\t\t\t\t\t0xA2, 0xA4, 0x35, 0x75,\n+\t\t\t\t\t0xDC, 0xB0, 0x57, 0x74,\n+\t\t\t\t\t0x07, 0x02, 0x30, 0xC2,\n+\t\t\t\t\t0xE7, 0x52, 0x02, 0x00},\n+\t\t\t\t.len = 16\n+\t\t\t},\n+\t\t},\n+\t\t{ /* Vector 1 AES192-GCM */\n+\t\t\t.session = 1,\n+\t\t\t.plaintext = {\n+\t\t\t\t.data = {\n+\t\t\t\t\t0xD9, 0x31, 0x32, 0x25,\n+\t\t\t\t\t0xF8, 0x84, 0x06, 0xE5,\n+\t\t\t\t\t0xA5, 0x59, 0x09, 0xC5,\n+\t\t\t\t\t0xAF, 0xF5, 0x26, 0x9A,\n+\t\t\t\t\t0x86, 0xA7, 0xA9, 0x53,\n+\t\t\t\t\t0x15, 0x34, 0xF7, 0xDA,\n+\t\t\t\t\t0x2E, 0x4C, 0x30, 0x3D,\n+\t\t\t\t\t0x8A, 0x31, 0x8A, 0x72,\n+\t\t\t\t\t0x1C, 0x3C, 0x0C, 0x95,\n+\t\t\t\t\t0x95, 0x68, 0x09, 0x53,\n+\t\t\t\t\t0x2F, 0xCF, 0x0E, 0x24,\n+\t\t\t\t\t0x49, 0xA6, 0xB5, 0x25,\n+\t\t\t\t\t0xB1, 0x6A, 0xED, 0xF5,\n+\t\t\t\t\t0xAA, 0x0D, 0xE6, 0x57,\n+\t\t\t\t\t0xBA, 0x63, 0x7B, 0x39,\n+\t\t\t\t\t0x1A, 0xAF, 0xD2, 0x55\n+\t\t\t\t},\n+\t\t\t\t.len = 60,\n+\t\t\t},\n+\t\t\t.iv = {\n+\t\t\t\t0xCA, 0xFE, 0xBA, 0xBE,\n+\t\t\t\t0xFA, 0xCE, 0xDB, 0xAD,\n+\t\t\t\t0xDE, 0xCA, 0xF8, 0x88\n+\t\t\t},\n+\t\t\t.ciphertext = {\n+\t\t\t\t.data = {\n+\t\t\t\t\t0x39, 0x80, 0xCA, 0x0B,\n+\t\t\t\t\t0x3C, 0x00, 0xE8, 0x41,\n+\t\t\t\t\t0xEB, 0x06, 0xFA, 0xC4,\n+\t\t\t\t\t0x87, 0x2A, 0x27, 0x57,\n+\t\t\t\t\t0x85, 0x9E, 0x1C, 0xEA,\n+\t\t\t\t\t0xA6, 0xEF, 0xD9, 0x84,\n+\t\t\t\t\t0x62, 0x85, 0x93, 0xB4,\n+\t\t\t\t\t0x0C, 0xA1, 0xE1, 0x9C,\n+\t\t\t\t\t0x7D, 0x77, 0x3D, 0x00,\n+\t\t\t\t\t0xC1, 0x44, 0xC5, 0x25,\n+\t\t\t\t\t0xAC, 0x61, 0x9D, 0x18,\n+\t\t\t\t\t0xC8, 0x4A, 0x3F, 0x47,\n+\t\t\t\t\t0x18, 0xE2, 0x44, 0x8B,\n+\t\t\t\t\t0x2F, 0xE3, 0x24, 0xD9,\n+\t\t\t\t\t0xCC, 0xDA, 0x27, 0x10,\n+\t\t\t\t\t0xAC, 0xAD, 0xE2, 0x56\n+\t\t\t\t},\n+\t\t\t\t.len = 60\n+\t\t\t},\n+\t\t\t.aad = {\n+\t\t\t\t.data = {\n+\n+\t\t\t\t},\n+\t\t\t},\n+\t\t\t.digest = {\n+\t\t\t\t.data = {\n+\t\t\t\t\t0x99, 0x24, 0xA7, 0xC8,\n+\t\t\t\t\t0x58, 0x73, 0x36, 0xBF,\n+\t\t\t\t\t0xB1, 0x18, 0x02, 0x4D,\n+\t\t\t\t\t0xB8, 0x67, 0x4A, 0x14\n+\t\t\t\t},\n+\t\t\t\t.len = 16\n+\t\t\t},\n+\t\t},\n+\n+\n+};\n+\n+const uint64_t mp_app_numof_ops = RTE_DIM(vectors);\n+/* Number of all operation instances */\ndiff --git a/app/test-mp-crypto/mp_crypto_vectors.h b/app/test-mp-crypto/mp_crypto_vectors.h\nnew file mode 100644\nindex 0000000..65386ad\n--- /dev/null\n+++ b/app/test-mp-crypto/mp_crypto_vectors.h\n@@ -0,0 +1,66 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation\n+ */\n+#ifndef _MP_CRYPTO_SAMPLE_APP_VECTORS_\n+#define _MP_CRYPTO_SAMPLE_APP_VECTORS_\n+\n+#include <rte_cryptodev.h>\n+\n+struct mp_crypto_session_vector {\n+\tunion {\n+\t\tenum rte_crypto_aead_algorithm aead_algo;\n+\t\tenum rte_crypto_auth_algorithm auth_algo;\n+\t\tenum rte_crypto_cipher_algorithm cipher_algo;\n+\t};\n+\tenum rte_crypto_sym_xform_type x_type;\n+\tunion {\n+\t\tenum rte_crypto_aead_operation aead_op;\n+\t\tenum rte_crypto_cipher_operation cipher_op;\n+\t\tenum rte_crypto_auth_operation auth_op;\n+\t};\n+\tstruct {\n+\t\tuint8_t data[64];\n+\t\tuint16_t len;\n+\t} crypto_key;\n+\tstruct {\n+\t\tuint8_t data[64];\n+\t\tuint16_t len;\n+\t} auth_key;\n+\tuint16_t aad_len;\n+\tuint16_t iv_len;\n+\tuint16_t digest_len;\n+\tint chained;\n+};\n+\n+struct mp_crypto_vector {\n+\tint session;\n+\tstruct {\n+\t\tuint8_t data[2048];\n+\t\tint len;\n+\t} ciphertext;\n+\tstruct {\n+\t\tuint8_t data[2048];\n+\t\tint len;\n+\t} plaintext;\n+\tstruct {\n+\t\tuint8_t data[2048];\n+\t\tint len;\n+\t} digest;\n+\tstruct {\n+\t\tuint8_t data[64];\n+\t} aad;\n+\tuint8_t iv[16];\n+};\n+\n+/* Predefinced vectors */\n+extern const struct mp_crypto_session_vector session_vectors[];\n+/* Sessions vectors for this device */\n+extern const uint64_t mp_app_numof_sessions;\n+/* Number of all sessions in array */\n+\n+extern const struct mp_crypto_vector vectors[];\n+/* Operation vectors for this device */\n+const uint64_t mp_app_numof_ops;\n+/* Total number of operation types */\n+\n+#endif\n",
    "prefixes": [
        "v3",
        "4/5"
    ]
}