From: Huisong Li <lihuisong@huawei.com>
To: <stable@dpdk.org>, <christian.ehrhardt@canonical.com>
Cc: <liudongdong3@huawei.com>, <fengchengwen@huawei.com>,
<huangdaode@huawei.com>, <haijie1@huawei.com>,
<lihuisong@huawei.com>
Subject: [PATCH 19.11 4/4] net/bonding: fix stopping non-active slaves
Date: Tue, 19 Jul 2022 10:49:19 +0800 [thread overview]
Message-ID: <20220719024919.16999-5-lihuisong@huawei.com> (raw)
In-Reply-To: <20220719024919.16999-1-lihuisong@huawei.com>
[ upstream commit f5e72e8e8d57b331baf1a86d15eb7fae921f57fb ]
When stopping a bonded port, all slaves should be stopped. But only active
slaves are stopped.
So fix by stopping all slave ports and later do "deactivate_slave()" for
active slaves.
Fixes: 0911d4ec0183 ("net/bonding: fix crash when stopping mode 4 port")
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 5b1507e817..191c821b46 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2089,13 +2089,14 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
internals->link_status_polling_enabled = 0;
for (i = 0; i < internals->slave_count; i++) {
uint16_t slave_id = internals->slaves[i].port_id;
+
+ internals->slaves[i].last_link_status = 0;
+ rte_eth_dev_stop(slave_id);
+ /* active slaves need to be deactivated. */
if (find_slave_by_id(internals->active_slaves,
internals->active_slave_count, slave_id) !=
- internals->active_slave_count) {
- internals->slaves[i].last_link_status = 0;
- rte_eth_dev_stop(slave_id);
+ internals->active_slave_count)
deactivate_slave(eth_dev, slave_id);
- }
}
}
--
2.22.0
next prev parent reply other threads:[~2022-07-19 2:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 2:49 [PATCH 19.11 0/4] backporting some bonding bugfix and RSS display Huisong Li
2022-07-19 2:49 ` [PATCH 19.11 1/4] app/testpmd: fix port status of bonding slave device Huisong Li
2022-07-19 2:49 ` [PATCH 19.11 2/4] app/testpmd: fix bonding slave devices not released Huisong Li
2022-07-19 2:49 ` [PATCH 19.11 3/4] app/testpmd: fix supported RSS offload display Huisong Li
2022-07-19 2:49 ` Huisong Li [this message]
2022-08-03 9:55 ` [PATCH 19.11 0/4] backporting some bonding bugfix and RSS display Christian Ehrhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220719024919.16999-5-lihuisong@huawei.com \
--to=lihuisong@huawei.com \
--cc=christian.ehrhardt@canonical.com \
--cc=fengchengwen@huawei.com \
--cc=haijie1@huawei.com \
--cc=huangdaode@huawei.com \
--cc=liudongdong3@huawei.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).