get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 25586,
    "url": "https://patches.dpdk.org/api/patches/25586/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20170621074731.45013-9-pablo.de.lara.guarch@intel.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": "<20170621074731.45013-9-pablo.de.lara.guarch@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170621074731.45013-9-pablo.de.lara.guarch@intel.com",
    "date": "2017-06-21T07:47:18",
    "name": "[dpdk-dev,09/22] app/crypto-perf: move IV to crypto op private data",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "cce4cf4b0f0c24d8c36578f6d011767e5f764fe9",
    "submitter": {
        "id": 9,
        "url": "https://patches.dpdk.org/api/people/9/?format=api",
        "name": "De Lara Guarch, Pablo",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20170621074731.45013-9-pablo.de.lara.guarch@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/25586/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/25586/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 459347D1F;\n\tWed, 21 Jun 2017 17:47:41 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 4FEAD7CD7\n\tfor <dev@dpdk.org>; Wed, 21 Jun 2017 17:47:24 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Jun 2017 08:47:24 -0700",
            "from silpixa00399464.ir.intel.com (HELO\n\tsilpixa00399464.ger.corp.intel.com) ([10.237.222.157])\n\tby orsmga004.jf.intel.com with ESMTP; 21 Jun 2017 08:47:23 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.39,369,1493708400\"; d=\"scan'208\";a=\"100153496\"",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "To": "pablo.de.lara.guarch@intel.com",
        "Cc": "dev@dpdk.org",
        "Date": "Wed, 21 Jun 2017 08:47:18 +0100",
        "Message-Id": "<20170621074731.45013-9-pablo.de.lara.guarch@intel.com>",
        "X-Mailer": "git-send-email 2.9.4",
        "In-Reply-To": "<20170621074731.45013-1-pablo.de.lara.guarch@intel.com>",
        "References": "<20170621074731.45013-1-pablo.de.lara.guarch@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 09/22] app/crypto-perf: move IV to crypto op\n\tprivate data",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "Usually, IV will change for each crypto operation.\nTherefore, instead of pointing at the same location,\nIV is copied after each crypto operation.\n\nThis will let the IV to be passed as an offset from\nthe beginning of the crypto operation, instead of\na pointer.\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n app/test-crypto-perf/cperf_ops.c                 | 45 +++++++++++++++++-------\n app/test-crypto-perf/cperf_ops.h                 |  3 +-\n app/test-crypto-perf/cperf_test_latency.c        |  9 +++--\n app/test-crypto-perf/cperf_test_throughput.c     |  9 +++--\n app/test-crypto-perf/cperf_test_vector_parsing.c |  1 -\n app/test-crypto-perf/cperf_test_vectors.c        |  1 -\n app/test-crypto-perf/cperf_test_verify.c         |  8 +++--\n 7 files changed, 55 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c\nindex c2c3db5..423bdae 100644\n--- a/app/test-crypto-perf/cperf_ops.c\n+++ b/app/test-crypto-perf/cperf_ops.c\n@@ -40,7 +40,8 @@ cperf_set_ops_null_cipher(struct rte_crypto_op **ops,\n \t\tstruct rte_mbuf **bufs_in, struct rte_mbuf **bufs_out,\n \t\tuint16_t nb_ops, struct rte_cryptodev_sym_session *sess,\n \t\tconst struct cperf_options *options,\n-\t\tconst struct cperf_test_vector *test_vector __rte_unused)\n+\t\tconst struct cperf_test_vector *test_vector __rte_unused,\n+\t\tuint16_t iv_offset __rte_unused)\n {\n \tuint16_t i;\n \n@@ -65,7 +66,8 @@ cperf_set_ops_null_auth(struct rte_crypto_op **ops,\n \t\tstruct rte_mbuf **bufs_in, struct rte_mbuf **bufs_out,\n \t\tuint16_t nb_ops, struct rte_cryptodev_sym_session *sess,\n \t\tconst struct cperf_options *options,\n-\t\tconst struct cperf_test_vector *test_vector __rte_unused)\n+\t\tconst struct cperf_test_vector *test_vector __rte_unused,\n+\t\tuint16_t iv_offset __rte_unused)\n {\n \tuint16_t i;\n \n@@ -90,7 +92,8 @@ cperf_set_ops_cipher(struct rte_crypto_op **ops,\n \t\tstruct rte_mbuf **bufs_in, struct rte_mbuf **bufs_out,\n \t\tuint16_t nb_ops, struct rte_cryptodev_sym_session *sess,\n \t\tconst struct cperf_options *options,\n-\t\tconst struct cperf_test_vector *test_vector)\n+\t\tconst struct cperf_test_vector *test_vector,\n+\t\tuint16_t iv_offset)\n {\n \tuint16_t i;\n \n@@ -103,9 +106,14 @@ cperf_set_ops_cipher(struct rte_crypto_op **ops,\n \t\tsym_op->m_dst = bufs_out[i];\n \n \t\t/* cipher parameters */\n-\t\tsym_op->cipher.iv.data = test_vector->iv.data;\n-\t\tsym_op->cipher.iv.phys_addr = test_vector->iv.phys_addr;\n+\t\tsym_op->cipher.iv.data = rte_crypto_op_ctod_offset(ops[i],\n+\t\t\t\t\t\t\tuint8_t *, iv_offset);\n+\t\tsym_op->cipher.iv.phys_addr = rte_crypto_op_ctophys_offset(ops[i],\n+\t\t\t\t\t\t\tiv_offset);\n \t\tsym_op->cipher.iv.length = test_vector->iv.length;\n+\t\tmemcpy(sym_op->cipher.iv.data,\n+\t\t\t\ttest_vector->iv.data,\n+\t\t\t\ttest_vector->iv.length);\n \n \t\tif (options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||\n \t\t\t\toptions->cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 ||\n@@ -125,7 +133,8 @@ cperf_set_ops_auth(struct rte_crypto_op **ops,\n \t\tstruct rte_mbuf **bufs_in, struct rte_mbuf **bufs_out,\n \t\tuint16_t nb_ops, struct rte_cryptodev_sym_session *sess,\n \t\tconst struct cperf_options *options,\n-\t\tconst struct cperf_test_vector *test_vector)\n+\t\tconst struct cperf_test_vector *test_vector,\n+\t\tuint16_t iv_offset __rte_unused)\n {\n \tuint16_t i;\n \n@@ -190,7 +199,8 @@ cperf_set_ops_cipher_auth(struct rte_crypto_op **ops,\n \t\tstruct rte_mbuf **bufs_in, struct rte_mbuf **bufs_out,\n \t\tuint16_t nb_ops, struct rte_cryptodev_sym_session *sess,\n \t\tconst struct cperf_options *options,\n-\t\tconst struct cperf_test_vector *test_vector)\n+\t\tconst struct cperf_test_vector *test_vector,\n+\t\tuint16_t iv_offset)\n {\n \tuint16_t i;\n \n@@ -203,9 +213,14 @@ cperf_set_ops_cipher_auth(struct rte_crypto_op **ops,\n \t\tsym_op->m_dst = bufs_out[i];\n \n \t\t/* cipher parameters */\n-\t\tsym_op->cipher.iv.data = test_vector->iv.data;\n-\t\tsym_op->cipher.iv.phys_addr = test_vector->iv.phys_addr;\n+\t\tsym_op->cipher.iv.data = rte_crypto_op_ctod_offset(ops[i],\n+\t\t\t\t\t\t\tuint8_t *, iv_offset);\n+\t\tsym_op->cipher.iv.phys_addr = rte_crypto_op_ctophys_offset(ops[i],\n+\t\t\t\t\t\t\tiv_offset);\n \t\tsym_op->cipher.iv.length = test_vector->iv.length;\n+\t\tmemcpy(sym_op->cipher.iv.data,\n+\t\t\t\ttest_vector->iv.data,\n+\t\t\t\ttest_vector->iv.length);\n \n \t\tif (options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||\n \t\t\t\toptions->cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 ||\n@@ -268,7 +283,8 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,\n \t\tstruct rte_mbuf **bufs_in, struct rte_mbuf **bufs_out,\n \t\tuint16_t nb_ops, struct rte_cryptodev_sym_session *sess,\n \t\tconst struct cperf_options *options,\n-\t\tconst struct cperf_test_vector *test_vector)\n+\t\tconst struct cperf_test_vector *test_vector,\n+\t\tuint16_t iv_offset)\n {\n \tuint16_t i;\n \n@@ -281,9 +297,14 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,\n \t\tsym_op->m_dst = bufs_out[i];\n \n \t\t/* cipher parameters */\n-\t\tsym_op->cipher.iv.data = test_vector->iv.data;\n-\t\tsym_op->cipher.iv.phys_addr = test_vector->iv.phys_addr;\n+\t\tsym_op->cipher.iv.data = rte_crypto_op_ctod_offset(ops[i],\n+\t\t\t\t\t\t\tuint8_t *, iv_offset);\n+\t\tsym_op->cipher.iv.phys_addr = rte_crypto_op_ctophys_offset(ops[i],\n+\t\t\t\t\t\t\tiv_offset);\n \t\tsym_op->cipher.iv.length = test_vector->iv.length;\n+\t\tmemcpy(sym_op->cipher.iv.data,\n+\t\t\t\ttest_vector->iv.data,\n+\t\t\t\ttest_vector->iv.length);\n \n \t\tsym_op->cipher.data.length = options->test_buffer_size;\n \t\tsym_op->cipher.data.offset =\ndiff --git a/app/test-crypto-perf/cperf_ops.h b/app/test-crypto-perf/cperf_ops.h\nindex 1b748da..f7b431c 100644\n--- a/app/test-crypto-perf/cperf_ops.h\n+++ b/app/test-crypto-perf/cperf_ops.h\n@@ -48,7 +48,8 @@ typedef int (*cperf_populate_ops_t)(struct rte_crypto_op **ops,\n \t\tstruct rte_mbuf **bufs_in, struct rte_mbuf **bufs_out,\n \t\tuint16_t nb_ops, struct rte_cryptodev_sym_session *sess,\n \t\tconst struct cperf_options *options,\n-\t\tconst struct cperf_test_vector *test_vector);\n+\t\tconst struct cperf_test_vector *test_vector,\n+\t\tuint16_t iv_offset);\n \n struct cperf_op_fns {\n \tcperf_sessions_create_t sess_create;\ndiff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c\nindex 215614e..ef54b2d 100644\n--- a/app/test-crypto-perf/cperf_test_latency.c\n+++ b/app/test-crypto-perf/cperf_test_latency.c\n@@ -68,6 +68,7 @@ struct cperf_latency_ctx {\n \n struct priv_op_data {\n \tstruct cperf_op_result *result;\n+\tuint8_t IV[0];\n };\n \n #define max(a, b) (a > b ? (uint64_t)a : (uint64_t)b)\n@@ -280,7 +281,7 @@ cperf_latency_test_constructor(uint8_t dev_id, uint16_t qp_id,\n \tsnprintf(pool_name, sizeof(pool_name), \"cperf_op_pool_cdev_%d\",\n \t\t\tdev_id);\n \n-\tuint16_t priv_size = sizeof(struct priv_op_data);\n+\tuint16_t priv_size = sizeof(struct priv_op_data) + test_vector->iv.length;\n \tctx->crypto_op_pool = rte_crypto_op_pool_create(pool_name,\n \t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, 0, priv_size,\n \t\t\trte_socket_id());\n@@ -344,6 +345,10 @@ cperf_latency_test_runner(void *arg)\n \telse\n \t\ttest_burst_size = ctx->options->burst_size_list[0];\n \n+\tuint16_t iv_offset = sizeof(struct rte_crypto_op) +\n+\t\tsizeof(struct rte_crypto_sym_op) +\n+\t\tsizeof(struct cperf_op_result *);\n+\n \twhile (test_burst_size <= ctx->options->max_burst_size) {\n \t\tuint64_t ops_enqd = 0, ops_deqd = 0;\n \t\tuint64_t m_idx = 0, b_idx = 0;\n@@ -372,7 +377,7 @@ cperf_latency_test_runner(void *arg)\n \t\t\t(ctx->populate_ops)(ops, &ctx->mbufs_in[m_idx],\n \t\t\t\t\t&ctx->mbufs_out[m_idx],\n \t\t\t\t\tburst_size, ctx->sess, ctx->options,\n-\t\t\t\t\tctx->test_vector);\n+\t\t\t\t\tctx->test_vector, iv_offset);\n \n \t\t\ttsc_start = rte_rdtsc_precise();\n \ndiff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c\nindex 61b27ea..ba883fd 100644\n--- a/app/test-crypto-perf/cperf_test_throughput.c\n+++ b/app/test-crypto-perf/cperf_test_throughput.c\n@@ -262,8 +262,10 @@ cperf_throughput_test_constructor(uint8_t dev_id, uint16_t qp_id,\n \tsnprintf(pool_name, sizeof(pool_name), \"cperf_op_pool_cdev_%d\",\n \t\t\tdev_id);\n \n+\tuint16_t priv_size = test_vector->iv.length;\n+\n \tctx->crypto_op_pool = rte_crypto_op_pool_create(pool_name,\n-\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, 0, 0,\n+\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, 0, priv_size,\n \t\t\trte_socket_id());\n \tif (ctx->crypto_op_pool == NULL)\n \t\tgoto err;\n@@ -315,6 +317,9 @@ cperf_throughput_test_runner(void *test_ctx)\n \telse\n \t\ttest_burst_size = ctx->options->burst_size_list[0];\n \n+\tuint16_t iv_offset = sizeof(struct rte_crypto_op) +\n+\t\tsizeof(struct rte_crypto_sym_op);\n+\n \twhile (test_burst_size <= ctx->options->max_burst_size) {\n \t\tuint64_t ops_enqd = 0, ops_enqd_total = 0, ops_enqd_failed = 0;\n \t\tuint64_t ops_deqd = 0, ops_deqd_total = 0, ops_deqd_failed = 0;\n@@ -346,7 +351,7 @@ cperf_throughput_test_runner(void *test_ctx)\n \t\t\t(ctx->populate_ops)(ops, &ctx->mbufs_in[m_idx],\n \t\t\t\t\t&ctx->mbufs_out[m_idx],\n \t\t\t\t\tops_needed, ctx->sess, ctx->options,\n-\t\t\t\t\tctx->test_vector);\n+\t\t\t\t\tctx->test_vector, iv_offset);\n \n \t\t\t/**\n \t\t\t * When ops_needed is smaller than ops_enqd, the\ndiff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c\nindex f384e3d..62d0c91 100644\n--- a/app/test-crypto-perf/cperf_test_vector_parsing.c\n+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c\n@@ -303,7 +303,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector,\n \t} else if (strstr(key_token, \"iv\")) {\n \t\trte_free(vector->iv.data);\n \t\tvector->iv.data = data;\n-\t\tvector->iv.phys_addr = rte_malloc_virt2phy(vector->iv.data);\n \t\tif (tc_found)\n \t\t\tvector->iv.length = data_length;\n \t\telse {\ndiff --git a/app/test-crypto-perf/cperf_test_vectors.c b/app/test-crypto-perf/cperf_test_vectors.c\nindex 757957f..36b3f6f 100644\n--- a/app/test-crypto-perf/cperf_test_vectors.c\n+++ b/app/test-crypto-perf/cperf_test_vectors.c\n@@ -423,7 +423,6 @@ cperf_test_vector_get_dummy(struct cperf_options *options)\n \t\t\tmemcpy(t_vec->iv.data, iv, options->cipher_iv_sz);\n \t\t}\n \t\tt_vec->ciphertext.length = options->max_buffer_size;\n-\t\tt_vec->iv.phys_addr = rte_malloc_virt2phy(t_vec->iv.data);\n \t\tt_vec->iv.length = options->cipher_iv_sz;\n \t\tt_vec->data.cipher_offset = 0;\n \t\tt_vec->data.cipher_length = options->max_buffer_size;\ndiff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c\nindex 454221e..d5a2b33 100644\n--- a/app/test-crypto-perf/cperf_test_verify.c\n+++ b/app/test-crypto-perf/cperf_test_verify.c\n@@ -266,8 +266,9 @@ cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,\n \tsnprintf(pool_name, sizeof(pool_name), \"cperf_op_pool_cdev_%d\",\n \t\t\tdev_id);\n \n+\tuint16_t priv_size = test_vector->iv.length;\n \tctx->crypto_op_pool = rte_crypto_op_pool_create(pool_name,\n-\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, 0, 0,\n+\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, 0, priv_size,\n \t\t\trte_socket_id());\n \tif (ctx->crypto_op_pool == NULL)\n \t\tgoto err;\n@@ -417,6 +418,9 @@ cperf_verify_test_runner(void *test_ctx)\n \t\tprintf(\"\\n# Running verify test on device: %u, lcore: %u\\n\",\n \t\t\tctx->dev_id, lcore);\n \n+\tuint16_t iv_offset = sizeof(struct rte_crypto_op) +\n+\t\tsizeof(struct rte_crypto_sym_op);\n+\n \twhile (ops_enqd_total < ctx->options->total_ops) {\n \n \t\tuint16_t burst_size = ((ops_enqd_total + ctx->options->max_burst_size)\n@@ -438,7 +442,7 @@ cperf_verify_test_runner(void *test_ctx)\n \t\t(ctx->populate_ops)(ops, &ctx->mbufs_in[m_idx],\n \t\t\t\t&ctx->mbufs_out[m_idx],\n \t\t\t\tops_needed, ctx->sess, ctx->options,\n-\t\t\t\tctx->test_vector);\n+\t\t\t\tctx->test_vector, iv_offset);\n \n #ifdef CPERF_LINEARIZATION_ENABLE\n \t\tif (linearize) {\n",
    "prefixes": [
        "dpdk-dev",
        "09/22"
    ]
}