get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 26194,
    "url": "https://patches.dpdk.org/api/patches/26194/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20170702054127.75610-10-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": "<20170702054127.75610-10-pablo.de.lara.guarch@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170702054127.75610-10-pablo.de.lara.guarch@intel.com",
    "date": "2017-07-02T05:41:10",
    "name": "[dpdk-dev,v4,09/26] app/crypto-perf: move IV to crypto op private data",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8b80c909908124cd5d80a0ba8036f768cb7d273a",
    "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": {
        "id": 22,
        "url": "https://patches.dpdk.org/api/users/22/?format=api",
        "username": "pdelarag",
        "first_name": "Pablo",
        "last_name": "de Lara Guarch",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20170702054127.75610-10-pablo.de.lara.guarch@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/26194/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/26194/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 6BB927CBF;\n\tSun,  2 Jul 2017 15:41:37 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 061DF7CBB\n\tfor <dev@dpdk.org>; Sun,  2 Jul 2017 15:41:34 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Jul 2017 06:41:33 -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; 02 Jul 2017 06:41:31 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.40,297,1496127600\"; d=\"scan'208\";a=\"103708343\"",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "To": "declan.doherty@intel.com, zbigniew.bodek@caviumnetworks.com,\n\tjerin.jacob@caviumnetworks.com, akhil.goyal@nxp.com,\n\themant.agrawal@nxp.com, fiona.trahe@intel.com, john.griffin@intel.com,\n\tdeepak.k.jain@intel.com",
        "Cc": "dev@dpdk.org,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Date": "Sun,  2 Jul 2017 06:41:10 +0100",
        "Message-Id": "<20170702054127.75610-10-pablo.de.lara.guarch@intel.com>",
        "X-Mailer": "git-send-email 2.9.4",
        "In-Reply-To": "<20170702054127.75610-1-pablo.de.lara.guarch@intel.com>",
        "References": "<20170629113521.5560-1-pablo.de.lara.guarch@intel.com>\n\t<20170702054127.75610-1-pablo.de.lara.guarch@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 09/26] 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>\nAcked-by: Akhil Goyal <akhil.goyal@nxp.com>\nAcked-by: Fiona Trahe <fiona.trahe@intel.com>\n---\n app/test-crypto-perf/cperf_ops.c                 | 57 +++++++++++++++++++-----\n app/test-crypto-perf/cperf_ops.h                 |  3 +-\n app/test-crypto-perf/cperf_test_latency.c        |  8 +++-\n app/test-crypto-perf/cperf_test_throughput.c     | 11 +++--\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         | 10 +++--\n 7 files changed, 68 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c\nindex 17df2eb..0f45a3c 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,8 +106,10 @@ 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 \n \t\tif (options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||\n@@ -117,6 +122,13 @@ cperf_set_ops_cipher(struct rte_crypto_op **ops,\n \t\tsym_op->cipher.data.offset = 0;\n \t}\n \n+\tif (options->test == CPERF_TEST_TYPE_VERIFY) {\n+\t\tfor (i = 0; i < nb_ops; i++)\n+\t\t\tmemcpy(ops[i]->sym->cipher.iv.data,\n+\t\t\t\ttest_vector->iv.data,\n+\t\t\t\ttest_vector->iv.length);\n+\t}\n+\n \treturn 0;\n }\n \n@@ -125,7 +137,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@@ -189,7 +202,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@@ -202,8 +216,10 @@ 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 \n \t\tif (options->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 ||\n@@ -258,6 +274,13 @@ cperf_set_ops_cipher_auth(struct rte_crypto_op **ops,\n \t\tsym_op->auth.data.offset = 0;\n \t}\n \n+\tif (options->test == CPERF_TEST_TYPE_VERIFY) {\n+\t\tfor (i = 0; i < nb_ops; i++)\n+\t\t\tmemcpy(ops[i]->sym->cipher.iv.data,\n+\t\t\t\ttest_vector->iv.data,\n+\t\t\t\ttest_vector->iv.length);\n+\t}\n+\n \treturn 0;\n }\n \n@@ -266,7 +289,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@@ -279,8 +303,10 @@ 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 \n \t\tsym_op->cipher.data.length = options->test_buffer_size;\n@@ -327,6 +353,13 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,\n \t\tsym_op->auth.data.offset = options->auth_aad_sz;\n \t}\n \n+\tif (options->test == CPERF_TEST_TYPE_VERIFY) {\n+\t\tfor (i = 0; i < nb_ops; i++)\n+\t\t\tmemcpy(ops[i]->sym->cipher.iv.data,\n+\t\t\t\ttest_vector->iv.data,\n+\t\t\t\ttest_vector->iv.length);\n+\t}\n+\n \treturn 0;\n }\n \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 32cf5fd..c33129b 100644\n--- a/app/test-crypto-perf/cperf_test_latency.c\n+++ b/app/test-crypto-perf/cperf_test_latency.c\n@@ -280,7 +280,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,\n \t\t\t512, priv_size, rte_socket_id());\n@@ -355,6 +355,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@@ -383,7 +387,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 85947a5..5a90eb0 100644\n--- a/app/test-crypto-perf/cperf_test_throughput.c\n+++ b/app/test-crypto-perf/cperf_test_throughput.c\n@@ -262,9 +262,11 @@ 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, 512, 0,\n-\t\t\trte_socket_id());\n+\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz,\n+\t\t\t512, priv_size, rte_socket_id());\n \tif (ctx->crypto_op_pool == NULL)\n \t\tgoto err;\n \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 b19f5e1..be684a6 100644\n--- a/app/test-crypto-perf/cperf_test_verify.c\n+++ b/app/test-crypto-perf/cperf_test_verify.c\n@@ -266,9 +266,10 @@ 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, 512, 0,\n-\t\t\trte_socket_id());\n+\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz,\n+\t\t\t512, priv_size, rte_socket_id());\n \tif (ctx->crypto_op_pool == NULL)\n \t\tgoto err;\n \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",
        "v4",
        "09/26"
    ]
}