get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 11567,
    "url": "http://patches.dpdk.org/api/patches/11567/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1458238145-7496-4-git-send-email-thomas.monjalon@6wind.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": "<1458238145-7496-4-git-send-email-thomas.monjalon@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1458238145-7496-4-git-send-email-thomas.monjalon@6wind.com",
    "date": "2016-03-17T18:09:00",
    "name": "[dpdk-dev,v11,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://patches.dpdk.org/api/people/1/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas.monjalon@6wind.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/1458238145-7496-4-git-send-email-thomas.monjalon@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/11567/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/11567/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 9ABFC5937;\n\tThu, 17 Mar 2016 19:10:53 +0100 (CET)",
            "from mail-wm0-f50.google.com (mail-wm0-f50.google.com\n\t[74.125.82.50]) by dpdk.org (Postfix) with ESMTP id BB4B2590B\n\tfor <dev@dpdk.org>; Thu, 17 Mar 2016 19:10:46 +0100 (CET)",
            "by mail-wm0-f50.google.com with SMTP id l68so5498609wml.1\n\tfor <dev@dpdk.org>; Thu, 17 Mar 2016 11:10:46 -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\tu14sm31196179wmu.8.2016.03.17.11.10.44\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tThu, 17 Mar 2016 11:10:46 -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=yk6pfiVvblTnvAsL1nJ79vnm5iZ1BFr4wUADDMutrM9r5GHJD9GIg6fmEz6PWS7qdT\n\tK7gjtrgvdADBRYfdbU4Xc9WkaYA0By5p4fJ56ZhFVgicN8oruQ9QB8lEd4dnj/wEz88G\n\tHtnE6s/eM4h9CXZ8RFqGsMoEs6LvgSBesPe7lMdfkzViKY4he7I9EccuGitJK7K+Saqh\n\tyQ4H2Dtoma3IBz0RyEVimqAYbjfZypD1eBlLKOuHENAJi1Zu4ICIj0LV3DgjfekBHe+y\n\tXRZn6iJlP9kVJw4Xk5ujMnAV1wEKhnJyamGm2EpVmOynWILYlDN3gav00Sxs2SGgZmcY\n\tk9QA==",
        "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=kyH2IUfcdSeLtgWT3qkxxiZiIp+lSboH82t8PkPWMyIurdLC20N9EXmNE9bIygLayV\n\tz7vh39l1+Ip0nnYOkkO3tt5xi4hgcHhYJnufKjYjxPv2XsvcGhLQH/wQ6gEQzQjjq0cA\n\tayKgwxn7g0LJKccM6gc6TVuZRWO/P6KPUdPlTYvSxYHga6rjbsYmhYZOirRDRF4g1tUI\n\tKJElBzhv5iaYALQUOZH5pOAhNUtiOUEsXBjzQqeCkEn+RH6bN5eOH9Qfc6sPbYqgdr5I\n\tmxQTV+U6mCeXXFtbfE+lzBwmxH6aPAvkVvyzdHQq79DJQ3yeycAbQDzLKCzFnHcr6QUE\n\t0Yzw==",
        "X-Gm-Message-State": "AD7BkJLhC1upnt5h169iGwbR8PM5WRtITPEhcriJ+51IDxIcRObd6f75QAE7swhKAn/9hwvf",
        "X-Received": "by 10.194.82.66 with SMTP id g2mr11317781wjy.161.1458238246564; \n\tThu, 17 Mar 2016 11:10:46 -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": "Thu, 17 Mar 2016 19:09:00 +0100",
        "Message-Id": "<1458238145-7496-4-git-send-email-thomas.monjalon@6wind.com>",
        "X-Mailer": "git-send-email 2.7.0",
        "In-Reply-To": "<1458238145-7496-1-git-send-email-thomas.monjalon@6wind.com>",
        "References": "<1457992546-32230-1-git-send-email-thomas.monjalon@6wind.com>\n\t<1458238145-7496-1-git-send-email-thomas.monjalon@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v11 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",
        "v11",
        "3/8"
    ]
}