get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 26087,
    "url": "http://patches.dpdk.org/api/patches/26087/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1498817556-64379-5-git-send-email-wei.dai@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": "<1498817556-64379-5-git-send-email-wei.dai@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1498817556-64379-5-git-send-email-wei.dai@intel.com",
    "date": "2017-06-30T10:12:36",
    "name": "[dpdk-dev,v5,4/4] app/testpmd: enhance command to test NIC reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "aa297526c812f7ae01389cdaad2fb5af2193e2ea",
    "submitter": {
        "id": 490,
        "url": "http://patches.dpdk.org/api/people/490/?format=api",
        "name": "Wei Dai",
        "email": "wei.dai@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/1498817556-64379-5-git-send-email-wei.dai@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/26087/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/26087/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 ABE467CAB;\n\tFri, 30 Jun 2017 12:23:01 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 331255323\n\tfor <dev@dpdk.org>; Fri, 30 Jun 2017 12:22:54 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t30 Jun 2017 03:22:53 -0700",
            "from dpdk6.bj.intel.com ([172.16.182.81])\n\tby fmsmga001.fm.intel.com with ESMTP; 30 Jun 2017 03:22:52 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.40,286,1496127600\"; d=\"scan'208\";\n\ta=\"1166574194\"",
        "From": "Wei Dai <wei.dai@intel.com>",
        "To": "thomas@monjalon.net, wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, \n\tjingjing.wu@intel.com, helin.zhang@intel.com, yuan.peng@intel.com",
        "Cc": "dev@dpdk.org,\n\tWei Dai <wei.dai@intel.com>",
        "Date": "Fri, 30 Jun 2017 18:12:36 +0800",
        "Message-Id": "<1498817556-64379-5-git-send-email-wei.dai@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1498817556-64379-1-git-send-email-wei.dai@intel.com>",
        "References": "<1498748282-69914-1-git-send-email-wei.dai@intel.com>\n\t<1498817556-64379-1-git-send-email-wei.dai@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 4/4] app/testpmd: enhance command to test NIC\n\treset",
        "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": "When PF is reset, a message will show it and all its\nVF need to be reset.\nUser can run the command \"port reset port_id\"\nto reset the VF port and to keep same port id without\nany configuration. Then user can run \"port stop port_id\"\nand \"port start port_id\" to reconfigure its forwarding\nmode and parmaters as previous ones.\nTo avoid crash, current forwarding should be stopped\nbefore running \"port reset port_id\".\n\nSigned-off-by: Wei Dai <wei.dai@intel.com>\nTested-by: Yuan Peng <yuan.peng@intel.com>\nAcked-by: Jingjing Wu <jingjing.wu@intel.com>\n---\n app/test-pmd/cmdline.c | 10 +++++++---\n app/test-pmd/testpmd.c | 44 +++++++++++++++++++++++++++++++++++++++++---\n app/test-pmd/testpmd.h |  1 +\n 3 files changed, 49 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex ff8ffd2..58ba6e4 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -950,6 +950,8 @@ static void cmd_operate_port_parsed(void *parsed_result,\n \t\tstop_port(RTE_PORT_ALL);\n \telse if (!strcmp(res->name, \"close\"))\n \t\tclose_port(RTE_PORT_ALL);\n+\telse if (!strcmp(res->name, \"reset\"))\n+\t\treset_port(RTE_PORT_ALL);\n \telse\n \t\tprintf(\"Unknown parameter\\n\");\n }\n@@ -959,7 +961,7 @@ cmdline_parse_token_string_t cmd_operate_port_all_cmd =\n \t\t\t\t\t\t\t\t\"port\");\n cmdline_parse_token_string_t cmd_operate_port_all_port =\n \tTOKEN_STRING_INITIALIZER(struct cmd_operate_port_result, name,\n-\t\t\t\t\t\t\"start#stop#close\");\n+\t\t\t\t\t\t\"start#stop#close#reset\");\n cmdline_parse_token_string_t cmd_operate_port_all_all =\n \tTOKEN_STRING_INITIALIZER(struct cmd_operate_port_result, value, \"all\");\n \n@@ -994,6 +996,8 @@ static void cmd_operate_specific_port_parsed(void *parsed_result,\n \t\tstop_port(res->value);\n \telse if (!strcmp(res->name, \"close\"))\n \t\tclose_port(res->value);\n+\telse if (!strcmp(res->name, \"reset\"))\n+\t\treset_port(res->value);\n \telse\n \t\tprintf(\"Unknown parameter\\n\");\n }\n@@ -1003,7 +1007,7 @@ cmdline_parse_token_string_t cmd_operate_specific_port_cmd =\n \t\t\t\t\t\t\tkeyword, \"port\");\n cmdline_parse_token_string_t cmd_operate_specific_port_port =\n \tTOKEN_STRING_INITIALIZER(struct cmd_operate_specific_port_result,\n-\t\t\t\t\t\tname, \"start#stop#close\");\n+\t\t\t\t\t\tname, \"start#stop#close#reset\");\n cmdline_parse_token_num_t cmd_operate_specific_port_id =\n \tTOKEN_NUM_INITIALIZER(struct cmd_operate_specific_port_result,\n \t\t\t\t\t\t\tvalue, UINT8);\n@@ -1011,7 +1015,7 @@ cmdline_parse_token_num_t cmd_operate_specific_port_id =\n cmdline_parse_inst_t cmd_operate_specific_port = {\n \t.f = cmd_operate_specific_port_parsed,\n \t.data = NULL,\n-\t.help_str = \"port start|stop|close <port_id>: Start/Stop/Close port_id\",\n+\t.help_str = \"port start|stop|close|reset <port_id>: Start/Stop/Close/Reset port_id\",\n \t.tokens = {\n \t\t(void *)&cmd_operate_specific_port_cmd,\n \t\t(void *)&cmd_operate_specific_port_port,\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex b29328a..17eaa31 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -1424,9 +1424,6 @@ start_port(portid_t pid)\n \n \t\tif (port->need_reconfig > 0) {\n \t\t\tport->need_reconfig = 0;\n-\n-\t\t\tprintf(\"Configuring Port %d (socket %u)\\n\", pi,\n-\t\t\t\t\tport->socket_id);\n \t\t\t/* configure port */\n \t\t\tdiag = rte_eth_dev_configure(pi, nb_rxq, nb_txq,\n \t\t\t\t\t\t&(port->dev_conf));\n@@ -1665,6 +1662,47 @@ close_port(portid_t pid)\n }\n \n void\n+reset_port(portid_t pid)\n+{\n+\tint diag;\n+\tportid_t pi;\n+\tstruct rte_port *port;\n+\n+\tif (port_id_is_invalid(pid, ENABLED_WARN))\n+\t\treturn;\n+\n+\tprintf(\"Resetting ports...\\n\");\n+\n+\tRTE_ETH_FOREACH_DEV(pi) {\n+\t\tif (pid != pi && pid != (portid_t)RTE_PORT_ALL)\n+\t\t\tcontinue;\n+\n+\t\tif (port_is_forwarding(pi) != 0 && test_done == 0) {\n+\t\t\tprintf(\"Please remove port %d from forwarding \"\n+\t\t\t       \"configuration.\\n\", pi);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tif (port_is_bonding_slave(pi)) {\n+\t\t\tprintf(\"Please remove port %d from bonded device.\\n\",\n+\t\t\t       pi);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tdiag = rte_eth_dev_reset(pi);\n+\t\tif (diag == 0) {\n+\t\t\tport = &ports[pi];\n+\t\t\tport->need_reconfig = 1;\n+\t\t\tport->need_reconfig_queues = 1;\n+\t\t} else {\n+\t\t\tprintf(\"Failed to reset port %d. diag=%d\\n\", pi, diag);\n+\t\t}\n+\t}\n+\n+\tprintf(\"Done\\n\");\n+}\n+\n+void\n attach_port(char *identifier)\n {\n \tportid_t pi = 0;\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 364502d..e4c704a 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -596,6 +596,7 @@ int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode,\n int start_port(portid_t pid);\n void stop_port(portid_t pid);\n void close_port(portid_t pid);\n+void reset_port(portid_t pid);\n void attach_port(char *identifier);\n void detach_port(uint8_t port_id);\n int all_ports_stopped(void);\n",
    "prefixes": [
        "dpdk-dev",
        "v5",
        "4/4"
    ]
}