Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/120479/?format=api
http://patches.dpdk.org/api/patches/120479/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221206092649.8287-5-lihuisong@huawei.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": "<20221206092649.8287-5-lihuisong@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20221206092649.8287-5-lihuisong@huawei.com", "date": "2022-12-06T09:26:48", "name": "[V4,4/5] app/testpmd: add attach and detach port for multiple process", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "75e0f7ceecc09de08777bd1c515e003c3d013e4d", "submitter": { "id": 2085, "url": "http://patches.dpdk.org/api/people/2085/?format=api", "name": "lihuisong (C)", "email": "lihuisong@huawei.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221206092649.8287-5-lihuisong@huawei.com/mbox/", "series": [ { "id": 26009, "url": "http://patches.dpdk.org/api/series/26009/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26009", "date": "2022-12-06T09:26:44", "name": "app/testpmd: support mulitple process attach and detach port", "version": 4, "mbox": "http://patches.dpdk.org/series/26009/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/120479/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/120479/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 BC9CCA0543;\n\tTue, 6 Dec 2022 10:29:49 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CFFDA42686;\n\tTue, 6 Dec 2022 10:29:46 +0100 (CET)", "from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255])\n by mails.dpdk.org (Postfix) with ESMTP id 6F7CB40156\n for <dev@dpdk.org>; Tue, 6 Dec 2022 10:29:44 +0100 (CET)", "from kwepemm600004.china.huawei.com (unknown [172.30.72.55])\n by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NRFTy3MJmz15N6b;\n Tue, 6 Dec 2022 17:28:54 +0800 (CST)", "from localhost.localdomain (10.28.79.22) by\n kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2375.31; Tue, 6 Dec 2022 17:29:24 +0800" ], "From": "Huisong Li <lihuisong@huawei.com>", "To": "<dev@dpdk.org>, <andrew.rybchenko@oktetlabs.ru>", "CC": "<thomas@monjalon.net>, <ferruh.yigit@amd.com>, <liudongdong3@huawei.com>,\n <huangdaode@huawei.com>, <fengchengwen@huawei.com>, <lihuisong@huawei.com>", "Subject": "[PATCH V4 4/5] app/testpmd: add attach and detach port for multiple\n process", "Date": "Tue, 6 Dec 2022 17:26:48 +0800", "Message-ID": "<20221206092649.8287-5-lihuisong@huawei.com>", "X-Mailer": "git-send-email 2.22.0", "In-Reply-To": "<20221206092649.8287-1-lihuisong@huawei.com>", "References": "<20220825024425.10534-1-lihuisong@huawei.com>\n <20221206092649.8287-1-lihuisong@huawei.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[10.28.79.22]", "X-ClientProxiedBy": "dggems704-chm.china.huawei.com (10.3.19.181) To\n kwepemm600004.china.huawei.com (7.193.23.242)", "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": "This patch supports attach and detach port in primary and secondary\nprocess.\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nSigned-off-by: Dongdong Liu <liudongdong3@huawei.com>\n---\n app/test-pmd/testpmd.c | 38 ++++++++++++++++-----------\n app/test-pmd/testpmd.h | 1 -\n drivers/net/bonding/bonding_testpmd.c | 1 -\n 3 files changed, 22 insertions(+), 18 deletions(-)", "diff": "diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex bc25703490..2e6329c853 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -3463,15 +3463,12 @@ attach_port(char *identifier)\n \t\treturn;\n \t}\n \n-\t/* first attach mode: event */\n-\tif (setup_on_probe_event) {\n-\t\t/* new ports are detected on RTE_ETH_EVENT_NEW event */\n-\t\tfor (pi = 0; pi < RTE_MAX_ETHPORTS; pi++)\n-\t\t\tif (ports[pi].port_status == RTE_PORT_HANDLING &&\n-\t\t\t\t\tports[pi].need_setup != 0)\n-\t\t\t\tsetup_attached_port(pi);\n+\t/*\n+\t * first attach mode: event, setting up attached port is done in\n+\t * probing callback.\n+\t */\n+\tif (setup_on_probe_event)\n \t\treturn;\n-\t}\n \n \t/* second attach mode: iterator */\n \tRTE_ETH_FOREACH_MATCHING_DEV(pi, identifier, &iterator) {\n@@ -3502,7 +3499,6 @@ setup_attached_port(portid_t pi)\n \tports_ids[nb_ports++] = pi;\n \tfwd_ports_ids[nb_fwd_ports++] = pi;\n \tnb_cfg_ports = nb_fwd_ports;\n-\tports[pi].need_setup = 0;\n \tports[pi].port_status = RTE_PORT_STOPPED;\n \n \tprintf(\"Port %d is attached. Now total ports is %d\\n\", pi, nb_ports);\n@@ -3536,10 +3532,8 @@ detach_device(struct rte_device *dev)\n \t\tTESTPMD_LOG(ERR, \"Failed to detach device %s\\n\", rte_dev_name(dev));\n \t\treturn;\n \t}\n-\tremove_invalid_ports();\n \n \tprintf(\"Device is detached\\n\");\n-\tprintf(\"Now total ports is %d\\n\", nb_ports);\n \tprintf(\"Done\\n\");\n \treturn;\n }\n@@ -3606,11 +3600,9 @@ detach_devargs(char *identifier)\n \t\treturn;\n \t}\n \n-\tremove_invalid_ports();\n-\n \tprintf(\"Device %s is detached\\n\", identifier);\n-\tprintf(\"Now total ports is %d\\n\", nb_ports);\n \tprintf(\"Done\\n\");\n+\n \trte_devargs_reset(&da);\n }\n \n@@ -3774,11 +3766,22 @@ rmv_port_callback(void *arg)\n \t\tstruct rte_device *device = dev_info.device;\n \t\tclose_port(port_id);\n \t\tdetach_device(device); /* might be already removed or have more ports */\n+\t\tremove_invalid_ports();\n+\t\tprintf(\"Now total ports is %d\\n\", nb_ports);\n \t}\n \tif (need_to_start)\n \t\tstart_packet_forwarding(0);\n }\n \n+static void\n+remove_invalid_ports_callback(void *arg)\n+{\n+\tRTE_SET_USED(arg);\n+\n+\tremove_invalid_ports();\n+\tprintf(\"Now total ports is %d\\n\", nb_ports);\n+}\n+\n /* This function is used by the interrupt thread */\n static int\n eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param,\n@@ -3803,8 +3806,8 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param,\n \n \tswitch (type) {\n \tcase RTE_ETH_EVENT_NEW:\n-\t\tports[port_id].need_setup = 1;\n-\t\tports[port_id].port_status = RTE_PORT_HANDLING;\n+\t\tif (setup_on_probe_event)\n+\t\t\tsetup_attached_port(port_id);\n \t\tbreak;\n \tcase RTE_ETH_EVENT_INTR_RMV:\n \t\tif (rte_eal_alarm_set(100000,\n@@ -3815,6 +3818,9 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param,\n \tcase RTE_ETH_EVENT_DESTROY:\n \t\tports[port_id].port_status = RTE_PORT_CLOSED;\n \t\tprintf(\"Port %u is closed\\n\", port_id);\n+\t\tif (rte_eal_alarm_set(100000, remove_invalid_ports_callback,\n+\t\t\t(void *)(intptr_t)port_id))\n+\t\t\tfprintf(stderr, \"Could not set up deferred device released\\n\");\n \t\tbreak;\n \tcase RTE_ETH_EVENT_RX_AVAIL_THRESH: {\n \t\tuint16_t rxq_id;\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 7d24d25970..080d3a1139 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -306,7 +306,6 @@ struct rte_port {\n \tuint16_t tx_vlan_id;/**< The tag ID */\n \tuint16_t tx_vlan_id_outer;/**< The outer tag ID */\n \tvolatile uint16_t port_status; /**< port started or not */\n-\tuint8_t need_setup; /**< port just attached */\n \tuint8_t need_reconfig; /**< need reconfiguring port or not */\n \tuint8_t need_reconfig_queues; /**< need reconfiguring queues or not */\n \tuint8_t rss_flag; /**< enable rss or not */\ndiff --git a/drivers/net/bonding/bonding_testpmd.c b/drivers/net/bonding/bonding_testpmd.c\nindex 9529e16fb6..9216271314 100644\n--- a/drivers/net/bonding/bonding_testpmd.c\n+++ b/drivers/net/bonding/bonding_testpmd.c\n@@ -765,7 +765,6 @@ static void cmd_create_bonded_device_parsed(void *parsed_result,\n \n \tports[port_id].update_conf = 1;\n \tports[port_id].bond_flag = 1;\n-\tports[port_id].need_setup = 0;\n \tports[port_id].port_status = RTE_PORT_STOPPED;\n }\n \n", "prefixes": [ "V4", "4/5" ] }{ "id": 120479, "url": "