get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43212,
    "url": "http://patchwork.dpdk.org/api/patches/43212/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20180719083959.41480-6-pablo.de.lara.guarch@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20180719083959.41480-6-pablo.de.lara.guarch@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180719083959.41480-6-pablo.de.lara.guarch@intel.com",
    "date": "2018-07-19T08:39:59",
    "name": "[v2,5/5] examples/l2fwd-crypto: remove duplicated capability check",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8e9de49ec161d85822dcbf1d40319b7d0af4df3d",
    "submitter": {
        "id": 9,
        "url": "http://patchwork.dpdk.org/api/people/9/?format=api",
        "name": "De Lara Guarch, Pablo",
        "email": "pablo.de.lara.guarch@intel.com"
    },
    "delegate": {
        "id": 22,
        "url": "http://patchwork.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": "http://patchwork.dpdk.org/project/dpdk/patch/20180719083959.41480-6-pablo.de.lara.guarch@intel.com/mbox/",
    "series": [
        {
            "id": 677,
            "url": "http://patchwork.dpdk.org/api/series/677/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=677",
            "date": "2018-07-19T08:39:54",
            "name": "L2fwd-crypto fixes",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/677/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/43212/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/43212/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id EEDDC5B3A;\n\tThu, 19 Jul 2018 18:47:04 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 657DC160\n\tfor <dev@dpdk.org>; Thu, 19 Jul 2018 18:46:59 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Jul 2018 09:46:58 -0700",
            "from silpixa00399466.ir.intel.com (HELO\n\tsilpixa00399466.ger.corp.intel.com) ([10.237.223.220])\n\tby fmsmga006.fm.intel.com with ESMTP; 19 Jul 2018 09:46:15 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,375,1526367600\"; d=\"scan'208\";a=\"247109929\"",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "To": "declan.doherty@intel.com,\n\tfiona.trahe@intel.com",
        "Cc": "dev@dpdk.org,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Date": "Thu, 19 Jul 2018 09:39:59 +0100",
        "Message-Id": "<20180719083959.41480-6-pablo.de.lara.guarch@intel.com>",
        "X-Mailer": "git-send-email 2.14.4",
        "In-Reply-To": "<20180719083959.41480-1-pablo.de.lara.guarch@intel.com>",
        "References": "<20180717103815.26841-1-pablo.de.lara.guarch@intel.com>\n\t<20180719083959.41480-1-pablo.de.lara.guarch@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 5/5] examples/l2fwd-crypto: remove duplicated\n\tcapability check",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Now that device capabilities are checked separately,\nbefore setting the xform parameters, it is not required\nto do the check again, leaving only the xform setting\nwith the device configuration.\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n examples/l2fwd-crypto/main.c | 233 +++++++++----------------------------------\n 1 file changed, 45 insertions(+), 188 deletions(-)",
    "diff": "diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c\nindex 273c852f1..ef3302545 100644\n--- a/examples/l2fwd-crypto/main.c\n+++ b/examples/l2fwd-crypto/main.c\n@@ -2304,22 +2304,11 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,\n \n \t\t/* Set AEAD parameters */\n \t\tif (options->xform_chain == L2FWD_CRYPTO_AEAD) {\n-\t\t\t/* Check if device supports AEAD algo */\n \t\t\tcap = check_device_support_aead_algo(options, &dev_info,\n \t\t\t\t\t\t\tcdev_id);\n-\t\t\tif (cap == NULL)\n-\t\t\t\tcontinue;\n \n \t\t\toptions->block_size = cap->sym.aead.block_size;\n \n-\t\t\tif (check_iv_param(&cap->sym.aead.iv_size,\n-\t\t\t\t\toptions->aead_iv_param,\n-\t\t\t\t\toptions->aead_iv_random_size,\n-\t\t\t\t\toptions->aead_iv.length) < 0) {\n-\t\t\t\tprintf(\"Unsupported IV length\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\n \t\t\t/* Set IV if not provided from command line */\n \t\t\tif (options->aead_iv_param == 0) {\n \t\t\t\tif (options->aead_iv_random_size != -1)\n@@ -2331,93 +2320,41 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,\n \t\t\t\t\t\tcap->sym.aead.iv_size.min;\n \t\t\t}\n \n-\t\t\t/*\n-\t\t\t * Check if length of provided AEAD key is supported\n-\t\t\t * by the algorithm chosen.\n-\t\t\t */\n-\t\t\tif (options->aead_key_param) {\n-\t\t\t\tif (check_supported_size(\n-\t\t\t\t\t\toptions->aead_xform.aead.key.length,\n-\t\t\t\t\t\tcap->sym.aead.key_size.min,\n-\t\t\t\t\t\tcap->sym.aead.key_size.max,\n-\t\t\t\t\t\tcap->sym.aead.key_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported aead key length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n-\t\t\t/*\n-\t\t\t * Check if length of the aead key to be randomly generated\n-\t\t\t * is supported by the algorithm chosen.\n-\t\t\t */\n-\t\t\t} else if (options->aead_key_random_size != -1) {\n-\t\t\t\tif (check_supported_size(options->aead_key_random_size,\n-\t\t\t\t\t\tcap->sym.aead.key_size.min,\n-\t\t\t\t\t\tcap->sym.aead.key_size.max,\n-\t\t\t\t\t\tcap->sym.aead.key_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported aead key length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n-\t\t\t\toptions->aead_xform.aead.key.length =\n-\t\t\t\t\t\t\toptions->aead_key_random_size;\n-\t\t\t/* No size provided, use minimum size. */\n-\t\t\t} else\n-\t\t\t\toptions->aead_xform.aead.key.length =\n+\t\t\t/* Set key if not provided from command line */\n+\t\t\tif (options->aead_key_param == 0) {\n+\t\t\t\tif (options->aead_key_random_size != -1)\n+\t\t\t\t\toptions->aead_xform.aead.key.length =\n+\t\t\t\t\t\toptions->aead_key_random_size;\n+\t\t\t\t/* No size provided, use minimum size. */\n+\t\t\t\telse\n+\t\t\t\t\toptions->aead_xform.aead.key.length =\n \t\t\t\t\t\tcap->sym.aead.key_size.min;\n \n-\t\t\tif (!options->aead_key_param)\n \t\t\t\tgenerate_random_key(\n \t\t\t\t\toptions->aead_xform.aead.key.data,\n \t\t\t\t\toptions->aead_xform.aead.key.length);\n+\t\t\t}\n \n-\t\t\t/*\n-\t\t\t * Check if length of provided AAD is supported\n-\t\t\t * by the algorithm chosen.\n-\t\t\t */\n-\t\t\tif (options->aad_param) {\n-\t\t\t\tif (check_supported_size(options->aad.length,\n-\t\t\t\t\t\tcap->sym.aead.aad_size.min,\n-\t\t\t\t\t\tcap->sym.aead.aad_size.max,\n-\t\t\t\t\t\tcap->sym.aead.aad_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported AAD length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n-\t\t\t/*\n-\t\t\t * Check if length of AAD to be randomly generated\n-\t\t\t * is supported by the algorithm chosen.\n-\t\t\t */\n-\t\t\t} else if (options->aad_random_size != -1) {\n-\t\t\t\tif (check_supported_size(options->aad_random_size,\n-\t\t\t\t\t\tcap->sym.aead.aad_size.min,\n-\t\t\t\t\t\tcap->sym.aead.aad_size.max,\n-\t\t\t\t\t\tcap->sym.aead.aad_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported AAD length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n-\t\t\t\toptions->aad.length = options->aad_random_size;\n-\t\t\t/* No size provided, use minimum size. */\n-\t\t\t} else\n-\t\t\t\toptions->aad.length = cap->sym.auth.aad_size.min;\n+\t\t\t/* Set AAD if not provided from command line */\n+\t\t\tif (options->aad_param == 0) {\n+\t\t\t\tif (options->aad_random_size != -1)\n+\t\t\t\t\toptions->aad.length =\n+\t\t\t\t\t\toptions->aad_random_size;\n+\t\t\t\t/* No size provided, use minimum size. */\n+\t\t\t\telse\n+\t\t\t\t\toptions->aad.length =\n+\t\t\t\t\t\tcap->sym.auth.aad_size.min;\n+\t\t\t}\n \n \t\t\toptions->aead_xform.aead.aad_length =\n \t\t\t\t\t\toptions->aad.length;\n \n-\t\t\t/* Check if digest size is supported by the algorithm. */\n-\t\t\tif (options->digest_size != -1) {\n-\t\t\t\tif (check_supported_size(options->digest_size,\n-\t\t\t\t\t\tcap->sym.aead.digest_size.min,\n-\t\t\t\t\t\tcap->sym.aead.digest_size.max,\n-\t\t\t\t\t\tcap->sym.aead.digest_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported digest length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n+\t\t\t/* Set digest size if not provided from command line */\n+\t\t\tif (options->digest_size != -1)\n \t\t\t\toptions->aead_xform.aead.digest_length =\n \t\t\t\t\t\t\toptions->digest_size;\n-\t\t\t/* No size provided, use minimum size. */\n-\t\t\t} else\n+\t\t\t\t/* No size provided, use minimum size. */\n+\t\t\telse\n \t\t\t\toptions->aead_xform.aead.digest_length =\n \t\t\t\t\t\tcap->sym.aead.digest_size.min;\n \t\t}\n@@ -2426,22 +2363,10 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,\n \t\tif (options->xform_chain == L2FWD_CRYPTO_CIPHER_HASH ||\n \t\t\t\toptions->xform_chain == L2FWD_CRYPTO_HASH_CIPHER ||\n \t\t\t\toptions->xform_chain == L2FWD_CRYPTO_CIPHER_ONLY) {\n-\t\t\t/* Check if device supports cipher algo */\n \t\t\tcap = check_device_support_cipher_algo(options, &dev_info,\n \t\t\t\t\t\t\tcdev_id);\n-\t\t\tif (cap == NULL)\n-\t\t\t\tcontinue;\n-\n \t\t\toptions->block_size = cap->sym.cipher.block_size;\n \n-\t\t\tif (check_iv_param(&cap->sym.cipher.iv_size,\n-\t\t\t\t\toptions->cipher_iv_param,\n-\t\t\t\t\toptions->cipher_iv_random_size,\n-\t\t\t\t\toptions->cipher_iv.length) < 0) {\n-\t\t\t\tprintf(\"Unsupported IV length\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\n \t\t\t/* Set IV if not provided from command line */\n \t\t\tif (options->cipher_iv_param == 0) {\n \t\t\t\tif (options->cipher_iv_random_size != -1)\n@@ -2453,64 +2378,28 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,\n \t\t\t\t\t\tcap->sym.cipher.iv_size.min;\n \t\t\t}\n \n-\t\t\t/*\n-\t\t\t * Check if length of provided cipher key is supported\n-\t\t\t * by the algorithm chosen.\n-\t\t\t */\n-\t\t\tif (options->ckey_param) {\n-\t\t\t\tif (check_supported_size(\n-\t\t\t\t\t\toptions->cipher_xform.cipher.key.length,\n-\t\t\t\t\t\tcap->sym.cipher.key_size.min,\n-\t\t\t\t\t\tcap->sym.cipher.key_size.max,\n-\t\t\t\t\t\tcap->sym.cipher.key_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported cipher key length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n-\t\t\t/*\n-\t\t\t * Check if length of the cipher key to be randomly generated\n-\t\t\t * is supported by the algorithm chosen.\n-\t\t\t */\n-\t\t\t} else if (options->ckey_random_size != -1) {\n-\t\t\t\tif (check_supported_size(options->ckey_random_size,\n-\t\t\t\t\t\tcap->sym.cipher.key_size.min,\n-\t\t\t\t\t\tcap->sym.cipher.key_size.max,\n-\t\t\t\t\t\tcap->sym.cipher.key_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported cipher key length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n-\t\t\t\toptions->cipher_xform.cipher.key.length =\n-\t\t\t\t\t\t\toptions->ckey_random_size;\n-\t\t\t/* No size provided, use minimum size. */\n-\t\t\t} else\n-\t\t\t\toptions->cipher_xform.cipher.key.length =\n+\t\t\t/* Set key if not provided from command line */\n+\t\t\tif (options->ckey_param == 0) {\n+\t\t\t\tif (options->ckey_random_size != -1)\n+\t\t\t\t\toptions->cipher_xform.cipher.key.length =\n+\t\t\t\t\t\toptions->ckey_random_size;\n+\t\t\t\t/* No size provided, use minimum size. */\n+\t\t\t\telse\n+\t\t\t\t\toptions->cipher_xform.cipher.key.length =\n \t\t\t\t\t\tcap->sym.cipher.key_size.min;\n \n-\t\t\tif (!options->ckey_param)\n \t\t\t\tgenerate_random_key(\n \t\t\t\t\toptions->cipher_xform.cipher.key.data,\n \t\t\t\t\toptions->cipher_xform.cipher.key.length);\n-\n+\t\t\t}\n \t\t}\n \n \t\t/* Set auth parameters */\n \t\tif (options->xform_chain == L2FWD_CRYPTO_CIPHER_HASH ||\n \t\t\t\toptions->xform_chain == L2FWD_CRYPTO_HASH_CIPHER ||\n \t\t\t\toptions->xform_chain == L2FWD_CRYPTO_HASH_ONLY) {\n-\t\t\t/* Check if device supports auth algo */\n \t\t\tcap = check_device_support_auth_algo(options, &dev_info,\n \t\t\t\t\t\t\tcdev_id);\n-\t\t\tif (cap == NULL)\n-\t\t\t\tcontinue;\n-\n-\t\t\tif (check_iv_param(&cap->sym.auth.iv_size,\n-\t\t\t\t\toptions->auth_iv_param,\n-\t\t\t\t\toptions->auth_iv_random_size,\n-\t\t\t\t\toptions->auth_iv.length) < 0) {\n-\t\t\t\tprintf(\"Unsupported IV length\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n \n \t\t\t/* Set IV if not provided from command line */\n \t\t\tif (options->auth_iv_param == 0) {\n@@ -2523,59 +2412,27 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,\n \t\t\t\t\t\tcap->sym.auth.iv_size.min;\n \t\t\t}\n \n-\t\t\t/*\n-\t\t\t * Check if length of provided auth key is supported\n-\t\t\t * by the algorithm chosen.\n-\t\t\t */\n-\t\t\tif (options->akey_param) {\n-\t\t\t\tif (check_supported_size(\n-\t\t\t\t\t\toptions->auth_xform.auth.key.length,\n-\t\t\t\t\t\tcap->sym.auth.key_size.min,\n-\t\t\t\t\t\tcap->sym.auth.key_size.max,\n-\t\t\t\t\t\tcap->sym.auth.key_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported auth key length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n-\t\t\t/*\n-\t\t\t * Check if length of the auth key to be randomly generated\n-\t\t\t * is supported by the algorithm chosen.\n-\t\t\t */\n-\t\t\t} else if (options->akey_random_size != -1) {\n-\t\t\t\tif (check_supported_size(options->akey_random_size,\n-\t\t\t\t\t\tcap->sym.auth.key_size.min,\n-\t\t\t\t\t\tcap->sym.auth.key_size.max,\n-\t\t\t\t\t\tcap->sym.auth.key_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported auth key length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n-\t\t\t\toptions->auth_xform.auth.key.length =\n-\t\t\t\t\t\t\toptions->akey_random_size;\n-\t\t\t/* No size provided, use minimum size. */\n-\t\t\t} else\n-\t\t\t\toptions->auth_xform.auth.key.length =\n+\t\t\t/* Set key if not provided from command line */\n+\t\t\tif (options->akey_param == 0) {\n+\t\t\t\tif (options->akey_random_size != -1)\n+\t\t\t\t\toptions->auth_xform.auth.key.length =\n+\t\t\t\t\t\toptions->akey_random_size;\n+\t\t\t\t/* No size provided, use minimum size. */\n+\t\t\t\telse\n+\t\t\t\t\toptions->auth_xform.auth.key.length =\n \t\t\t\t\t\tcap->sym.auth.key_size.min;\n \n-\t\t\tif (!options->akey_param)\n \t\t\t\tgenerate_random_key(\n \t\t\t\t\toptions->auth_xform.auth.key.data,\n \t\t\t\t\toptions->auth_xform.auth.key.length);\n+\t\t\t}\n \n-\t\t\t/* Check if digest size is supported by the algorithm. */\n-\t\t\tif (options->digest_size != -1) {\n-\t\t\t\tif (check_supported_size(options->digest_size,\n-\t\t\t\t\t\tcap->sym.auth.digest_size.min,\n-\t\t\t\t\t\tcap->sym.auth.digest_size.max,\n-\t\t\t\t\t\tcap->sym.auth.digest_size.increment)\n-\t\t\t\t\t\t\t!= 0) {\n-\t\t\t\t\tprintf(\"Unsupported digest length\\n\");\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n+\t\t\t/* Set digest size if not provided from command line */\n+\t\t\tif (options->digest_size != -1)\n \t\t\t\toptions->auth_xform.auth.digest_length =\n \t\t\t\t\t\t\toptions->digest_size;\n-\t\t\t/* No size provided, use minimum size. */\n-\t\t\t} else\n+\t\t\t\t/* No size provided, use minimum size. */\n+\t\t\telse\n \t\t\t\toptions->auth_xform.auth.digest_length =\n \t\t\t\t\t\tcap->sym.auth.digest_size.min;\n \t\t}\n",
    "prefixes": [
        "v2",
        "5/5"
    ]
}