Skip to content

Commit

Permalink
net/bonding: fix link status callback stop
Browse files Browse the repository at this point in the history
[ upstream commit 615bd38 ]

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: a45b288 ("bond: support link status polling")

Signed-off-by: David Marchand <[email protected]>
Acked-by: Chengwen Feng <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
  • Loading branch information
david-marchand authored and kevintraynor committed Oct 31, 2023
1 parent 097657f commit 6b396dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/bonding/rte_eth_bond_pmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,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_slave_link_status_change_monitor,
(void *)&rte_eth_devices[internals->port_id]);
}
internals->link_status_polling_enabled = 0;
for (i = 0; i < internals->slave_count; i++) {
uint16_t slave_id = internals->slaves[i].port_id;
Expand Down

0 comments on commit 6b396dc

Please sign in to comment.