netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: usb: smsc95xx: fix mtu
@ 2012-04-20 19:39 Stephane Fillod
  2012-04-24  4:29 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Stephane Fillod @ 2012-04-20 19:39 UTC (permalink / raw)
  To: netdev; +Cc: steve.glendinning

Make smsc95xx recalculate the hard_mtu after adjusting the
hard_header_len.

Without this, usbnet adjusts the MTU down to 1488 bytes, and the host is
unable to receive standard 1500-byte frames from the device.

Inspired by same fix on cdc_eem 78fb72f7936c01d5b426c03a691eca082b03f2b9.

Tested on ARM/Beagle.

Signed-off-by: Stephane Fillod <fillods@users.sf.net>
---

--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1016,6 +1016,7 @@
 	dev->net->ethtool_ops = &smsc95xx_ethtool_ops;
 	dev->net->flags |= IFF_MULTICAST;
 	dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM;
+	dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: usb: smsc95xx: fix mtu
  2012-04-20 19:39 Stephane Fillod
@ 2012-04-24  4:29 ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2012-04-24  4:29 UTC (permalink / raw)
  To: fillods; +Cc: netdev, steve.glendinning

From: Stephane Fillod <fillods@users.sf.net>
Date: Fri, 20 Apr 2012 21:39:23 +0200

> Make smsc95xx recalculate the hard_mtu after adjusting the
> hard_header_len.
> 
> Without this, usbnet adjusts the MTU down to 1488 bytes, and the host is
> unable to receive standard 1500-byte frames from the device.
> 
> Inspired by same fix on cdc_eem 78fb72f7936c01d5b426c03a691eca082b03f2b9.
> 
> Tested on ARM/Beagle.
> 
> Signed-off-by: Stephane Fillod <fillods@users.sf.net>

Applied, thanks.

Ok, now we've made this fix to 2 or 3 USB net drivers, can someone
audit to see if any more remain?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] net: usb: smsc95xx: fix mtu
@ 2012-04-26  9:02 Steve Glendinning
  2012-04-26  9:38 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Glendinning @ 2012-04-26  9:02 UTC (permalink / raw)
  To: netdev; +Cc: Stephane Fillod, David S. Miller, Steve Glendinning

Make smsc95xx recalculate the hard_mtu after adjusting the hard_header_len.

Without this, usbnet adjusts the MTU down to 1492 bytes, and the host is
unable to receive standard 1500-byte frames from the device.

Inspired by same fixes on cdc_eem 78fb72f7936c01d5b426c03a691eca082b03f2b9
and smsc75xx a99ff7d0123b19ecad3b589480b6542716ab6b52.

Tested on i386 with EVB-LAN9500-LC.

Signed-off-by: Steve Glendinning <steve.glendinning@shawell.net>
---
 drivers/net/usb/smsc95xx.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 5f19f84..53a1ba5 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1017,6 +1017,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->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
 	return 0;
 }
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: usb: smsc95xx: fix mtu
  2012-04-26  9:02 [PATCH] net: usb: smsc95xx: fix mtu Steve Glendinning
@ 2012-04-26  9:38 ` David Miller
  2012-04-26  9:56   ` Steve Glendinning
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2012-04-26  9:38 UTC (permalink / raw)
  To: steve.glendinning; +Cc: netdev, fillods


This is already in the 'net' tree for nearly a week:

commit 9bbf56609d304e8aae2076610d938206453035de
Author: Stephane Fillod <fillods@users.sf.net>
Date:   Fri Apr 20 09:39:23 2012 +0000

    net: usb: smsc95xx: fix mtu
    
    Make smsc95xx recalculate the hard_mtu after adjusting the
    hard_header_len.
    
    Without this, usbnet adjusts the MTU down to 1488 bytes, and the host is
    unable to receive standard 1500-byte frames from the device.
    
    Inspired by same fix on cdc_eem 78fb72f7936c01d5b426c03a691eca082b03f2b9.
    
    Tested on ARM/Beagle.
    
    Signed-off-by: Stephane Fillod <fillods@users.sf.net>
    Signed-off-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: usb: smsc95xx: fix mtu
  2012-04-26  9:38 ` David Miller
@ 2012-04-26  9:56   ` Steve Glendinning
  0 siblings, 0 replies; 5+ messages in thread
From: Steve Glendinning @ 2012-04-26  9:56 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, fillods

On 26 April 2012 10:38, David Miller <davem@davemloft.net> wrote:
>
> This is already in the 'net' tree for nearly a week:

Doh!  Sorry David, I missed this.

-- 
Steve Glendinning

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-26  9:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-26  9:02 [PATCH] net: usb: smsc95xx: fix mtu Steve Glendinning
2012-04-26  9:38 ` David Miller
2012-04-26  9:56   ` Steve Glendinning
  -- strict thread matches above, loose matches on Subject: below --
2012-04-20 19:39 Stephane Fillod
2012-04-24  4:29 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).