https://osmocom.org/https://osmocom.org/favicon.ico?16647414092019-04-01T10:20:46ZOpen Source Mobile CommunicationsOsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=137292019-04-01T10:20:46Zpespin
<ul></ul><p>Interestingly, according to dmesg wwan0 iface was first assigned to Gobi2000 (1-5.4.1.5) and later to EC20 (1-5.4.1.6):</p>
<pre>
root@osmo-gsm-tester-prod:~# dmesg | grep wwan0
[ 17.028189] qmi_wwan 1-5.4.1.5:1.0 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.5, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[ 4121.598616] qmi_wwan 1-5.4.1.5:1.0 wwan0: unregister 'qmi_wwan' usb-0000:00:12.2-5.4.1.5, WWAN/QMI device
[ 4126.115197] qmi_wwan 1-5.4.1.5:1.0 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.5, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[29263.362075] qmi_wwan 1-5.4.1.6:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.6, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[216205.198406] qmi_wwan 1-5.4.1.6:1.4 wwan0: unregister 'qmi_wwan' usb-0000:00:12.2-5.4.1.6, WWAN/QMI device
[216215.028310] qmi_wwan 1-5.4.1.6:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.6, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[314476.953665] qmi_wwan 1-5.4.1.6:1.4 wwan0: unregister 'qmi_wwan' usb-0000:00:12.2-5.4.1.6, WWAN/QMI device
[314487.046418] qmi_wwan 1-5.4.1.6:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.6, WWAN/QMI device, 7a:3e:ed:a5:84:9a
</pre>
<p>Even more interesting, it seems it was registered twice without unregistering in the middle, and once for each modem:<br /><pre>
[ 4126.115197] qmi_wwan 1-5.4.1.5:1.0 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.5, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[29263.362075] qmi_wwan 1-5.4.1.6:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.6, WWAN/QMI device, 7a:3e:ed:a5:84:9a
</pre></p>
<p>And actually now there exists wwan0 and dev2342:<br /><pre>
16: wwan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 7a:3e:ed:a5:84:9a brd ff:ff:ff:ff:ff:ff
2343: dev2343: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 7a:3e:ed:a5:84:9a brd ff:ff:ff:ff:ff:ff
</pre></p>
<p>Here's full log of dmesg filtered for both modems:<br /><pre>
root@osmo-gsm-tester-prod:~# dmesg | grep -e 1-5.4.1.5 -e 1-5.4.1.6
[ 12.612269] usb 1-5.4.1.5: new high-speed USB device number 17 using ehci-pci
[ 12.722635] usb 1-5.4.1.5: config 1 has an invalid interface number: 1 but max is 0
[ 12.722648] usb 1-5.4.1.5: config 1 has no interface number 0
[ 12.724575] usb 1-5.4.1.5: New USB device found, idVendor=05c6, idProduct=9204
[ 12.724583] usb 1-5.4.1.5: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 12.724587] usb 1-5.4.1.5: Product: Qualcomm Gobi 2000
[ 12.724592] usb 1-5.4.1.5: Manufacturer: Qualcomm Incorporated
[ 12.743874] qcserial 1-5.4.1.5:1.1: Qualcomm USB modem converter detected
[ 12.744968] usb 1-5.4.1.5: Qualcomm USB modem converter now attached to ttyUSB5
[ 15.872346] usb 1-5.4.1.5: USB disconnect, device number 17
[ 15.872893] qcserial 1-5.4.1.5:1.1: device disconnected
[ 16.864362] usb 1-5.4.1.5: new high-speed USB device number 18 using ehci-pci
[ 16.975228] usb 1-5.4.1.5: New USB device found, idVendor=05c6, idProduct=9205
[ 16.975237] usb 1-5.4.1.5: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 16.975242] usb 1-5.4.1.5: Product: Qualcomm Gobi 2000
[ 16.975246] usb 1-5.4.1.5: Manufacturer: Qualcomm Incorporated
[ 16.980643] qcserial 1-5.4.1.5:1.1: Qualcomm USB modem converter detected
[ 16.981008] usb 1-5.4.1.5: Qualcomm USB modem converter now attached to ttyUSB5
[ 16.982576] qcserial 1-5.4.1.5:1.2: Qualcomm USB modem converter detected
[ 16.982929] usb 1-5.4.1.5: Qualcomm USB modem converter now attached to ttyUSB6
[ 16.984345] qcserial 1-5.4.1.5:1.3: Qualcomm USB modem converter detected
[ 16.984680] usb 1-5.4.1.5: Qualcomm USB modem converter now attached to ttyUSB7
[ 17.025904] qmi_wwan 1-5.4.1.5:1.0: cdc-wdm0: USB WDM device
[ 17.028189] qmi_wwan 1-5.4.1.5:1.0 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.5, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[ 21.984710] usb 1-5.4.1.6: new high-speed USB device number 23 using ehci-pci
[ 22.099053] usb 1-5.4.1.6: New USB device found, idVendor=05c6, idProduct=9215
[ 22.099064] usb 1-5.4.1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 22.099070] usb 1-5.4.1.6: Product: Quectel LTE Module
[ 22.099075] usb 1-5.4.1.6: Manufacturer: Quectel
[ 22.122215] qcserial 1-5.4.1.6:1.0: Qualcomm USB modem converter detected
[ 22.122670] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB24
[ 22.128759] qcserial 1-5.4.1.6:1.1: Qualcomm USB modem converter detected
[ 22.129224] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB25
[ 22.130140] qcserial 1-5.4.1.6:1.2: Qualcomm USB modem converter detected
[ 22.130525] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB26
[ 22.131639] qcserial 1-5.4.1.6:1.3: Qualcomm USB modem converter detected
[ 22.132028] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB27
[ 22.133221] qmi_wwan 1-5.4.1.6:1.4: cdc-wdm5: USB WDM device
[ 22.133875] qmi_wwan 1-5.4.1.6:1.4 wwan5: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.6, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[ 4121.598354] usb 1-5.4.1.5: USB disconnect, device number 18
[ 4121.598616] qmi_wwan 1-5.4.1.5:1.0 wwan0: unregister 'qmi_wwan' usb-0000:00:12.2-5.4.1.5, WWAN/QMI device
[ 4121.614522] qcserial 1-5.4.1.5:1.1: device disconnected
[ 4121.614897] qcserial 1-5.4.1.5:1.2: device disconnected
[ 4121.615301] qcserial 1-5.4.1.5:1.3: device disconnected
[ 4121.842007] usb 1-5.4.1.5: new high-speed USB device number 28 using ehci-pci
[ 4121.952447] usb 1-5.4.1.5: config 1 has an invalid interface number: 1 but max is 0
[ 4121.952457] usb 1-5.4.1.5: config 1 has no interface number 0
[ 4121.954440] usb 1-5.4.1.5: New USB device found, idVendor=05c6, idProduct=9204
[ 4121.954453] usb 1-5.4.1.5: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 4121.954458] usb 1-5.4.1.5: Product: Qualcomm Gobi 2000
[ 4121.954464] usb 1-5.4.1.5: Manufacturer: Qualcomm Incorporated
[ 4121.957389] qcserial 1-5.4.1.5:1.1: Qualcomm USB modem converter detected
[ 4121.957828] usb 1-5.4.1.5: Qualcomm USB modem converter now attached to ttyUSB5
[ 4125.258476] usb 1-5.4.1.5: USB disconnect, device number 28
[ 4125.259353] qcserial 1-5.4.1.5:1.1: device disconnected
[ 4125.993312] usb 1-5.4.1.5: new high-speed USB device number 31 using ehci-pci
[ 4126.108622] usb 1-5.4.1.5: New USB device found, idVendor=05c6, idProduct=9205
[ 4126.108633] usb 1-5.4.1.5: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 4126.108639] usb 1-5.4.1.5: Product: Qualcomm Gobi 2000
[ 4126.108644] usb 1-5.4.1.5: Manufacturer: Qualcomm Incorporated
[ 4126.114494] qmi_wwan 1-5.4.1.5:1.0: cdc-wdm0: USB WDM device
[ 4126.115197] qmi_wwan 1-5.4.1.5:1.0 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.5, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[ 4126.116429] qcserial 1-5.4.1.5:1.1: Qualcomm USB modem converter detected
[ 4126.116756] usb 1-5.4.1.5: Qualcomm USB modem converter now attached to ttyUSB5
[ 4126.118217] qcserial 1-5.4.1.5:1.2: Qualcomm USB modem converter detected
[ 4126.118598] usb 1-5.4.1.5: Qualcomm USB modem converter now attached to ttyUSB6
[ 4126.119903] qcserial 1-5.4.1.5:1.3: Qualcomm USB modem converter detected
[ 4126.120268] usb 1-5.4.1.5: Qualcomm USB modem converter now attached to ttyUSB7
[ 4130.634130] usb 1-5.4.1.6: USB disconnect, device number 23
[ 4130.634860] qcserial 1-5.4.1.6:1.0: device disconnected
[ 4130.635413] qcserial 1-5.4.1.6:1.1: device disconnected
[ 4130.635870] qcserial 1-5.4.1.6:1.2: device disconnected
[ 4130.640193] qcserial 1-5.4.1.6:1.3: device disconnected
[ 4130.640530] qmi_wwan 1-5.4.1.6:1.4 wwan5: unregister 'qmi_wwan' usb-0000:00:12.2-5.4.1.6, WWAN/QMI device
[ 4130.880569] usb 1-5.4.1.6: new high-speed USB device number 32 using ehci-pci
[ 4130.990495] usb 1-5.4.1.6: New USB device found, idVendor=05c6, idProduct=9215
[ 4130.990506] usb 1-5.4.1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4130.990512] usb 1-5.4.1.6: Product: Quectel LTE Module
[ 4130.990517] usb 1-5.4.1.6: Manufacturer: Quectel
[ 4131.010294] qcserial 1-5.4.1.6:1.0: Qualcomm USB modem converter detected
[ 4131.010833] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB24
[ 4131.014332] qcserial 1-5.4.1.6:1.1: Qualcomm USB modem converter detected
[ 4131.014804] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB25
[ 4131.020926] qcserial 1-5.4.1.6:1.2: Qualcomm USB modem converter detected
[ 4131.021384] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB26
[ 4131.022133] qcserial 1-5.4.1.6:1.3: Qualcomm USB modem converter detected
[ 4131.022452] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB27
[ 4131.023803] qmi_wwan 1-5.4.1.6:1.4: cdc-wdm5: USB WDM device
[ 4131.024474] qmi_wwan 1-5.4.1.6:1.4 wwan5: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.6, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[29253.269410] usb 1-5.4.1.6: USB disconnect, device number 32
[29253.270225] qcserial 1-5.4.1.6:1.0: device disconnected
[29253.273356] qcserial 1-5.4.1.6:1.1: device disconnected
[29253.274099] qcserial 1-5.4.1.6:1.2: device disconnected
[29253.274689] qcserial 1-5.4.1.6:1.3: device disconnected
[29253.284031] qmi_wwan 1-5.4.1.6:1.4 wwan5: unregister 'qmi_wwan' usb-0000:00:12.2-5.4.1.6, WWAN/QMI device
[29263.219314] usb 1-5.4.1.6: new high-speed USB device number 39 using ehci-pci
[29263.329609] usb 1-5.4.1.6: New USB device found, idVendor=05c6, idProduct=9215
[29263.329619] usb 1-5.4.1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[29263.329625] usb 1-5.4.1.6: Product: Quectel LTE Module
[29263.329630] usb 1-5.4.1.6: Manufacturer: Quectel
[29263.347866] qcserial 1-5.4.1.6:1.0: Qualcomm USB modem converter detected
[29263.348302] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB24
[29263.352125] qcserial 1-5.4.1.6:1.1: Qualcomm USB modem converter detected
[29263.352602] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB25
[29263.359027] qcserial 1-5.4.1.6:1.2: Qualcomm USB modem converter detected
[29263.359538] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB26
[29263.360253] qcserial 1-5.4.1.6:1.3: Qualcomm USB modem converter detected
[29263.360567] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB27
[29263.361434] qmi_wwan 1-5.4.1.6:1.4: cdc-wdm5: USB WDM device
[29263.362075] qmi_wwan 1-5.4.1.6:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.6, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[216205.188995] usb 1-5.4.1.6: USB disconnect, device number 39
[216205.189841] qcserial 1-5.4.1.6:1.0: device disconnected
[216205.190687] qcserial 1-5.4.1.6:1.1: device disconnected
[216205.191495] qcserial 1-5.4.1.6:1.2: device disconnected
[216205.192310] qcserial 1-5.4.1.6:1.3: device disconnected
[216205.198406] qmi_wwan 1-5.4.1.6:1.4 wwan0: unregister 'qmi_wwan' usb-0000:00:12.2-5.4.1.6, WWAN/QMI device
[216214.884456] usb 1-5.4.1.6: new high-speed USB device number 40 using ehci-pci
[216214.993613] usb 1-5.4.1.6: New USB device found, idVendor=05c6, idProduct=9215
[216214.993625] usb 1-5.4.1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[216214.993630] usb 1-5.4.1.6: Product: Quectel LTE Module
[216214.993635] usb 1-5.4.1.6: Manufacturer: Quectel
[216215.011726] qcserial 1-5.4.1.6:1.0: Qualcomm USB modem converter detected
[216215.012182] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB24
[216215.016500] qcserial 1-5.4.1.6:1.1: Qualcomm USB modem converter detected
[216215.016992] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB25
[216215.023360] qcserial 1-5.4.1.6:1.2: Qualcomm USB modem converter detected
[216215.025394] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB26
[216215.026280] qcserial 1-5.4.1.6:1.3: Qualcomm USB modem converter detected
[216215.026637] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB27
[216215.027590] qmi_wwan 1-5.4.1.6:1.4: cdc-wdm5: USB WDM device
[216215.028310] qmi_wwan 1-5.4.1.6:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.6, WWAN/QMI device, 7a:3e:ed:a5:84:9a
[314476.941924] usb 1-5.4.1.6: USB disconnect, device number 40
[314476.942968] qcserial 1-5.4.1.6:1.0: device disconnected
[314476.944105] qcserial 1-5.4.1.6:1.1: device disconnected
[314476.944983] qcserial 1-5.4.1.6:1.2: device disconnected
[314476.946091] qcserial 1-5.4.1.6:1.3: device disconnected
[314476.953665] qmi_wwan 1-5.4.1.6:1.4 wwan0: unregister 'qmi_wwan' usb-0000:00:12.2-5.4.1.6, WWAN/QMI device
[314486.892590] usb 1-5.4.1.6: new high-speed USB device number 41 using ehci-pci
[314487.006696] usb 1-5.4.1.6: New USB device found, idVendor=05c6, idProduct=9215
[314487.006707] usb 1-5.4.1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[314487.006712] usb 1-5.4.1.6: Product: Quectel LTE Module
[314487.006717] usb 1-5.4.1.6: Manufacturer: Quectel
[314487.037244] qcserial 1-5.4.1.6:1.0: Qualcomm USB modem converter detected
[314487.038110] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB24
[314487.039345] qcserial 1-5.4.1.6:1.1: Qualcomm USB modem converter detected
[314487.039959] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB25
[314487.041322] qcserial 1-5.4.1.6:1.2: Qualcomm USB modem converter detected
[314487.041966] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB26
[314487.043429] qcserial 1-5.4.1.6:1.3: Qualcomm USB modem converter detected
[314487.043999] usb 1-5.4.1.6: Qualcomm USB modem converter now attached to ttyUSB27
[314487.045720] qmi_wwan 1-5.4.1.6:1.4: cdc-wdm5: USB WDM device
[314487.046418] qmi_wwan 1-5.4.1.6:1.4 wwan0: register 'qmi_wwan' at usb-0000:00:12.2-5.4.1.6, WWAN/QMI device, 7a:3e:ed:a5:84:9a
</pre></p>
<p>So it can clearly be seen that:<br />- During initial boot, gobi2000 is assigned wwan0 and ec20 is assigned wwan5.<br />- Both of them crash from time to time (devices are unregistered and then registered again).<br />- At some point (29263.362075), while gobi2000 is registered, then EC20 crashes and when registering again, it gets assigned wwan0 despite it should be for gobi2000?! (dev2343 doesn't show up in dmesg)</p>
<p>So my guess is that in 29263.362075 when ec20 crashed, it was assigned wwan0 because gobi2000's wwan0 was not in the main netns. Then I possibly spotted the crash and moved it to its netns again (./netns-modem-setup.py start), probably at some point returning all of them to the main netns and thus creating some kind of collision (2 ifaces named wwan0) and the kernel renaming one of them, and ofono not catching the rename.</p>
<p>What I'd investigate: See how this naming-collision is handled in the kernel between netns, and how udev announced them, then see if ofono implements a catch for this renaming.</p> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=137302019-04-01T10:38:55Zpespin
<ul></ul><p>I confirm ofono doesn't handle iface name renaming. I tried changing the name of one iface manually with following command, and ofono didn't output any information:<br /><pre>
ip link set wwan9 name wwan9pespin
</pre></p>
<p>That's what "udev monitor" shows while calling the command to move wwan9-old -> wwan9-new:<br /><pre>
KERNEL[598426.927211] move /devices/pci0000:00/0000:00:12.2/usb1/1-5/1-5.4/1-5.4.1/1-5.4.1.3/1-5.4.1.3:1.10/net/wwan9-new (net)
UDEV [598426.959213] move /devices/pci0000:00/0000:00:12.2/usb1/1-5/1-5.4/1-5.4.1/1-5.4.1.3/1-5.4.1.3:1.10/net/wwan9 (net)
</pre></p> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=137312019-04-01T10:56:42Zpespin
<ul></ul><p>I did test manually what happened to prove the concept (renaming to existing name in default netns inside another iface, then move it back to default):<br /><pre>
$ ip link set wwan9-old netns tmp
KERNEL[598537.320874] remove /devices/pci0000:00/0000:00:12.2/usb1/1-5/1-5.4/1-5.4.1/1-5.4.1.3/1-5.4.1.3:1.10/net/wwan9-old (net)
UDEV [598537.332401] remove /devices/pci0000:00/0000:00:12.2/usb1/1-5/1-5.4/1-5.4.1/1-5.4.1.3/1-5.4.1.3:1.10/net/wwan9 (net)
$ ip netns exec tmp ip link set wwan9-old name wwan8
(nothing shown in udev monitor since it's in a different netns)
$ ip netns delete tmp
KERNEL[598659.888878] add /devices/pci0000:00/0000:00:12.2/usb1/1-5/1-5.4/1-5.4.1/1-5.4.1.3/1-5.4.1.3:1.10/net/wwan8 (net)
KERNEL[598659.889040] move /devices/pci0000:00/0000:00:12.2/usb1/1-5/1-5.4/1-5.4.1/1-5.4.1.3/1-5.4.1.3:1.10/net/dev25 (net)
UDEV [598660.058499] add /devices/pci0000:00/0000:00:12.2/usb1/1-5/1-5.4/1-5.4.1/1-5.4.1.3/1-5.4.1.3:1.10/net/wwan8 (net)
UDEV [598660.070552] move /devices/pci0000:00/0000:00:12.2/usb1/1-5/1-5.4/1-5.4.1/1-5.4.1.3/1-5.4.1.3:1.10/net/dev25 (net)
</pre></p>
<p>And indeed ofono didn't notice the change (I don't see related output in its stdout/stderr).</p> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=137352019-04-01T16:28:07Zpespin
<ul></ul><p>I'm working on an ofono patch to update the interface send over DBus upon iface rename, but I think I am hitting this systemd-udev bug: <a class="external" href="https://github.com/systemd/systemd/issues/9426">https://github.com/systemd/systemd/issues/9426</a></p> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=137382019-04-01T18:41:49Zpespin
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>30</i></li></ul><p>I confirm I see the systemd bug in debian9 (up-to-date systems), "udevadm monitor -p" is quite useful for that.</p>
<p>I submitted 2 patches to ofono Mailing lists which allows ofono to track network interface renames (if udev works without bugs).</p>
So given we have the bug, I see several paths here:
<ul>
<li>Add udev rules to rename modem network interfaces to always have the same name, this way even if a modem crashes it will keep the same name and ofono will submit the correct name. </li>
<li>Our own ofono has a patch to avoid dropping the net device (and the whole modem) once it detects the net device gets out. If my patches are accepted, we need to change this patch to flag the net device in order to be able to drop it when the iface reappears in default netns after modem crash, otherwise after detecting the "move" the new device name is added but the old one is not dropped, so we end up with 2 devices and then the old one can override the new one when setting NetworkInterface propery.</li>
<li>Contact quectel and try to get rid of modem crashes. See if we can upgrade the firmware (ask for downgrade path possibility).</li>
</ul> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=137582019-04-02T06:19:18Zlaforge
<ul></ul><p>On Mon, Apr 01, 2019 at 06:41:49PM +0000, pespin [REDMINE] wrote:</p>
<blockquote>
<p>- Contact quectel and try to get rid of modem crashes. See if we can upgrade the firmware (ask for downgrade path possibility).</p>
</blockquote>
<p>While I think it's useful to investigate updates for all kinds of<br />reasons, I don't think you will ever be able to make the assumption that<br />the baseband stack won't crash, particularly in our type of usage. And<br />I would say that for any type of baseband/vendor.</p> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=137692019-04-02T16:20:18Zpespin
<ul><li><strong>% Done</strong> changed from <i>30</i> to <i>50</i></li></ul><p>pespin wrote:</p>
<blockquote>
<ul>
<li>Add udev rules to rename modem network interfaces to always have the same name, this way even if a modem crashes it will keep the same name and ofono will submit the correct name.</li>
</ul>
</blockquote>
<p>It took a big effort, but finally was able to make it work. dhcpcd was racing against udev and bringing interfaces up before udev tried renaming, which failed because iface was already up.</p>
<p>So, on top of the udev rule, one needs to configure dhcpcd to prevent it from managing those net ifaces you want to rename through udev. In <code>/etc/dhcpcd.conf</code> append:<br /><pre>
# Don't ifup on modem ifaces, it prevents renaming
denyinterfaces ww*
</pre></p>
<p>Then the udev rule /etc/udev/rules.d/70-net-setup-link-modems.rules:<br /><pre>
SUBSYSTEM!="net", GOTO="net_setup_link_end"
ACTION!="add", GOTO="net_setup_link_end"
IMPORT{builtin}="net_id"
ENV{DEVTYPE}=="wwan", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}"
LABEL="net_setup_link_end"
</pre></p>
<p>For some reason, SierraW modems don't get property ID_NET_NAME_PATH during call to "net_id" builtin, and so rule to rename the device doesn't apply, but we don't care since anyway we don't use gprs on those devices during testing.</p> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=137702019-04-02T17:47:22Zpespin
<ul></ul><p>In Prod system none of the modems gets ID_NET_NAME_PATH. The reason is the same as per SierraW ones in RnD: It's devpath is too long/deep (too many usb-hub levels on it). That makes the resulting ID_NET_NAME_PATH > IFNAMESIZ (15 chars) which prevents it from setting ID_NET_NAME_PATH.</p>
<p>This scenario is actually documented in systemd source code: <a class="external" href="https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c#L43">https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c#L43</a></p>
So we need to either:
<ul>
<li>Drop one usb-hub level in the quadmomem usb path, so it fits in 15 chars for ec20 modems</li>
<li>Adding an explicit UDEV rule matching a specific devpath and providing a manual name for each modem</li>
</ul> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=137722019-04-02T19:14:03Zpespin
<ul><li><strong>% Done</strong> changed from <i>50</i> to <i>60</i></li></ul><p>I finally went for a 3rd option: if path is too long and ID_NET_NAME_PATH is not set, we generate a unique iface name ourselves by hashing the devpath of the net iface (prepending character "r").</p>
<p><a class="external" href="https://gerrit.osmocom.org/#/c/osmo-ci/+/13495">https://gerrit.osmocom.org/#/c/osmo-ci/+/13495</a> ansible: osmo-gsm-tester: Make modem net ifaces persistent</p>
TODO:
<ul>
<li>follow-up on ofono submitted patches</li>
<li>Contact quectel to get info about updates</li>
<li>Make sure osmo-gsm-tester moved iface to its correct interface during test, in case a previous test made the modem crash (and its iface is re-registered on the default netns).</li>
</ul> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=138162019-04-04T14:54:34Zpespin
<ul><li><strong>% Done</strong> changed from <i>60</i> to <i>70</i></li></ul><ul>
<li>I submitted a patch with a fix for the udev rule which was generating variadic hashes on some scenarios: <a class="external" href="https://gerrit.osmocom.org/#/c/osmo-ci/+/13518">https://gerrit.osmocom.org/#/c/osmo-ci/+/13518</a> ansible: gsm-tester: Remove net iface name from hash input</li>
<li>osmo-gsm-tester now makes sure the iface is moved to correct netns before using it: <a class="external" href="https://gerrit.osmocom.org/#/c/osmo-gsm-tester/+/13526/">https://gerrit.osmocom.org/#/c/osmo-gsm-tester/+/13526/</a></li>
</ul>
TODO:
<ul>
<li>merge patches</li>
<li>follow-up on ofono submitted patches (I think not really needed by us anymore since we have persistent interface names)</li>
<li>Contact quectel to get info about updates (let's see if we can get modems crashing less).</li>
</ul> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=139842019-04-15T13:41:06Zpespin
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-1 priority-2 priority-default" href="/issues/3931">Support #3931</a>: Contact quectel to get info about modem updates (hopefully less crashes)</i> added</li></ul> OsmoGSMTester - Bug #3881: ofono: Sometimes provides wrong net interface in DBus APIhttps://osmocom.org/issues/3881?journal_id=139862019-04-15T13:41:31Zpespin
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>70</i> to <i>100</i></li></ul><p>Handling quectel contac tto upgrade firmware in <a class="issue tracker-3 status-1 priority-2 priority-default" title="Support: Contact quectel to get info about modem updates (hopefully less crashes) (New)" href="https://osmocom.org/issues/3931">#3931</a>, we can close this ticket.</p>