DPDK patches and discussions
 help / color / mirror / Atom feed
From: "humin (Q)" <humin29@huawei.com>
To: wangyunjian <wangyunjian@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "chas3@att.com" <chas3@att.com>,
	Huangshaozhang <huangshaozhang@huawei.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: 答复: [dpdk-dev] [PATCH] net/bonding: fix double get slave link status
Date: Wed, 20 Jul 2022 06:39:44 +0000	[thread overview]
Message-ID: <781607bf0fe0426f9d5882a7b88ccd13@huawei.com> (raw)
In-Reply-To: <598d08fa7e4da0ba42ba21ed3461ead4f6f9d23f.1657710002.git.wangyunjian@huawei.com>

Acked-by: Min Hu (Connor) <humin29@huawei.com>

-----邮件原件-----
发件人: wangyunjian <wangyunjian@huawei.com> 
发送时间: 2022年7月13日 19:11
收件人: dev@dpdk.org
抄送: chas3@att.com; humin (Q) <humin29@huawei.com>; Huangshaozhang <huangshaozhang@huawei.com>; wangyunjian <wangyunjian@huawei.com>; stable@dpdk.org
主题: [dpdk-dev] [PATCH] net/bonding: fix double get slave link status

When link status polling mode is using, the slave link status is queried twice, which may be inconsistent. To fix this, we can keep the lastest queried link state.

Fixes: a45b288ef21a ("bond: support link status polling")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 845e8fd0cf..5c4c47251b 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2390,9 +2390,6 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg)
 			 * event callback */
 			if (slave_ethdev->data->dev_link.link_status !=
 					internals->slaves[i].last_link_status) {
-				internals->slaves[i].last_link_status =
-						slave_ethdev->data->dev_link.link_status;
-
 				bond_ethdev_lsc_event_callback(internals->slaves[i].port_id,
 						RTE_ETH_EVENT_INTR_LSC,
 						&bonded_ethdev->data->port_id,
@@ -2891,7 +2888,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
 
 	uint8_t lsc_flag = 0;
 	int valid_slave = 0;
-	uint16_t active_pos;
+	uint16_t active_pos, slave_idx;
 	uint16_t i;
 
 	if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL) @@ -2912,6 +2909,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
 	for (i = 0; i < internals->slave_count; i++) {
 		if (internals->slaves[i].port_id == port_id) {
 			valid_slave = 1;
+			slave_idx = i;
 			break;
 		}
 	}
@@ -3000,6 +2998,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
 	 * slaves
 	 */
 	bond_ethdev_link_update(bonded_eth_dev, 0);
+	internals->slaves[slave_idx].last_link_status = link.link_status;
 
 	if (lsc_flag) {
 		/* Cancel any possible outstanding interrupts if delays are enabled */
--
2.27.0


  reply	other threads:[~2022-07-20  6:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 11:11 Yunjian Wang
2022-07-20  6:39 ` humin (Q) [this message]
2022-08-25 17:05   ` 答复: " Ferruh Yigit

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=781607bf0fe0426f9d5882a7b88ccd13@huawei.com \
    --to=humin29@huawei.com \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=huangshaozhang@huawei.com \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.com \
    /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).