cdc_ncm: fix TCP window scaling issue for NCM driver
Steve Lin [Thu, 14 Feb 2013 22:08:05 +0000 (14:08 -0800)]
TCP network stack uses skb->truesize as hint to grow TCP window size.
However, the NCM driver uses skb_clone to push the ethernet packet to
the network stack. The skb->truesize is actually the memory allocated
for the whole transfer block, not the true packet size with overhead.
tcp_grow_window function doesn't handle this case properly so the
receiver window will not grow. This patch is to update the skb->truesize
in the cdc_ncm_rx_fixup function so the TCP stack can use it to grow the
window size as expected.

Bug 1207244
Bug 1235981

Change-Id: I7c48eb65e7f991d7eb0f2ef14c515134b9180ea4
Signed-off-by: Steve Lin <stlin@nvidia.com>
Reviewed-on: http://git-master/r/200895
Reviewed-by: David Norman <dnorman@nvidia.com>
Reviewed-by: Rick Song <ricks@nvidia.com>

drivers/net/usb/cdc_ncm.c

index 0ac21a1..81afcd0 100644 (file)
@@ -1089,6 +1089,7 @@ static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in)
                        skb->len = len;
                        skb->data = ((u8 *)skb_in->data) + offset;
                        skb_set_tail_pointer(skb, len);
+                       skb->truesize = len + sizeof(struct sk_buff);
                        usbnet_skb_return(dev, skb);
                }
        }