netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 001/001] smsc95xx: Fix hard_header_len
@ 2012-08-15 19:48 JamesBetts
  2012-08-16  9:57 ` Steve Glendinning
  0 siblings, 1 reply; 7+ messages in thread
From: JamesBetts @ 2012-08-15 19:48 UTC (permalink / raw)
  To: netdev; +Cc: steve, JamesBetts

This device may require up-to 12 bytes of headroom. Assign the needed_headroom
but stop lying about hard_header_len which is used in other places throughout
the kernel.

Without this patch it is not possible to use "IFB + tc filter ... action ... 
dev ifb0" as per
http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb.

Tested using Raspberry Pi as a router with trafficshaping and IFB.
---
 drivers/net/usb/smsc95xx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 0aee6c0..02293dd 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1071,8 +1071,8 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
 	dev->net->netdev_ops = &smsc95xx_netdev_ops;
 	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;
+	dev->net->needed_headroom = SMSC95XX_TX_OVERHEAD_CSUM;
+	dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len + dev->net->needed_headroom;
 	return 0;
 }
 
-- 
1.7.4.1.433.gcd306

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

end of thread, other threads:[~2012-08-21  6:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-15 19:48 [PATCH 001/001] smsc95xx: Fix hard_header_len JamesBetts
2012-08-16  9:57 ` Steve Glendinning
2012-08-16 17:59   ` Ben Hutchings
2012-08-17  8:35     ` Steve Glendinning
2012-08-20  9:19       ` David Miller
2012-08-21  6:33         ` James Betts
2012-08-21  6:58           ` 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).