get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 11660,
    "url": "http://patches.dpdk.org/api/patches/11660/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1458681841-245648-2-git-send-email-pablo.de.lara.guarch@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": "<1458681841-245648-2-git-send-email-pablo.de.lara.guarch@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1458681841-245648-2-git-send-email-pablo.de.lara.guarch@intel.com",
    "date": "2016-03-22T21:23:59",
    "name": "[dpdk-dev,v2,1/3] l2fwd-crypto: add SNOW3G algorithms",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "1a2f314335e0bd792242199cd61e43fac4e7909d",
    "submitter": {
        "id": 9,
        "url": "http://patches.dpdk.org/api/people/9/?format=api",
        "name": "De Lara Guarch, Pablo",
        "email": "pablo.de.lara.guarch@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/1458681841-245648-2-git-send-email-pablo.de.lara.guarch@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/11660/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/11660/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 5755C5593;\n\tTue, 22 Mar 2016 22:24:27 +0100 (CET)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 79E275591\n\tfor <dev@dpdk.org>; Tue, 22 Mar 2016 22:24:25 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga103.jf.intel.com with ESMTP; 22 Mar 2016 14:24:24 -0700",
            "from sie-lab-214-036.ir.intel.com (HELO\n\tsie-lab-214-36.ir.intel.com) ([10.237.214.36])\n\tby orsmga001.jf.intel.com with ESMTP; 22 Mar 2016 14:24:15 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.24,379,1455004800\"; d=\"scan'208\";a=\"916728010\"",
        "From": "Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "declan.doherty@intel.com, Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Date": "Tue, 22 Mar 2016 21:23:59 +0000",
        "Message-Id": "<1458681841-245648-2-git-send-email-pablo.de.lara.guarch@intel.com>",
        "X-Mailer": "git-send-email 2.5.0",
        "In-Reply-To": "<1458681841-245648-1-git-send-email-pablo.de.lara.guarch@intel.com>",
        "References": "<1458652644-30754-1-git-send-email-pablo.de.lara.guarch@intel.com>\n\t<1458681841-245648-1-git-send-email-pablo.de.lara.guarch@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/3] l2fwd-crypto: add SNOW3G algorithms",
        "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": "Since SNOW3G UEA2/UIA2 are supported now by both HW and SW,\nl2fwd-crypto may use them, extending the list of algorithms\nparsed from command line.\n\nSigned-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>\n---\n examples/l2fwd-crypto/main.c | 48 +++++++++++++++++++++++++++++++++++---------\n 1 file changed, 39 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c\nindex 762d22a..2fd0778 100644\n--- a/examples/l2fwd-crypto/main.c\n+++ b/examples/l2fwd-crypto/main.c\n@@ -178,6 +178,9 @@ struct l2fwd_crypto_params {\n \tuint8_t do_cipher;\n \tuint8_t do_hash;\n \tuint8_t hash_verify;\n+\n+\tenum rte_crypto_cipher_algorithm cipher_algo;\n+\tenum rte_crypto_auth_algorithm auth_algo;\n };\n \n /** lcore configuration */\n@@ -426,8 +429,14 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,\n \t\t\t\trte_pktmbuf_pkt_len(m) - cparams->digest_length);\n \t\top->sym->auth.digest.length = cparams->digest_length;\n \n-\t\top->sym->auth.data.offset = ipdata_offset;\n-\t\top->sym->auth.data.length = data_len;\n+\t\t/* For SNOW3G algorithms, offset/length must be in bits */\n+\t\tif (cparams->auth_algo == RTE_CRYPTO_AUTH_SNOW3G_UIA2) {\n+\t\t\top->sym->auth.data.offset = ipdata_offset << 3;\n+\t\t\top->sym->auth.data.length = data_len << 3;\n+\t\t} else {\n+\t\t\top->sym->auth.data.offset = ipdata_offset;\n+\t\t\top->sym->auth.data.length = data_len;\n+\t\t}\n \n \t\tif (cparams->aad.length) {\n \t\t\top->sym->auth.aad.data = cparams->aad.data;\n@@ -441,13 +450,25 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,\n \t\top->sym->cipher.iv.phys_addr = cparams->iv.phys_addr;\n \t\top->sym->cipher.iv.length = cparams->iv.length;\n \n-\t\top->sym->cipher.data.offset = ipdata_offset;\n-\t\tif (cparams->do_hash && cparams->hash_verify)\n-\t\t\t/* Do not cipher the hash tag */\n-\t\t\top->sym->cipher.data.length = data_len -\n-\t\t\t\tcparams->digest_length;\n-\t\telse\n-\t\t\top->sym->cipher.data.length = data_len;\n+\t\t/* For SNOW3G algorithms, offset/length must be in bits */\n+\t\tif (cparams->cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2) {\n+\t\t\top->sym->cipher.data.offset = ipdata_offset << 3;\n+\t\t\tif (cparams->do_hash && cparams->hash_verify)\n+\t\t\t\t/* Do not cipher the hash tag */\n+\t\t\t\top->sym->cipher.data.length = (data_len -\n+\t\t\t\t\tcparams->digest_length) << 3;\n+\t\t\telse\n+\t\t\t\top->sym->cipher.data.length = data_len << 3;\n+\n+\t\t} else {\n+\t\t\top->sym->cipher.data.offset = ipdata_offset;\n+\t\t\tif (cparams->do_hash && cparams->hash_verify)\n+\t\t\t\t/* Do not cipher the hash tag */\n+\t\t\t\top->sym->cipher.data.length = data_len -\n+\t\t\t\t\tcparams->digest_length;\n+\t\t\telse\n+\t\t\t\top->sym->cipher.data.length = data_len;\n+\t\t}\n \t}\n \n \top->sym->m_src = m;\n@@ -630,6 +651,8 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)\n \t\t\t\tport_cparams[i].hash_verify = 1;\n \t\t\telse\n \t\t\t\tport_cparams[i].hash_verify = 0;\n+\n+\t\t\tport_cparams[i].auth_algo = options->auth_xform.auth.algo;\n \t\t}\n \n \t\tif (port_cparams[i].do_cipher) {\n@@ -640,6 +663,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)\n \t\t\t\tgenerate_random_key(port_cparams[i].iv.data,\n \t\t\t\t\t\tsizeof(port_cparams[i].iv.length));\n \n+\t\t\tport_cparams[i].cipher_algo = options->cipher_xform.cipher.algo;\n \t\t}\n \n \t\tport_cparams[i].session = initialize_crypto_session(options,\n@@ -835,6 +859,9 @@ parse_cipher_algo(enum rte_crypto_cipher_algorithm *algo, char *optarg)\n \t} else if (strcmp(\"AES_GCM\", optarg) == 0) {\n \t\t*algo = RTE_CRYPTO_CIPHER_AES_GCM;\n \t\treturn 0;\n+\t} else if (strcmp(\"SNOW3G_UEA2\", optarg) == 0) {\n+\t\t*algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2;\n+\t\treturn 0;\n \t}\n \n \tprintf(\"Cipher algorithm  not supported!\\n\");\n@@ -901,6 +928,9 @@ parse_auth_algo(enum rte_crypto_auth_algorithm *algo, char *optarg)\n \t} else if (strcmp(\"SHA512_HMAC\", optarg) == 0) {\n \t\t*algo = RTE_CRYPTO_AUTH_SHA512_HMAC;\n \t\treturn 0;\n+\t} else if (strcmp(\"SNOW3G_UIA2\", optarg) == 0) {\n+\t\t*algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2;\n+\t\treturn 0;\n \t}\n \n \tprintf(\"Authentication algorithm specified not supported!\\n\");\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "1/3"
    ]
}