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 615bd385b93e89e062b4e134e9cc09a79289a0f6 ]

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 <david.marchand@redhat.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
david-marchand authored and bluca committed Oct 18, 2023
1 parent b4b6c87 commit f709931
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 @@ -2114,6 +2114,10 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
eth_dev->data->dev_link.link_status = 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 f709931

Please sign in to comment.