Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/106651/?format=api
https://patches.dpdk.org/api/patches/106651/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220128022533.44249-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": "<20220128022533.44249-2-humin29@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220128022533.44249-2-humin29@huawei.com", "date": "2022-01-28T02:25:32", "name": "[1/2] net/bonding: fix promiscuous and allmulticast state", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "36a04401eda4d1cd6b02c9da74d3661efaa84bc9", "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/20220128022533.44249-2-humin29@huawei.com/mbox/", "series": [ { "id": 21407, "url": "https://patches.dpdk.org/api/series/21407/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=21407", "date": "2022-01-28T02:25:31", "name": "bugfix for bonding", "version": 1, "mbox": "https://patches.dpdk.org/series/21407/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/106651/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/106651/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 BA7A9A00C4;\n\tFri, 28 Jan 2022 03:25:28 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1106F42805;\n\tFri, 28 Jan 2022 03:25:24 +0100 (CET)", "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id D2DF342761\n for <dev@dpdk.org>; Fri, 28 Jan 2022 03:25:21 +0100 (CET)", "from dggeme756-chm.china.huawei.com (unknown [172.30.72.55])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4JlLrD0SM4zcct3;\n Fri, 28 Jan 2022 10:24:28 +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; Fri, 28 Jan 2022 10:25:19 +0800" ], "From": "\"Min Hu (Connor)\" <humin29@huawei.com>", "To": "<dev@dpdk.org>", "CC": "<ferruh.yigit@intel.com>, <thomas@monjalon.net>", "Subject": "[PATCH 1/2] net/bonding: fix promiscuous and allmulticast state", "Date": "Fri, 28 Jan 2022 10:25:32 +0800", "Message-ID": "<20220128022533.44249-2-humin29@huawei.com>", "X-Mailer": "git-send-email 2.33.0", "In-Reply-To": "<20220128022533.44249-1-humin29@huawei.com>", "References": "<20220128022533.44249-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": "dggems704-chm.china.huawei.com (10.3.19.181) 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": "Currently, promiscuous or allmulticast state of bonding port will not be\npassed to the new primary slave when active/standby switchover. It causes\nbugs in some scenario.\n\nFor example, promiscuous state of bonding port is off now, primary slave\n(called A) is off but secondary slave(called B) is on. Then active/standby\nswitchover, promiscuous state of the bonding port is off, but the new\nprimary slave turns to be B and its promiscuous state is still on. It is\nnot consistent with bonding port. And this patch will fix it.\n\nFixes: 2efb58cbab6e (\"bond: new link bonding library\")\nFixes: 68218b87c184 (\"net/bonding: prefer allmulti to promiscuous for LACP\")\nCc: stable@dpdk.org\n\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n drivers/net/bonding/rte_eth_bond_pmd.c | 70 ++++++++++++++++++++++++++\n 1 file changed, 70 insertions(+)", "diff": "diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex c72fc64806..ba587e60bf 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -2691,6 +2691,39 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)\n \treturn ret;\n }\n \n+static int\n+bond_ethdev_promiscuous_update(struct rte_eth_dev *dev)\n+{\n+\tstruct bond_dev_private *internals = dev->data->dev_private;\n+\tuint16_t port_id = internals->current_primary_port;\n+\n+\tswitch (internals->mode) {\n+\tcase BONDING_MODE_ROUND_ROBIN:\n+\tcase BONDING_MODE_BALANCE:\n+\tcase BONDING_MODE_BROADCAST:\n+\tcase BONDING_MODE_8023AD:\n+\t\t/* As promiscuous mode is propagated to all slaves for these\n+\t\t * mode, no need to update for bonding device.\n+\t\t */\n+\t\tbreak;\n+\tcase BONDING_MODE_ACTIVE_BACKUP:\n+\tcase BONDING_MODE_TLB:\n+\tcase BONDING_MODE_ALB:\n+\tdefault:\n+\t\t/* As promiscuous mode is propagated only to primary slave\n+\t\t * for these mode. When active/standby switchover, promiscuous\n+\t\t * mode should be set to new primary slave according to bonding\n+\t\t * device.\n+\t\t */\n+\t\tif (rte_eth_promiscuous_get(internals->port_id) == 1)\n+\t\t\trte_eth_promiscuous_enable(port_id);\n+\t\telse\n+\t\t\trte_eth_promiscuous_disable(port_id);\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev)\n {\n@@ -2804,6 +2837,39 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)\n \treturn ret;\n }\n \n+static int\n+bond_ethdev_allmulticast_update(struct rte_eth_dev *dev)\n+{\n+\tstruct bond_dev_private *internals = dev->data->dev_private;\n+\tuint16_t port_id = internals->current_primary_port;\n+\n+\tswitch (internals->mode) {\n+\tcase BONDING_MODE_ROUND_ROBIN:\n+\tcase BONDING_MODE_BALANCE:\n+\tcase BONDING_MODE_BROADCAST:\n+\tcase BONDING_MODE_8023AD:\n+\t\t/* As allmulticast mode is propagated to all slaves for these\n+\t\t * mode, no need to update for bonding device.\n+\t\t */\n+\t\tbreak;\n+\tcase BONDING_MODE_ACTIVE_BACKUP:\n+\tcase BONDING_MODE_TLB:\n+\tcase BONDING_MODE_ALB:\n+\tdefault:\n+\t\t/* As allmulticast mode is propagated only to primary slave\n+\t\t * for these mode. When active/standby switchover, allmulticast\n+\t\t * mode should be set to new primary slave according to bonding\n+\t\t * device.\n+\t\t */\n+\t\tif (rte_eth_allmulticast_get(internals->port_id) == 1)\n+\t\t\trte_eth_allmulticast_enable(port_id);\n+\t\telse\n+\t\t\trte_eth_allmulticast_disable(port_id);\n+\t}\n+\n+\treturn 0;\n+}\n+\n static void\n bond_ethdev_delayed_lsc_propagation(void *arg)\n {\n@@ -2893,6 +2959,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,\n \t\t\tlsc_flag = 1;\n \n \t\t\tmac_address_slaves_update(bonded_eth_dev);\n+\t\t\tbond_ethdev_promiscuous_update(bonded_eth_dev);\n+\t\t\tbond_ethdev_allmulticast_update(bonded_eth_dev);\n \t\t}\n \n \t\tactivate_slave(bonded_eth_dev, port_id);\n@@ -2922,6 +2990,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,\n \t\t\telse\n \t\t\t\tinternals->current_primary_port = internals->primary_port;\n \t\t\tmac_address_slaves_update(bonded_eth_dev);\n+\t\t\tbond_ethdev_promiscuous_update(bonded_eth_dev);\n+\t\t\tbond_ethdev_allmulticast_update(bonded_eth_dev);\n \t\t}\n \t}\n \n", "prefixes": [ "1/2" ] }{ "id": 106651, "url": "