DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/bonding: fix link status callback stop
@ 2023-10-16  8:47 David Marchand
  2023-10-16 10:33 ` fengchengwen
  0 siblings, 1 reply; 4+ messages in thread
From: David Marchand @ 2023-10-16  8:47 UTC (permalink / raw)
  To: dev; +Cc: stable, Chas Williams, Min Hu (Connor), Pablo de Lara, Declan Doherty

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-16 15:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16  8:47 [PATCH] net/bonding: fix link status callback stop David Marchand
2023-10-16 10:33 ` fengchengwen
2023-10-16 12:22   ` Ferruh Yigit
2023-10-16 15:54   ` Stephen Hemminger

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).