Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/132400/?format=api
https://patches.dpdk.org/api/patches/132400/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20231008064620.2539225-3-huangdengdui@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": "<20231008064620.2539225-3-huangdengdui@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20231008064620.2539225-3-huangdengdui@huawei.com", "date": "2023-10-08T06:46:20", "name": "[v4,2/2] app/testpmd: add flush all multicast MAC address command", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "ea203a83cb7d75539059835723790d9837cecb24", "submitter": { "id": 3066, "url": "https://patches.dpdk.org/api/people/3066/?format=api", "name": "huangdengdui", "email": "huangdengdui@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/20231008064620.2539225-3-huangdengdui@huawei.com/mbox/", "series": [ { "id": 29764, "url": "https://patches.dpdk.org/api/series/29764/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29764", "date": "2023-10-08T06:46:19", "name": "[v4,1/2] app/testpmd: fix help string", "version": 4, "mbox": "https://patches.dpdk.org/series/29764/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/132400/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/132400/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 CED5C41B71;\n\tSun, 8 Oct 2023 08:46:42 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4A45040647;\n\tSun, 8 Oct 2023 08:46:27 +0200 (CEST)", "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 24CFB402D4\n for <dev@dpdk.org>; Sun, 8 Oct 2023 08:46:23 +0200 (CEST)", "from dggpeml500011.china.huawei.com (unknown [172.30.72.53])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S3CLG5jchzrStC;\n Sun, 8 Oct 2023 14:43:50 +0800 (CST)", "from localhost.huawei.com (10.50.163.32) by\n dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.31; Sun, 8 Oct 2023 14:46:20 +0800" ], "From": "Dengdui Huang <huangdengdui@huawei.com>", "To": "<dev@dpdk.org>", "CC": "<stephen@networkplumber.org>, <ferruh.yigit@amd.com>,\n <fengchengwen@huawei.com>, <aman.deep.singh@intel.com>,\n <yuying.zhang@intel.com>, <anatoly.burakov@intel.com>,\n <liuyonglong@huawei.com>", "Subject": "[PATCH v4 2/2] app/testpmd: add flush all multicast MAC address\n command", "Date": "Sun, 8 Oct 2023 14:46:20 +0800", "Message-ID": "<20231008064620.2539225-3-huangdengdui@huawei.com>", "X-Mailer": "git-send-email 2.33.0", "In-Reply-To": "<20231008064620.2539225-1-huangdengdui@huawei.com>", "References": "<20230801024304.2187484-1-huangdengdui@huawei.com>\n <20231008064620.2539225-1-huangdengdui@huawei.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[10.50.163.32]", "X-ClientProxiedBy": "dggems706-chm.china.huawei.com (10.3.19.183) To\n dggpeml500011.china.huawei.com (7.185.36.84)", "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": "Add command to flush all multicast MAC address\nUsage:\n mcast_addr flush <port_id> :\n flush all multicast MAC address on port_id\n\nSigned-off-by: Dengdui Huang <huangdengdui@huawei.com>\nAcked-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n app/test-pmd/cmdline.c | 43 +++++++++++++++++++++\n app/test-pmd/config.c | 18 +++++++++\n app/test-pmd/testpmd.h | 1 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 ++++\n 4 files changed, 69 insertions(+)", "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex b934f61be7..45bfedd394 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -522,6 +522,9 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"mcast_addr remove (port_id) (mcast_addr)\\n\"\n \t\t\t\" Remove a multicast MAC address from port_id.\\n\\n\"\n \n+\t\t\t\"mcast_addr flush (port_id)\\n\"\n+\t\t\t\" Flush all multicast MAC addresses on port_id.\\n\\n\"\n+\n \t\t\t\"set flow_ctrl rx (on|off) tx (on|off) (high_water)\"\n \t\t\t\" (low_water) (pause_time) (send_xon) mac_ctrl_frame_fwd\"\n \t\t\t\" (on|off) autoneg (on|off) (port_id)\\n\"\n@@ -8567,6 +8570,45 @@ static cmdline_parse_inst_t cmd_mcast_addr = {\n \t},\n };\n \n+/* *** FLUSH MULTICAST MAC ADDRESS ON PORT *** */\n+struct cmd_mcast_addr_flush_result {\n+\tcmdline_fixed_string_t mcast_addr_cmd;\n+\tcmdline_fixed_string_t what;\n+\tuint16_t port_num;\n+};\n+\n+static void cmd_mcast_addr_flush_parsed(void *parsed_result,\n+\t\t__rte_unused struct cmdline *cl,\n+\t\t__rte_unused void *data)\n+{\n+\tstruct cmd_mcast_addr_flush_result *res = parsed_result;\n+\n+\tmcast_addr_flush(res->port_num);\n+}\n+\n+static cmdline_parse_token_string_t cmd_mcast_addr_flush_cmd =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_mcast_addr_result,\n+\t\t\t\t mcast_addr_cmd, \"mcast_addr\");\n+static cmdline_parse_token_string_t cmd_mcast_addr_flush_what =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_mcast_addr_result, what,\n+\t\t\t\t \"flush\");\n+static cmdline_parse_token_num_t cmd_mcast_addr_flush_portnum =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_mcast_addr_result, port_num,\n+\t\t\t\t RTE_UINT16);\n+\n+static cmdline_parse_inst_t cmd_mcast_addr_flush = {\n+\t.f = cmd_mcast_addr_flush_parsed,\n+\t.data = (void *)0,\n+\t.help_str = \"mcast_addr flush <port_id> : \"\n+\t\t\"flush all multicast MAC addresses on port_id\",\n+\t.tokens = {\n+\t\t(void *)&cmd_mcast_addr_flush_cmd,\n+\t\t(void *)&cmd_mcast_addr_flush_what,\n+\t\t(void *)&cmd_mcast_addr_flush_portnum,\n+\t\tNULL,\n+\t},\n+};\n+\n /* vf vlan anti spoof configuration */\n \n /* Common result structure for vf vlan anti spoof */\n@@ -12935,6 +12977,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_set_port_meter_stats_mask,\n \t(cmdline_parse_inst_t *)&cmd_show_port_meter_stats,\n \t(cmdline_parse_inst_t *)&cmd_mcast_addr,\n+\t(cmdline_parse_inst_t *)&cmd_mcast_addr_flush,\n \t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_anti_spoof,\n \t(cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof,\n \t(cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 709864bb44..7034fa125b 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -6829,6 +6829,24 @@ mcast_addr_remove(portid_t port_id, struct rte_ether_addr *mc_addr)\n \t\tmcast_addr_pool_append(port, mc_addr);\n }\n \n+void\n+mcast_addr_flush(portid_t port_id)\n+{\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tret = rte_eth_dev_set_mc_addr_list(port_id, NULL, 0);\n+\tif (ret != 0) {\n+\t\tfprintf(stderr,\n+\t\t\t\"Failed to flush all multicast MAC addresses on port_id %u\\n\",\n+\t\t\tport_id);\n+\t\treturn;\n+\t}\n+\tmcast_addr_pool_destroy(port_id);\n+}\n+\n void\n port_dcb_info_display(portid_t port_id)\n {\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex e236845a81..6457ac4c0a 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -1181,6 +1181,7 @@ void show_mcast_macs(portid_t port_id);\n /* Functions to manage the set of filtered Multicast MAC addresses */\n void mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr);\n void mcast_addr_remove(portid_t port_id, struct rte_ether_addr *mc_addr);\n+void mcast_addr_flush(portid_t port_id);\n void port_dcb_info_display(portid_t port_id);\n \n uint8_t *open_file(const char *file_path, uint32_t *size);\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex e6d218caaa..7a40980d6c 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -1323,6 +1323,13 @@ filtered by port::\n \n testpmd> mcast_addr remove (port_id) (mcast_addr)\n \n+mcast_addr flush\n+~~~~~~~~~~~~~~~~\n+\n+Flush all multicast MAC addresses on port_id::\n+\n+ testpmd> mcast_addr flush (port_id)\n+\n mac_addr add (for VF)\n ~~~~~~~~~~~~~~~~~~~~~\n \n", "prefixes": [ "v4", "2/2" ] }{ "id": 132400, "url": "