提交 a66fe165 编写于 作者: I Ian Coolidge 提交者: David S. Miller

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
Signed-off-by: NIan Coolidge <iancoolidge@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4fe5f079
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/usb/cdc.h> #include <linux/usb/cdc.h>
#include <linux/usb/usbnet.h> #include <linux/usb/usbnet.h>
#include <linux/gfp.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) ...@@ -92,7 +93,7 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)
/* no jumbogram (16K) support for now */ /* 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; dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册