]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bonding: implement xdo_dev_state_free and call it after deletion
authorJianbo Liu <jianbol@nvidia.com>
Fri, 23 Aug 2024 03:10:54 +0000 (06:10 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 27 Aug 2024 20:11:37 +0000 (13:11 -0700)
commitec13009472f4a756288eb4e18e20a7845da98d10
treec1ded8dae4ad7f3ca478c1ce03bffd274290fc3b
parent65a3cce43d5b4c53cf16b0be1a03991f665a0806
bonding: implement xdo_dev_state_free and call it after deletion

Add this implementation for bonding, so hardware resources can be
freed from the active slave after xfrm state is deleted. The netdev
used to invoke xdo_dev_state_free callback, is saved in the xfrm state
(xs->xso.real_dev), which is also the bond's active slave. To prevent
it from being freed, acquire netdev reference before leaving RCU
read-side critical section, and release it after callback is done.

And call it when deleting all SAs from old active real interface while
switching current active slave.

Fixes: 9a5605505d9c ("bonding: Add struct bond_ipesc to manage SA")
Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
Link: https://patch.msgid.link/20240823031056.110999-2-jianbol@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/bonding/bond_main.c