Fix CDC_EEM with 802.1Q VLAN and 1500 MTU
Subsystems (5)
v2 cover Fix CDC_EEM with 802.1Q VLAN and 1500 MTU
cdc_eem USB host driver and gadget driver both are broken in 1500 MTU case while using 802.1Q VLANs. In both cases, this is due to the assumption of standard Ethernet frame length.
v2: rebase against Dave Miller's 'net/master' tree
Ian Coolidge (2):
usb: gadget: g_ether: fix frame size check for 802.1Q
net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs
drivers/net/usb/cdc_eem.c | 3 ++- drivers/usb/gadget/u_ether.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
Signature · 6 lines
1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 2/2 net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs
cdc_eem frames might need to contain 802.1Q VLAN Ethernet frames. URB/skb sizing from usbnet will default to the hard_mtu, so account for the VLAN header by expanding that via hard_header_len
--- drivers/net/usb/cdc_eem.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/usb/cdc_eem.c +2 -1
@@ -31,6 +31,7 @@#include <linux/usb/cdc.h> #include <linux/usb/usbnet.h> #include <linux/gfp.h> +#include <linux/if_vlan.h> /*
@@ -92,7 +93,7 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)/* no jumbogram (16K) support for now */ - dev->net->hard_header_len +=EEM_HEAD +ETH_FCS_LEN ; + dev->net->hard_header_len +=EEM_HEAD +ETH_FCS_LEN +VLAN_HLEN ; dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;return 0 ;
Signature · 1 line
1.7.6.5
A message that is not in the archive (sent off-list or not yet received): 1352335159-8049-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH v2 1/2 usb: gadget: g_ether: fix frame size check for 802.1Q
Checking skb->len against ETH_FRAME_LEN assumes a 1514 ethernet frame size. With an 802.1Q VLAN header, ethernet frame length can now be 1518. Validate frame length against that.
--- drivers/usb/gadget/u_ether.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/usb/gadget/u_ether.c +2 -1
@@ -20,6 +20,7 @@#include <linux/ctype.h> #include <linux/etherdevice.h> #include <linux/ethtool.h> +#include <linux/if_vlan.h> #include "u_ether.h"
@@ -295,7 +296,7 @@ static void rx_complete(struct usb_ep *ep, struct usb_request *req)while (skb2) {if (status <0 ||ETH_HLEN > skb2->len - || skb2->len >ETH_FRAME_LEN ) { + || skb2->len >VLAN_ETH_FRAME_LEN ) { dev->net->stats.rx_errors++; dev->net->stats.rx_length_errors++;DBG (dev,"rx length %d\n" , skb2->len);
Signature · 6 lines
1.7.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Ian Coolidge <[email protected]>
Date: Wed, 7 Nov 2012 16:39:17 -0800
Quoted 9 lines
cdc_eemUSB host driver and gadget driver both are broken in 1500 MTU case while using 802.1Q VLANs. In both cases, this is due to the assumption of standard Ethernet frame length.v2: rebase against Dave Miller's 'net/master' tree
Ian Coolidge (2):
usb: gadget:g_ether: fix frame size check for 802.1Q
net: usb:cdc_eem: Fix rx skb allocation for 802.1Q VLANs
Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
Quoted 7 lines · David Miller
From: Ian Coolidge <[email protected]>
Date: Wed, 7 Nov 2012 16:39:17 -0800Quoted 4 lines
cdc_eemUSB host driver and gadget driver both are broken in 1500 MTU case while using 802.1Q VLANs. In both cases, this is due to the assumption of standard Ethernet frame length.
Quoted 7 lines
Quoted 5 lines
v2: rebase against Dave Miller's 'net/master' tree
Ian Coolidge (2):
usb: gadget:g_ether: fix frame size check for 802.1Q
net: usb:cdc_eem: Fix rx skb allocation for 802.1Q VLANsApplied, thanks.
did you take both ? I'd rather you waited for my Ack for anything under drivers/usb/gadget/ so we avoid conflicts later.
cheers
Signature · 1 line
balbi
A message that is not in the archive (sent off-list or not yet received): 20121108133736.GA19533-S8G//mZuvNWo5Im9Ml3/[email protected]
From: Felipe Balbi <[email protected]>
Date: Thu, 8 Nov 2012 15:37:36 +0200
Quoted 12 lines
Hi,
Quoted 9 lines · David Miller
From: Ian Coolidge <[email protected]>
Date: Wed, 7 Nov 2012 16:39:17 -0800Quoted 6 lines
cdc_eemUSB host driver and gadget driver both are broken in 1500 MTU case while using 802.1Q VLANs. In both cases, this is due to the assumption of standard Ethernet frame length.v2: rebase against Dave Miller's 'net/master' tree
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Ian Coolidge (2):
usb: gadget:g_ether: fix frame size check for 802.1Q
net: usb:cdc_eem: Fix rx skb allocation for 802.1Q VLANsApplied, thanks.
did you take both ?
Yes.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html