get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 102736,
    "url": "https://patches.dpdk.org/api/patches/102736/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211025063922.34066-2-humin29@huawei.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20211025063922.34066-2-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211025063922.34066-2-humin29@huawei.com",
    "date": "2021-10-25T06:39:20",
    "name": "[1/3] app/testpmd: fix port status of active slave device",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "e4530cebcfaa5a75482e4afe071f397e76ecdf36",
    "submitter": {
        "id": 1944,
        "url": "https://patches.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20211025063922.34066-2-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 19942,
            "url": "https://patches.dpdk.org/api/series/19942/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19942",
            "date": "2021-10-25T06:39:19",
            "name": "bugfix for testpmd",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/19942/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/102736/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/102736/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B1983A0C47;\n\tMon, 25 Oct 2021 08:41:33 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 222BB41125;\n\tMon, 25 Oct 2021 08:41:24 +0200 (CEST)",
            "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id 2D339410DB\n for <dev@dpdk.org>; Mon, 25 Oct 2021 08:41:20 +0200 (CEST)",
            "from dggeme756-chm.china.huawei.com (unknown [172.30.72.54])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Hd4x22wXfzbhJs;\n Mon, 25 Oct 2021 14:36:38 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n 15.1.2308.15; Mon, 25 Oct 2021 14:41:15 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <thomas@monjalon.net>, <xiaoyun.li@intel.com>",
        "Date": "Mon, 25 Oct 2021 14:39:20 +0800",
        "Message-ID": "<20211025063922.34066-2-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20211025063922.34066-1-humin29@huawei.com>",
        "References": "<20211025063922.34066-1-humin29@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-ClientProxiedBy": "dggems702-chm.china.huawei.com (10.3.19.179) To\n dggeme756-chm.china.huawei.com (10.3.19.102)",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH 1/3] app/testpmd: fix port status of active slave\n device",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Huisong Li <lihuisong@huawei.com>\n\nStopping a bond device also stops all active slaves under the bond device.\nIf this port is bond device, we need to modify the port status of all\nslaves from RTE_PORT_STARTED to RTE_PORT_STOPPED.\n\nFixes: 0e545d3047fe (\"app/testpmd: check stopping port is not in bonding\")\nCc: stable@dpdk.org\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n app/test-pmd/cmdline.c |  1 +\n app/test-pmd/testpmd.c | 49 +++++++++++++++++++++++++++++++++++++++---\n app/test-pmd/testpmd.h |  3 ++-\n 3 files changed, 49 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 722f4fb9d9..5bfb4b509b 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -6639,6 +6639,7 @@ static void cmd_create_bonded_device_parsed(void *parsed_result,\n \t\t\t\t\"Failed to enable promiscuous mode for port %u: %s - ignore\\n\",\n \t\t\t\tport_id, rte_strerror(-ret));\n \n+\t\tports[port_id].bond_flag = 1;\n \t\tports[port_id].need_setup = 0;\n \t\tports[port_id].port_status = RTE_PORT_STOPPED;\n \t}\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex af0e79fe6d..d6b9ebc4dd 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -65,6 +65,9 @@\n #ifdef RTE_EXEC_ENV_WINDOWS\n #include <process.h>\n #endif\n+#ifdef RTE_NET_BOND\n+#include <rte_eth_bond.h>\n+#endif\n \n #include \"testpmd.h\"\n \n@@ -2986,6 +2989,35 @@ start_port(portid_t pid)\n \treturn 0;\n }\n \n+#ifdef RTE_NET_BOND\n+static void\n+change_bonding_active_slave_port_status(portid_t bond_pid)\n+{\n+\tportid_t slave_pids[RTE_MAX_ETHPORTS];\n+\tstruct rte_port *port;\n+\tint num_active_slaves;\n+\tportid_t slave_pid;\n+\tint i;\n+\n+\tnum_active_slaves = rte_eth_bond_active_slaves_get(bond_pid, slave_pids,\n+\t\t\t\t\t\t\t   RTE_MAX_ETHPORTS);\n+\tif (num_active_slaves < 0) {\n+\t\tfprintf(stderr, \"Failed to get slave list for port = %u\\n\",\n+\t\t\tbond_pid);\n+\t\treturn;\n+\t}\n+\n+\tfor (i = 0; i < num_active_slaves; i++) {\n+\t\tslave_pid = slave_pids[i];\n+\t\tport = &ports[slave_pid];\n+\t\tif (rte_atomic16_cmpset(&(port->port_status),\n+\t\t\tRTE_PORT_STARTED, RTE_PORT_STOPPED) == 0)\n+\t\t\tfprintf(stderr, \"Port %u can not be set into stopped\\n\",\n+\t\t\t\tslave_pid);\n+\t}\n+}\n+#endif\n+\n void\n stop_port(portid_t pid)\n {\n@@ -3042,9 +3074,20 @@ stop_port(portid_t pid)\n \t\tif (port->flow_list)\n \t\t\tport_flow_flush(pi);\n \n-\t\tif (eth_dev_stop_mp(pi) != 0)\n-\t\t\tRTE_LOG(ERR, EAL, \"rte_eth_dev_stop failed for port %u\\n\",\n-\t\t\t\tpi);\n+\t\tif (is_proc_primary()) {\n+#ifdef RTE_NET_BOND\n+\t\t\t/*\n+\t\t\t * Stopping a bond device also stops all active slaves\n+\t\t\t * under the bond device. If this port is bond device,\n+\t\t\t * we need to modify the port status of all slaves.\n+\t\t\t */\n+\t\t\tif (port->bond_flag == 1)\n+\t\t\t\tchange_bonding_active_slave_port_status(pi);\n+#endif\n+\t\t\tif (rte_eth_dev_stop(pi) != 0)\n+\t\t\t\tRTE_LOG(ERR, EAL, \"rte_eth_dev_stop failed for port %u\\n\",\n+\t\t\t\t\tpi);\n+\t\t}\n \n \t\tif (rte_atomic16_cmpset(&(port->port_status),\n \t\t\tRTE_PORT_HANDLING, RTE_PORT_STOPPED) == 0)\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex e3995d24ab..ad3b4f875c 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -237,7 +237,8 @@ struct rte_port {\n \tstruct rte_eth_txconf   tx_conf[RTE_MAX_QUEUES_PER_PORT+1]; /**< per queue tx configuration */\n \tstruct rte_ether_addr   *mc_addr_pool; /**< pool of multicast addrs */\n \tuint32_t                mc_addr_nb; /**< nb. of addr. in mc_addr_pool */\n-\tuint8_t                 slave_flag; /**< bonding slave port */\n+\tuint8_t                 slave_flag : 1, /**< bonding slave port */\n+\t\t\t\tbond_flag : 1; /**< port is bond device */\n \tstruct port_flow        *flow_list; /**< Associated flows. */\n \tstruct port_indirect_action *actions_list;\n \t/**< Associated indirect actions. */\n",
    "prefixes": [
        "1/3"
    ]
}