net: cdc_ncm: reduce skb truesize in rx path

Cloning the big skbs we use for USB buffering chokes up TCP and
SCTP because the socket memory limits are hitting earlier than
they should. It is better to unconditionally copy the unwrapped
packets to freshly allocated skbs.

Reported-by: Jim Baxter <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: Bjørn Mork <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
Bjørn Mork authored and David S. Miller committed 2014-06-02 16:01:30 -07:00
1 parent e289fd2817
commit 1e2c611723
1 file changed
+3 -4
+3 -4
View File
@@ -1289,12 +1289,11 @@ next_ndp:
break;
} else {
skb = skb_clone(skb_in, GFP_ATOMIC);
/* create a fresh copy to reduce truesize */
skb = netdev_alloc_skb_ip_align(dev->net, len);
if (!skb)
goto error;
skb->len = len;
skb->data = ((u8 *)skb_in->data) + offset;
skb_set_tail_pointer(skb, len);
memcpy(skb_put(skb, len), skb_in->data + offset, len);
usbnet_skb_return(dev, skb);
payload += len; /* count payload bytes in this NTB */
}