Skip to contentSkip to conversation

netdev: operstate UNKNOWN for loopback and other devices?

DISCUSSION Stephen Hemminger 2 participants 3 messages Nov 19, 2024 – Nov 20, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

It looks like loopback and other software devices never get the operstate set correctly. Not a serious problem, but it is incorrect.

For example:

$ ip -br link
lo               UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP> 
tap0             UNKNOWN        ca:ff:ed:bf:96:a0 <BROADCAST,PROMISC,UP,LOWER_UP> 
tap1             UNKNOWN        36:f5:16:d1:4c:15 <BROADCAST,PROMISC,UP,LOWER_UP> 

For wireless and ethernet devices kernel reports UP and DOWN correctly.

Looks like some missing bits in dev_open but not sure exactly where.

maintainer
#1 lore raw
Quoted 7 lines · On Tue, 19 Nov 2024 15:37:03 -0800 Stephen Hemminger wrote:

It looks like loopback and other software devices never get the operstate set correctly. Not a serious problem, but it is incorrect.

For example:

$ ip -br link
lo               UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP> 
Quoted 6 lines
tap0             UNKNOWN        ca:ff:ed:bf:96:a0 <BROADCAST,PROMISC,UP,LOWER_UP> 
tap1             UNKNOWN        36:f5:16:d1:4c:15 <BROADCAST,PROMISC,UP,LOWER_UP> 

For wireless and ethernet devices kernel reports UP and DOWN correctly.

Looks like some missing bits in dev_open but not sure exactly where.

I thought it means the driver doesn't have any notion of the carrier, IOW the carrier will never go down. Basically those drivers don't call netif_carrier_{on,off}() at all, and rely on carrier being on by default at netdev registration.

#2 lore raw
Quoted 11 lines · On Tue, 19 Nov 2024 19:23:53 -0800 Jakub Kicinski <[email protected]> wrote:
Quoted 10 lines · On Tue, 19 Nov 2024 15:37:03 -0800 Stephen Hemminger wrote:

It looks like loopback and other software devices never get the operstate set correctly. Not a serious problem, but it is incorrect.

For example:

$ ip -br link
lo               UNKNOWN        00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP> 
tap0             UNKNOWN        ca:ff:ed:bf:96:a0 <BROADCAST,PROMISC,UP,LOWER_UP> 
tap1             UNKNOWN        36:f5:16:d1:4c:15 <BROADCAST,PROMISC,UP,LOWER_UP> 
Quoted 8 lines
Quoted 3 lines

For wireless and ethernet devices kernel reports UP and DOWN correctly.

Looks like some missing bits in dev_open but not sure exactly where.

I thought it means the driver doesn't have any notion of the carrier, IOW the carrier will never go down. Basically those drivers don't call netif_carrier_{on,off}() at all, and rely on carrier being on by default at netdev registration.

Tap device does have concept of pseudo carrier. If application has file descriptor open it reports carrier, if the device is present but application has not opened it then carrier is reported down.