# Re: \[PATCH net-next\] bonding: Remove support for use\_carrier

- From: Nikolay Aleksandrov \<razor@blackwall.org\>
- Date: 2025-09-03 09:52:21 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/09/8534365
- Thread: https://ratatoskr.run/netdev/2025/08/8534281/t.md

```text
On 8/30/25 03:08, Jay Vosburgh wrote:
> 	 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/lkml/000000000000eb54bf061cfd666a@google.com/
> Link: https://lore.kernel.org/netdev/20240718122017.d2e33aaac43a.I10ab9c9ded97163aef4e4de10985cd8f7de60d28@changeid/
> Signed-off-by: Jay Vosburgh <jv@jvosburgh.net>
>
> ---
>
> Note: Deliberately omitting a Fixes tag to avoid removing functionality
> in older kernels that may be in use.
>
>   Documentation/networking/bonding.rst |  79 +++----------------
>   drivers/net/bonding/bond_main.c      | 113 ++-------------------------
>   drivers/net/bonding/bond_netlink.c   |  14 ++--
>   drivers/net/bonding/bond_options.c   |   7 +-
>   drivers/net/bonding/bond_sysfs.c     |   6 +-
>   include/net/bonding.h                |   1 -
>   6 files changed, 28 insertions(+), 192 deletions(-)
>

Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>

```
