patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Chas Williams <chas3@att.com>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>,
	Declan Doherty <declan.doherty@intel.com>
Subject: [PATCH] net/bonding: fix link status callback stop
Date: Mon, 16 Oct 2023 10:47:43 +0200	[thread overview]
Message-ID: <20231016084744.734493-1-david.marchand@redhat.com> (raw)

If a bonding port gets released, a link status alarm callback still
referenced the ethdev port that may be reused later.
Cancel this callback when stopping the port.

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

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Note: this issue was made apparent now that we release the ethdev port
shared mem, see 36c46e738120 ("ethdev: cleanup shared data with ...").

---
 drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 122b1187fd..b8ee8be50f 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2159,6 +2159,10 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
 	eth_dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN;
 	eth_dev->data->dev_started = 0;
 
+	if (internals->link_status_polling_enabled) {
+		rte_eal_alarm_cancel(bond_ethdev_member_link_status_change_monitor,
+			(void *)&rte_eth_devices[internals->port_id]);
+	}
 	internals->link_status_polling_enabled = 0;
 	for (i = 0; i < internals->member_count; i++) {
 		uint16_t member_id = internals->members[i].port_id;
-- 
2.41.0


             reply	other threads:[~2023-10-16  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16  8:47 David Marchand [this message]
2023-10-16 10:33 ` fengchengwen
2023-10-16 12:22   ` Ferruh Yigit
2023-10-16 15:54   ` Stephen Hemminger

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=20231016084744.734493-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=chas3@att.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=humin29@huawei.com \
    --cc=pablo.de.lara.guarch@intel.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).