get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 108832,
    "url": "https://patches.dpdk.org/api/patches/108832/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220324030036.4761-4-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": "<20220324030036.4761-4-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220324030036.4761-4-humin29@huawei.com",
    "date": "2022-03-24T03:00:35",
    "name": "[V2,3/4] app/testpmd: fix port status of slave device",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8d992f9adc1072e7f327ed485ea774da82815f4d",
    "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/20220324030036.4761-4-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 22222,
            "url": "https://patches.dpdk.org/api/series/22222/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22222",
            "date": "2022-03-24T03:00:32",
            "name": "bugfix for bonding",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/22222/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/108832/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/108832/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 CD570A0507;\n\tThu, 24 Mar 2022 04:01:41 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 72B1142818;\n\tThu, 24 Mar 2022 04:01:37 +0100 (CET)",
            "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id E4DB042816;\n Thu, 24 Mar 2022 04:01:33 +0100 (CET)",
            "from dggeme756-chm.china.huawei.com (unknown [172.30.72.54])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KP91p2jW2zfZZ0;\n Thu, 24 Mar 2022 10:59:58 +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.21; Thu, 24 Mar 2022 11:01:32 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Huisong Li <lihuisong@huawei.com>, <stable@dpdk.org>, Min Hu\n <humin29@huawei.com>, Aman Singh <aman.deep.singh@intel.com>, Xiaoyun Li\n <xiaoyun.li@intel.com>, Yuying Zhang <yuying.zhang@intel.com>, Pablo de Lara\n <pablo.de.lara.guarch@intel.com>, Bernard Iremonger\n <bernard.iremonger@intel.com>",
        "Subject": "[PATCH V2 3/4] app/testpmd: fix port status of slave device",
        "Date": "Thu, 24 Mar 2022 11:00:35 +0800",
        "Message-ID": "<20220324030036.4761-4-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20220324030036.4761-1-humin29@huawei.com>",
        "References": "<20211025063922.34066-1-humin29@huawei.com>\n <20220324030036.4761-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": "dggems706-chm.china.huawei.com (10.3.19.183) To\n dggeme756-chm.china.huawei.com (10.3.19.102)",
        "X-CFilter-Loop": "Reflected",
        "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"
    },
    "content": "From: Huisong Li <lihuisong@huawei.com>\n\nStarting or stopping a bonded port also starts or stops all active slaves\nunder the bonded port. If this port is a bonded device, we need to modify\nthe port status of all slaves.\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>\nAcked-by: Aman Singh <aman.deep.singh@intel.com>\n---\n app/test-pmd/cmdline.c |  1 +\n app/test-pmd/testpmd.c | 74 +++++++++++++++++++++++++++++++++++++++---\n app/test-pmd/testpmd.h |  3 +-\n 3 files changed, 73 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 7ab0575e64..f0efcf09f0 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -6671,6 +6671,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 fe2ce19f99..dc90600787 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -66,6 +66,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@@ -597,11 +600,57 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,\n \treturn 0;\n }\n \n+#ifdef RTE_NET_BOND\n+static int\n+change_bonding_slave_port_status(portid_t bond_pid, bool is_stop)\n+{\n+\tportid_t slave_pids[RTE_MAX_ETHPORTS];\n+\tstruct rte_port *port;\n+\tint num_slaves;\n+\tportid_t slave_pid;\n+\tint i;\n+\n+\tnum_slaves = rte_eth_bond_slaves_get(bond_pid, slave_pids,\n+\t\t\t\t\t\tRTE_MAX_ETHPORTS);\n+\tif (num_slaves < 0) {\n+\t\tfprintf(stderr, \"Failed to get slave list for port = %u\\n\",\n+\t\t\tbond_pid);\n+\t\treturn num_slaves;\n+\t}\n+\n+\tfor (i = 0; i < num_slaves; i++) {\n+\t\tslave_pid = slave_pids[i];\n+\t\tport = &ports[slave_pid];\n+\t\tport->port_status =\n+\t\t\tis_stop ? RTE_PORT_STOPPED : RTE_PORT_STARTED;\n+\t}\n+\n+\treturn 0;\n+}\n+#endif\n+\n static int\n eth_dev_start_mp(uint16_t port_id)\n {\n-\tif (is_proc_primary())\n-\t\treturn rte_eth_dev_start(port_id);\n+\tint ret;\n+\n+\tif (is_proc_primary()) {\n+\t\tret = rte_eth_dev_start(port_id);\n+\t\tif (ret != 0)\n+\t\t\treturn ret;\n+\n+#ifdef RTE_NET_BOND\n+\t\tstruct rte_port *port = &ports[port_id];\n+\n+\t\t/*\n+\t\t * Starting a bonded port also starts all slaves under the bonded\n+\t\t * device. So if this port is bond device, we need to modify the\n+\t\t * port status of these slaves.\n+\t\t */\n+\t\tif (port->bond_flag == 1)\n+\t\t\treturn change_bonding_slave_port_status(port_id, false);\n+#endif\n+\t}\n \n \treturn 0;\n }\n@@ -609,8 +658,25 @@ eth_dev_start_mp(uint16_t port_id)\n static int\n eth_dev_stop_mp(uint16_t port_id)\n {\n-\tif (is_proc_primary())\n-\t\treturn rte_eth_dev_stop(port_id);\n+\tint ret;\n+\n+\tif (is_proc_primary()) {\n+\t\tret = rte_eth_dev_stop(port_id);\n+\t\tif (ret != 0)\n+\t\t\treturn ret;\n+\n+#ifdef RTE_NET_BOND\n+\t\tstruct rte_port *port = &ports[port_id];\n+\n+\t\t/*\n+\t\t * Stopping a bonded port also stops all slaves under the bonded\n+\t\t * device. So if this port is bond device, we need to modify the\n+\t\t * port status of these slaves.\n+\t\t */\n+\t\tif (port->bond_flag == 1)\n+\t\t\treturn change_bonding_slave_port_status(port_id, true);\n+#endif\n+\t}\n \n \treturn 0;\n }\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 31f766c965..67f253b30e 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -266,7 +266,8 @@ struct rte_port {\n \tuint32_t                mc_addr_nb; /**< nb. of addr. in mc_addr_pool */\n \tqueueid_t               queue_nb; /**< nb. of queues for flow rules */\n \tuint32_t                queue_sz; /**< size of a queue for flow rules */\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_template    *pattern_templ_list; /**< Pattern templates. */\n \tstruct port_template    *actions_templ_list; /**< Actions templates. */\n \tstruct port_table       *table_list; /**< Flow tables. */\n",
    "prefixes": [
        "V2",
        "3/4"
    ]
}