]> git.ipfire.org Git - thirdparty/linux.git/commit
bonding: Remove support for use_carrier
authorJay Vosburgh <jv@jvosburgh.net>
Sat, 30 Aug 2025 00:08:37 +0000 (17:08 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Sep 2025 21:01:54 +0000 (14:01 -0700)
commit23a6037ce76cb44d93cfea23aec5c7f3971227d4
tree341c67f502974ffdc6ccce9fa554911a169c3d0a
parentcd8a4cfa6bb43a441901e82f5c222dddc75a18a3
bonding: Remove support for use_carrier

Remove the implementation of use_carrier, the link monitoring
method that utilizes ethtool or ioctl to determine the link state of an
interface in a bond.  Bonding will always behaves as if use_carrier=1,
which relies on netif_carrier_ok() to determine the link state of
interfaces.

To avoid acquiring RTNL many times per second, bonding inspects
link state under RCU, but not under RTNL.  However, ethtool
implementations in drivers may sleep, and therefore this strategy is
unsuitable for use with calls into driver ethtool functions.

The use_carrier option was introduced in 2003, to provide
backwards compatibility for network device drivers that did not support
the then-new netif_carrier_ok/on/off system.  Device drivers are now
expected to support netif_carrier_*, and the use_carrier backwards
compatibility logic is no longer necessary.

The option itself remains, but when queried always returns 1,
and may only be set to 1.

Link: https://lore.kernel.org/000000000000eb54bf061cfd666a@google.com
Link: https://lore.kernel.org/20240718122017.d2e33aaac43a.I10ab9c9ded97163aef4e4de10985cd8f7de60d28@changeid
Signed-off-by: Jay Vosburgh <jv@jvosburgh.net>
Reported-by: syzbot+b8c48ea38ca27d150063@syzkaller.appspotmail.com
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/2029487.1756512517@famine
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/bonding.rst
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_netlink.c
drivers/net/bonding/bond_options.c
drivers/net/bonding/bond_sysfs.c
include/net/bonding.h