Skip to contentSkip to conversation

qmi_wwan: add MTU default to qmap network interface

PATCH Applied Daniele Palmas 3 participants 4 messages Jan 4, 2019

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

PATCH 1/1 qmi_wwan: add MTU default to qmap network interface

This patch adds MTU default value to qmap network interface in order to avoid "RTNETLINK answers: No buffer space available" error when setting an ipv6 address.

---
 drivers/net/usb/qmi_wwan.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/usb/qmi_wwan.c +1 -0
index 774e1ff..735ad83 100644
@@ -123,6 +123,7 @@ static void qmimux_setup(struct net_device *dev)
 	dev->addr_len        = 0;
 	dev->flags           = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
 	dev->netdev_ops      = &qmimux_netdev_ops;
+	dev->mtu             = 1500;
 	dev->needs_free_netdev = true;
 }
 
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Daniele Palmas

This patch adds MTU default value to qmap network interface in order to avoid "RTNETLINK answers: No buffer space available" error when setting an ipv6 address.

---
 drivers/net/usb/qmi_wwan.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/usb/qmi_wwan.c +0 -0
index 774e1ff..735ad83 100644

drivers/net/usb/qmi_wwan.c static void qmimux_setup(struct net_device *dev) · line 128

Quoted 6 lines
drivers/net/usb/qmi_wwan.c +1 -0
@@ -123,6 +123,7 @@ static void qmimux_setup(struct net_device *dev)
 	dev->addr_len        = 0;
 	dev->flags           = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
 	dev->netdev_ops      = &qmimux_netdev_ops;
+	dev->mtu             = 1500;
 	dev->needs_free_netdev = true;
 }

Setting some value makes sense, but hard coding 1500 feels wrong. Should this relate to the real device mtu somehow? Do we need a ndo_change_mtu to enforce this relationship? Should qmimux_rx_fixup() respect the qmap device mtu?

I'm fine with this patch as a first step and immediate fix, so

#2 lore raw

Hi Bjørn,

Il giorno ven 4 gen 2019 alle ore 14:24 Bjørn Mork <[email protected]> ha scritto:

Quoted 12 lines
Quoted 9 lines · Daniele Palmas

This patch adds MTU default value to qmap network interface in order to avoid "RTNETLINK answers: No buffer space available" error when setting an ipv6 address.

---
 drivers/net/usb/qmi_wwan.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 17 lines

drivers/net/usb/qmi_wwan.c static void qmimux_setup(struct net_device *dev) · line 128

Quoted 11 lines
drivers/net/usb/qmi_wwan.c +1 -0
index 774e1ff..735ad83 100644
@@ -123,6 +123,7 @@ static void qmimux_setup(struct net_device *dev)
      dev->addr_len        = 0;
      dev->flags           = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
      dev->netdev_ops      = &qmimux_netdev_ops;
+     dev->mtu             = 1500;
      dev->needs_free_netdev = true;
 }

Setting some value makes sense, but hard coding 1500 feels wrong. Should this relate to the real device mtu somehow? Do we need a ndo_change_mtu to enforce this relationship? Should qmimux_rx_fixup() respect the qmap device mtu?

yes, all your questions seem relevant to me: in the the first draft of my patch qmap mtu was related to the real dev mtu, considering also the qmap header, but then I took a look at how the rmnet driver is managing mtu.

If I'm not wrong, it seems that mtu is hardcoded also for rmnet (RMNET_DFLT_PACKET_SIZE = 1500 defined in drivers/net/ethernet/qualcomm/rmnet/rmnet_private.h and applied in rmnet_vnd_setup function at rmnet_vnd.c).

I do not see any part of code in which the rmnet mtu is related to the mtu of the underlying device (but maybe it's me that is missing something obvious) so I used the same approach, hard coding the value.

Maybe should usbnet_change_mtu be called with the qmap network interface mtu (+ qmap header size ?) when creating a qmap device, like in qmi_wwan_netdev_setup?

Sorry in advance if I'm writing silly things...

Thanks,
Daniele

Quoted 3 lines

I'm fine with this patch as a first step and immediate fix, so