Set __LINK_STATE_NOCARRIER in register_netdevice() ?

2 messages, 2 authors, 2021-11-17 · open the first message on its own page

Set __LINK_STATE_NOCARRIER in register_netdevice() ?

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: 2021-11-16 20:47:31

Quite some network drivers call netif_carrier_off() in their probe() function.
So I'm wondering whether we can/should add a
set_bit(__LINK_STATE_NOCARRIER, &dev->state)
to register_netdevice() and remove all these netif_carrier_off() calls.

Question is whether there's any scenario where a driver would depend on bit
__LINK_STATE_NOCARRIER being cleared after registering the netdevice
or where we want to preserve the state of this bit.

Re: Set __LINK_STATE_NOCARRIER in register_netdevice() ?

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-11-17 02:51:47

On Tue, 16 Nov 2021 21:47:21 +0100 Heiner Kallweit wrote:
Quite some network drivers call netif_carrier_off() in their probe() function.
So I'm wondering whether we can/should add a
set_bit(__LINK_STATE_NOCARRIER, &dev->state)
to register_netdevice() and remove all these netif_carrier_off() calls.

Question is whether there's any scenario where a driver would depend on bit
__LINK_STATE_NOCARRIER being cleared after registering the netdevice
or where we want to preserve the state of this bit.
I thought that conversely many sw devices never touch carrier, hence
letting it remain up with operstate unknown. We'd be changing that,
dunno if it matters.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help