get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 11508,
    "url": "http://patchwork.dpdk.org/api/patches/11508/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1457992546-32230-4-git-send-email-thomas.monjalon@6wind.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": "<1457992546-32230-4-git-send-email-thomas.monjalon@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1457992546-32230-4-git-send-email-thomas.monjalon@6wind.com",
    "date": "2016-03-14T21:55:41",
    "name": "[dpdk-dev,v10,3/8] app/testpmd: move speed and duplex parsing in a function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "decea1e9b746b31a0f9c170a95c5763484c3fa14",
    "submitter": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/people/1/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas.monjalon@6wind.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1457992546-32230-4-git-send-email-thomas.monjalon@6wind.com/mbox/",
    "series": [],
    "comments": "http://patchwork.dpdk.org/api/patches/11508/comments/",
    "check": "pending",
    "checks": "http://patchwork.dpdk.org/api/patches/11508/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 351E75586;\n\tMon, 14 Mar 2016 22:57:26 +0100 (CET)",
            "from mail-wm0-f42.google.com (mail-wm0-f42.google.com\n\t[74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 2CEA7532D\n\tfor <dev@dpdk.org>; Mon, 14 Mar 2016 22:57:23 +0100 (CET)",
            "by mail-wm0-f42.google.com with SMTP id l68so1691170wml.1\n\tfor <dev@dpdk.org>; Mon, 14 Mar 2016 14:57:23 -0700 (PDT)",
            "from XPS13.localdomain (91.111.75.86.rev.sfr.net. [86.75.111.91])\n\tby smtp.gmail.com with ESMTPSA id\n\tw133sm17918804wmd.3.2016.03.14.14.57.21\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tMon, 14 Mar 2016 14:57:22 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=lSVs61pCMQ/wFls67TAF1DH7PI6inQ6cSPpGdfTzcFQ=;\n\tb=Osg65I2kGUS0twJ3b5QU0H9ZwW3caUUXvwAjTMOqkpGmuUM0JRYlwHiGSRcY53QpeT\n\t3EIR/b+4mbEbK7FUI19m02rtZxxCnFZ14PHCfkDVkm5SMGjaUB3iy7KzkWxM98a9mP9B\n\tDlA/l1TKefpvUSfh+fR5YJyVZ1nZy+17PPWJCd2oWpAk1kk507hry+Rr1fJpSFVetoaL\n\tV8mSLNvkoLJdmAGxws1aY+L2Acr7TLNsZVAOwcsWZC+ewU08JLTa3bf/ZpAEvnpFD1M+\n\tQbg2QtQAVR/afUayal2LbEDdmAFZelsz5Zo/R36qR6vJk+aZ27xZXIhEEVXtUX77J763\n\tUSrw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=lSVs61pCMQ/wFls67TAF1DH7PI6inQ6cSPpGdfTzcFQ=;\n\tb=WqRszOgqpvUByul3L/zLE0O1Wf6H0WbpFHOarhZASEuQ5UfK9qQd0GIJNgxpFKj0Db\n\tuOpo+lywGInl12RwGYJNJkl6yF22cUXjNZv36NFZr4vtw8F5fJUxOg4TfbgVA4Psg1RX\n\t5i0CENr4M+gzftueMKDqdtThthr5g+v3zgym7lzydRoln/MQiuevyy2vxNprTNVvCf0s\n\tKLb5+3xZOEHyscNGyLR75DYSubEKExl2dOTDbxfOiyiYenQdg/T0wPDSHa64KQ+mrw5r\n\tIIsWpW5BWngAEaBUuMDVZJEJtvRbYHkSKlaKaJ7bw8jsNMGw+roIn9ybZsMHDhNp2DVj\n\tBQPQ==",
        "X-Gm-Message-State": "AD7BkJLZ+SU6jiGBp1azuG+yewec7RkkYlD84X2TcYCHxmYpK8Nql+Lqed22lx8vyvHAPLgj",
        "X-Received": "by 10.194.185.144 with SMTP id\n\tfc16mr26745142wjc.123.1457992643060; \n\tMon, 14 Mar 2016 14:57:23 -0700 (PDT)",
        "From": "Thomas Monjalon <thomas.monjalon@6wind.com>",
        "To": "marcdevel@gmail.com, bruce.richardson@intel.com, declan.doherty@intel.com,\n\tkonstantin.ananyev@intel.com, wenzhuo.lu@intel.com,\n\thelin.zhang@intel.com, jing.d.chen@intel.com, harish.patil@qlogic.com,\n\trahul.lakkireddy@chelsio.com, johndale@cisco.com, vido@cesnet.cz,\n\tadrien.mazarguil@6wind.com, alejandro.lucero@netronome.com",
        "Cc": "dev@dpdk.org",
        "Date": "Mon, 14 Mar 2016 22:55:41 +0100",
        "Message-Id": "<1457992546-32230-4-git-send-email-thomas.monjalon@6wind.com>",
        "X-Mailer": "git-send-email 2.7.0",
        "In-Reply-To": "<1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com>",
        "References": "<1456793151-1475-1-git-send-email-marcdevel@gmail.com>\n\t<1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v10 3/8] app/testpmd: move speed and duplex\n\tparsing in a function",
        "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": "From: Marc Sune <marcdevel@gmail.com>\n\nThe code for checking and parsing speed/duplex was duplicated.\nThe new function is also checking the speed/duplex combination.\n\nSigned-off-by: Marc Sune <marcdevel@gmail.com>\n---\n app/test-pmd/cmdline.c | 99 ++++++++++++++++++++++++--------------------------\n 1 file changed, 47 insertions(+), 52 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 9d52b8c..37be5cd 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -983,6 +983,49 @@ struct cmd_config_speed_all {\n \tcmdline_fixed_string_t value2;\n };\n \n+static int\n+parse_and_check_speed_duplex(char *speedstr, char *duplexstr, uint16_t *speed)\n+{\n+\n+\tint duplex;\n+\n+\tif (!strcmp(duplexstr, \"half\")) {\n+\t\tduplex = ETH_LINK_HALF_DUPLEX;\n+\t} else if (!strcmp(duplexstr, \"full\")) {\n+\t\tduplex = ETH_LINK_FULL_DUPLEX;\n+\t} else if (!strcmp(duplexstr, \"auto\")) {\n+\t\tduplex = ETH_LINK_FULL_DUPLEX;\n+\t} else {\n+\t\tprintf(\"Unknown duplex parameter\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\tif (!strcmp(speedstr, \"10\")) {\n+\t\t*speed = ETH_LINK_SPEED_10;\n+\t} else if (!strcmp(speedstr, \"100\")) {\n+\t\t*speed = ETH_LINK_SPEED_100;\n+\t} else {\n+\t\tif (duplex != ETH_LINK_FULL_DUPLEX) {\n+\t\t\tprintf(\"Invalid speed/duplex parameters\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\tif (!strcmp(speedstr, \"1000\")) {\n+\t\t\t*speed = ETH_LINK_SPEED_1000;\n+\t\t} else if (!strcmp(speedstr, \"10000\")) {\n+\t\t\t*speed = ETH_LINK_SPEED_10G;\n+\t\t} else if (!strcmp(speedstr, \"40000\")) {\n+\t\t\t*speed = ETH_LINK_SPEED_40G;\n+\t\t} else if (!strcmp(speedstr, \"auto\")) {\n+\t\t\t*speed = ETH_LINK_SPEED_AUTONEG;\n+\t\t} else {\n+\t\t\tprintf(\"Unknown speed parameter\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n static void\n cmd_config_speed_all_parsed(void *parsed_result,\n \t\t\t__attribute__((unused)) struct cmdline *cl,\n@@ -998,33 +1041,9 @@ cmd_config_speed_all_parsed(void *parsed_result,\n \t\treturn;\n \t}\n \n-\tif (!strcmp(res->value1, \"10\"))\n-\t\tlink_speed = ETH_LINK_SPEED_10;\n-\telse if (!strcmp(res->value1, \"100\"))\n-\t\tlink_speed = ETH_LINK_SPEED_100;\n-\telse if (!strcmp(res->value1, \"1000\"))\n-\t\tlink_speed = ETH_LINK_SPEED_1000;\n-\telse if (!strcmp(res->value1, \"10000\"))\n-\t\tlink_speed = ETH_LINK_SPEED_10G;\n-\telse if (!strcmp(res->value1, \"40000\"))\n-\t\tlink_speed = ETH_LINK_SPEED_40G;\n-\telse if (!strcmp(res->value1, \"auto\"))\n-\t\tlink_speed = ETH_LINK_SPEED_AUTONEG;\n-\telse {\n-\t\tprintf(\"Unknown parameter\\n\");\n+\tif (parse_and_check_speed_duplex(res->value1, res->value2,\n+\t\t\t&link_speed) < 0)\n \t\treturn;\n-\t}\n-\n-\tif (!strcmp(res->value2, \"half\"))\n-\t\tlink_duplex = ETH_LINK_HALF_DUPLEX;\n-\telse if (!strcmp(res->value2, \"full\"))\n-\t\tlink_duplex = ETH_LINK_FULL_DUPLEX;\n-\telse if (!strcmp(res->value2, \"auto\"))\n-\t\tlink_duplex = ETH_LINK_AUTONEG_DUPLEX;\n-\telse {\n-\t\tprintf(\"Unknown parameter\\n\");\n-\t\treturn;\n-\t}\n \n \tFOREACH_PORT(pid, ports) {\n \t\tports[pid].dev_conf.link_speed = link_speed;\n@@ -1097,33 +1116,9 @@ cmd_config_speed_specific_parsed(void *parsed_result,\n \tif (port_id_is_invalid(res->id, ENABLED_WARN))\n \t\treturn;\n \n-\tif (!strcmp(res->value1, \"10\"))\n-\t\tlink_speed = ETH_LINK_SPEED_10;\n-\telse if (!strcmp(res->value1, \"100\"))\n-\t\tlink_speed = ETH_LINK_SPEED_100;\n-\telse if (!strcmp(res->value1, \"1000\"))\n-\t\tlink_speed = ETH_LINK_SPEED_1000;\n-\telse if (!strcmp(res->value1, \"10000\"))\n-\t\tlink_speed = ETH_LINK_SPEED_10000;\n-\telse if (!strcmp(res->value1, \"40000\"))\n-\t\tlink_speed = ETH_LINK_SPEED_40G;\n-\telse if (!strcmp(res->value1, \"auto\"))\n-\t\tlink_speed = ETH_LINK_SPEED_AUTONEG;\n-\telse {\n-\t\tprintf(\"Unknown parameter\\n\");\n-\t\treturn;\n-\t}\n-\n-\tif (!strcmp(res->value2, \"half\"))\n-\t\tlink_duplex = ETH_LINK_HALF_DUPLEX;\n-\telse if (!strcmp(res->value2, \"full\"))\n-\t\tlink_duplex = ETH_LINK_FULL_DUPLEX;\n-\telse if (!strcmp(res->value2, \"auto\"))\n-\t\tlink_duplex = ETH_LINK_AUTONEG_DUPLEX;\n-\telse {\n-\t\tprintf(\"Unknown parameter\\n\");\n+\tif (parse_and_check_speed_duplex(res->value1, res->value2,\n+\t\t\t&link_speed) < 0)\n \t\treturn;\n-\t}\n \n \tports[res->id].dev_conf.link_speed = link_speed;\n \tports[res->id].dev_conf.link_duplex = link_duplex;\n",
    "prefixes": [
        "dpdk-dev",
        "v10",
        "3/8"
    ]
}