netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU
@ 2012-11-08  0:39 Ian Coolidge
       [not found] ` <1352335159-8049-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2012-11-08  0:39 ` [PATCH v2 2/2] net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs Ian Coolidge
  0 siblings, 2 replies; 6+ messages in thread
From: Ian Coolidge @ 2012-11-08  0:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Felipe Balbi,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: Ian Coolidge

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(-)

-- 
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2 1/2] usb: gadget: g_ether: fix frame size check for 802.1Q
       [not found] ` <1352335159-8049-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-11-08  0:39   ` Ian Coolidge
  2012-11-08  2:27   ` [PATCH v2 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Ian Coolidge @ 2012-11-08  0:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Felipe Balbi,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: Ian Coolidge

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.

Signed-off-by: Ian Coolidge <iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/usb/gadget/u_ether.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 6458764..4ec3c0d 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -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);
-- 
1.7.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v2 2/2] net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs
  2012-11-08  0:39 [PATCH v2 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU Ian Coolidge
       [not found] ` <1352335159-8049-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-11-08  0:39 ` Ian Coolidge
  1 sibling, 0 replies; 6+ messages in thread
From: Ian Coolidge @ 2012-11-08  0:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Felipe Balbi, linux-usb, netdev; +Cc: Ian Coolidge

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

Signed-off-by: Ian Coolidge <iancoolidge@gmail.com>
---
 drivers/net/usb/cdc_eem.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index c81e278..08d55b6 100644
--- a/drivers/net/usb/cdc_eem.c
+++ b/drivers/net/usb/cdc_eem.c
@@ -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;
-- 
1.7.6.5

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

* Re: [PATCH v2 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU
       [not found] ` <1352335159-8049-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2012-11-08  0:39   ` [PATCH v2 1/2] usb: gadget: g_ether: fix frame size check for 802.1Q Ian Coolidge
@ 2012-11-08  2:27   ` David Miller
  2012-11-08 13:37     ` Felipe Balbi
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2012-11-08  2:27 UTC (permalink / raw)
  To: iancoolidge-Re5JQEeQqe8AvxtiuMwx3w
  Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, balbi-l0cyMroinI0,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA

From: Ian Coolidge <iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Wed,  7 Nov 2012 16:39:17 -0800

> 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

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU
  2012-11-08  2:27   ` [PATCH v2 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU David Miller
@ 2012-11-08 13:37     ` Felipe Balbi
       [not found]       ` <20121108133736.GA19533-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2012-11-08 13:37 UTC (permalink / raw)
  To: David Miller; +Cc: iancoolidge, gregkh, balbi, linux-usb, netdev

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

Hi,

On Wed, Nov 07, 2012 at 09:27:52PM -0500, David Miller wrote:
> From: Ian Coolidge <iancoolidge@gmail.com>
> Date: Wed,  7 Nov 2012 16:39:17 -0800
> 
> > 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
> 
> Applied, 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

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH v2 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU
       [not found]       ` <20121108133736.GA19533-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
@ 2012-11-08 19:58         ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-11-08 19:58 UTC (permalink / raw)
  To: balbi-l0cyMroinI0
  Cc: iancoolidge-Re5JQEeQqe8AvxtiuMwx3w,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA

From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Date: Thu, 8 Nov 2012 15:37:36 +0200

> Hi,
> 
> On Wed, Nov 07, 2012 at 09:27:52PM -0500, David Miller wrote:
>> From: Ian Coolidge <iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> Date: Wed,  7 Nov 2012 16:39:17 -0800
>> 
>> > 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
>> 
>> Applied, thanks.
> 
> did you take both ?

Yes.


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08  0:39 [PATCH v2 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU Ian Coolidge
     [not found] ` <1352335159-8049-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-11-08  0:39   ` [PATCH v2 1/2] usb: gadget: g_ether: fix frame size check for 802.1Q Ian Coolidge
2012-11-08  2:27   ` [PATCH v2 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU David Miller
2012-11-08 13:37     ` Felipe Balbi
     [not found]       ` <20121108133736.GA19533-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-11-08 19:58         ` David Miller
2012-11-08  0:39 ` [PATCH v2 2/2] net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs Ian Coolidge

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).