Hi,

recently there was a user who reports that his Raspberry Pi 3B didn't work as 
expected [1].

The problem is that the smsc95xx driver accepts to high MTU values ( > 9000) 
from userspace like dhcp-client, but according to the LAN9500 databook the chip 
seems only capable to handle MTU sizes <= 1500.

It looks like that smsc95xx slipped through the cracks during the creation of 
commit f77f0aee4da4 ("net: use core MTU range checking in USB NIC drivers"). 
Unfortunately i don't have all the chips listed in this driver.

So my questions would be the following patch correct:

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 06b4d29..420a0e4 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1318,6 +1318,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct 
usb_interface *intf)
        dev->net->ethtool_ops = &smsc95xx_ethtool_ops;
        dev->net->flags |= IFF_MULTICAST;
        dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM;
+       dev->net->max_mtu = ETH_DATA_LEN;
        dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
 
        pdata->dev = dev;

[1] - https://github.com/raspberrypi/linux/issues/2660

Reply via email to