Re: Netlink failure when attempting to add multiplexed link in MBIM modem

2024-02-13 Thread Bjørn Mork
Aleksander Morgado  writes:

> Hey Bjørn,
>
> I'm getting some strange reports of failures in the netlink
> communication when adding new multiplexed links in a MBIM modem, using
> cdc_mbim. I also have the kernel dmesg but it doesn't give any
> reference to the error, the only valid thing I have is the MM debug
> log.
>
> Any idea why this may fail? If I'm not mistaken, the actual
> multiplexed net interface creation is a process done by the kernel
> alone, without any interaction with the device, so not sure what could
> be happening.
>
> 2024-01-15T06:52:20.192634Z NOTICE ModemManager[4658]:  [modem6]
> state changed (registered -> connecting)
> 2024-01-15T06:52:20.192901Z DEBUG ModemManager[4658]: 
> [modem6/bearer2] launching multiplexed connection with data port
> (net/wwan0)
> 2024-01-15T06:52:20.192912Z DEBUG ModemManager[4658]: 
> [modem6/bearer2] setting up new multiplexed link...
> 2024-01-15T06:52:20.193219Z DEBUG ModemManager[4658]:  Using
> dynamic session ID 1
> 2024-01-15T06:52:20.193259Z DEBUG ModemManager[4658]:  Using
> ifname 'mbimmux6.1' and vlan id 1
> 2024-01-15T06:52:20.193506Z WARNING ModemManager[4658]: 
> [modem6/bearer2] connection attempt #1 failed: failed to create net
> link for device: failed to add link for device: Could not allocate
> link: Failed to add link with session id 1: Netlink message with
> transaction 1 failed: Unknown error -1
> 2024-01-15T06:52:20.193634Z DEBUG ModemManager[4658]: 
> [modem6/bearer2] cannot set unhandled domain error as connection
> error: failed to create net link for device: failed to add link for
> device: Could not allocate link: Failed to add link with session id 1:
> Netlink message with transaction 1 failed: Unknown error -1
> 2024-01-15T06:52:20.193684Z NOTICE ModemManager[4658]:  [modem6]
> state changed (connecting -> registered)
> 2024-01-15T06:52:20.193973Z NOTICE ModemManager[4658]: 
> [modem6/bearer2] connection #1 finished: duration 0s
> 2024-01-15T06:52:20.193996Z WARNING ModemManager[4658]:  [modem6]
> couldn't connect bearer: failed to create net link for device: failed
> to add link for device: Could not allocate link: Failed to add link
> with session id 1: Netlink message with transaction 1 failed: Unknown
> error -1

Afraid I cant help much with this.  I'm really no expert in this area.

Looks like vlan_newlink() can fail in a number of ways: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/8021q/vlan_netlink.c#n140

And several of those return paths are silent, making it hard to guess
why it failed.

I guess that -1 is the result of some translation and not the real
errno?

If you can reproduce this somewhat reliably then you could try adding
extra debugging to all the error paths.  Otherwise I really don't know
how to figure out exactly where this fails.

Not much help there...



Bjørn


Netlink failure when attempting to add multiplexed link in MBIM modem

2024-02-13 Thread Aleksander Morgado
Hey Bjørn,

I'm getting some strange reports of failures in the netlink
communication when adding new multiplexed links in a MBIM modem, using
cdc_mbim. I also have the kernel dmesg but it doesn't give any
reference to the error, the only valid thing I have is the MM debug
log.

Any idea why this may fail? If I'm not mistaken, the actual
multiplexed net interface creation is a process done by the kernel
alone, without any interaction with the device, so not sure what could
be happening.

2024-01-15T06:52:20.192634Z NOTICE ModemManager[4658]:  [modem6]
state changed (registered -> connecting)
2024-01-15T06:52:20.192901Z DEBUG ModemManager[4658]: 
[modem6/bearer2] launching multiplexed connection with data port
(net/wwan0)
2024-01-15T06:52:20.192912Z DEBUG ModemManager[4658]: 
[modem6/bearer2] setting up new multiplexed link...
2024-01-15T06:52:20.193219Z DEBUG ModemManager[4658]:  Using
dynamic session ID 1
2024-01-15T06:52:20.193259Z DEBUG ModemManager[4658]:  Using
ifname 'mbimmux6.1' and vlan id 1
2024-01-15T06:52:20.193506Z WARNING ModemManager[4658]: 
[modem6/bearer2] connection attempt #1 failed: failed to create net
link for device: failed to add link for device: Could not allocate
link: Failed to add link with session id 1: Netlink message with
transaction 1 failed: Unknown error -1
2024-01-15T06:52:20.193634Z DEBUG ModemManager[4658]: 
[modem6/bearer2] cannot set unhandled domain error as connection
error: failed to create net link for device: failed to add link for
device: Could not allocate link: Failed to add link with session id 1:
Netlink message with transaction 1 failed: Unknown error -1
2024-01-15T06:52:20.193684Z NOTICE ModemManager[4658]:  [modem6]
state changed (connecting -> registered)
2024-01-15T06:52:20.193973Z NOTICE ModemManager[4658]: 
[modem6/bearer2] connection #1 finished: duration 0s
2024-01-15T06:52:20.193996Z WARNING ModemManager[4658]:  [modem6]
couldn't connect bearer: failed to create net link for device: failed
to add link for device: Could not allocate link: Failed to add link
with session id 1: Netlink message with transaction 1 failed: Unknown
error -1


-- 
Aleksander