Commit fdf45852 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: ethernet "gadget", rx overflows happen

I tightened up rx overflow logic in the net2280 driver
a while back, and it broke MTU size packets in this
driver (host pads them out).  This patch accomodates it
by allocating a slightly larger buffer (almost 3*512).
parent 1f17689c
...@@ -76,6 +76,7 @@ static const char data_name [] = "CDC Ethernet Data"; ...@@ -76,6 +76,7 @@ static const char data_name [] = "CDC Ethernet Data";
#define MIN_PACKET sizeof(struct ethhdr) #define MIN_PACKET sizeof(struct ethhdr)
#define MAX_PACKET ETH_DATA_LEN /* biggest packet we'll rx/tx */ #define MAX_PACKET ETH_DATA_LEN /* biggest packet we'll rx/tx */
#define RX_EXTRA 20 /* guard against rx overflows */
/* FIXME allow high speed jumbograms */ /* FIXME allow high speed jumbograms */
...@@ -1226,7 +1227,7 @@ rx_submit (struct eth_dev *dev, struct usb_request *req, int gfp_flags) ...@@ -1226,7 +1227,7 @@ rx_submit (struct eth_dev *dev, struct usb_request *req, int gfp_flags)
int retval = 0; int retval = 0;
size_t size; size_t size;
size = (sizeof (struct ethhdr) + dev->net.mtu); size = (sizeof (struct ethhdr) + dev->net.mtu + RX_EXTRA);
if ((skb = alloc_skb (size, gfp_flags)) == 0) { if ((skb = alloc_skb (size, gfp_flags)) == 0) {
DEBUG (dev, "no rx skb\n"); DEBUG (dev, "no rx skb\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment