Mismatch between modem QMAP dl max aggregation size and qmi_wwan rx urb size
When using qmi_wwan + rmnet the default modem requested QMAP dl max aggregation size is set to 32768, but the rx urb size on the driver is set to 16384:
$ sudo mmcli -m 0 --create-bearer="apn=internet,ip-type=ipv4,multiplex=required"
Successfully created new bearer in modem:
/org/freedesktop/ModemManager1/Bearer/1
$ sudo mmcli -m 0 -b 1 --connect
successfully connected the bearer
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether d8:bb:c1:82:fa:64 brd ff:ff:ff:ff:ff:ff
altname enp0s31f6
433: wwan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 16384 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
link/none
445: qmapmux0.0@wwan0: <> mtu 16380 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/[519]
This is because qmi_wwan rx urb size is linked to the MTU, but rmnet does not allow to set an MTU > 16384, failing the netdevice creation, so the MTU is capped to RMNET_MAX_PACKET_SIZE (16384).
But this brings to possible data loss if the modem sends more than RMNET_MAX_PACKET_SIZE, since it is allowed to do so by the WDA settings.
I was not able to find an easy fix for this, since it would require to set the qmi_wwan netdevice MTU after the rmnet device creation.
I've sent a workaround in commit !1043 (3d69d5d8) that lowers the requested dl max aggregation size when using qmi_wwan + rmnet while trying to understand how values > 16384 can be managed properly.
Attached debug logs. qmap_qmi_wwan_mtu.txt