* [PATCH 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU
@ 2012-11-06 21:00 Ian Coolidge
2012-11-06 21:00 ` [PATCH 1/2] usb: gadget: g_ether: fix frame size check Ian Coolidge
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ian Coolidge @ 2012-11-06 21:00 UTC (permalink / raw)
To: Oliver Neukum, Greg Kroah-Hartman, Felipe Balbi, linux-usb,
netdev
Cc: Ian Coolidge
cdc_eem USB host driver and gadget driver both are broken in 1500 MTU
case when using 802.1Q VLANs. In both cases, this is due to incomplete
assumptions of Ethernet frame size.
Ian Coolidge (2):
usb: gadget: g_ether: fix frame size check
net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs
drivers/net/usb/cdc_eem.c | 4 ++++
drivers/usb/gadget/u_ether.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletions(-)
--
1.7.6.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] usb: gadget: g_ether: fix frame size check
2012-11-06 21:00 [PATCH 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU Ian Coolidge
@ 2012-11-06 21:00 ` Ian Coolidge
2012-11-06 21:00 ` [PATCH 2/2] net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs Ian Coolidge
[not found] ` <1352235611-13066-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2 siblings, 0 replies; 4+ messages in thread
From: Ian Coolidge @ 2012-11-06 21:00 UTC (permalink / raw)
To: Oliver Neukum, Greg Kroah-Hartman, Felipe Balbi, linux-usb,
netdev
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@gmail.com>
---
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 29c854b..ff2c70b 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -19,6 +19,7 @@
#include <linux/ctype.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
+#include <linux/if_vlan.h>
#include "u_ether.h"
@@ -301,7 +302,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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs
2012-11-06 21:00 [PATCH 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU Ian Coolidge
2012-11-06 21:00 ` [PATCH 1/2] usb: gadget: g_ether: fix frame size check Ian Coolidge
@ 2012-11-06 21:00 ` Ian Coolidge
[not found] ` <1352235611-13066-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2 siblings, 0 replies; 4+ messages in thread
From: Ian Coolidge @ 2012-11-06 21:00 UTC (permalink / raw)
To: Oliver Neukum, Greg Kroah-Hartman, Felipe Balbi, linux-usb,
netdev
Cc: Ian Coolidge
cdc_eem frames might need to contain 802.1Q VLAN Ethernet frames.
Provide this information as an override to usbnet->rx_urb_size
Signed-off-by: Ian Coolidge <iancoolidge@gmail.com>
---
drivers/net/usb/cdc_eem.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index 439690b..63c38dc 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>
/*
@@ -94,6 +95,9 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN;
+ /* octets we need to rx for a single ethernet frame */
+ dev->rx_urb_size = EEM_HEAD + ETH_FCS_LEN + VLAN_ETH_FRAME_LEN;
+
return 0;
}
--
1.7.6.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <1352235611-13066-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
end of thread, other threads:[~2012-11-07 21:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-06 21:00 [PATCH 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU Ian Coolidge
2012-11-06 21:00 ` [PATCH 1/2] usb: gadget: g_ether: fix frame size check Ian Coolidge
2012-11-06 21:00 ` [PATCH 2/2] net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs Ian Coolidge
[not found] ` <1352235611-13066-1-git-send-email-iancoolidge-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-11-07 21:56 ` [PATCH 0/2] Fix CDC_EEM with 802.1Q VLAN and 1500 MTU 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).