aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/netback.c
diff options
context:
space:
mode:
authorSimon Graham <simon.graham@citrix.com>2012-05-24 02:26:07 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-24 16:22:53 -0400
commite26b203ede31fffd52571a5ba607a26c79dc5c0d (patch)
treed9eadc591e5a562122900058cc1e90ef430e1855 /drivers/net/xen-netback/netback.c
parentb4bd8ad9bb311e8536f726f7a633620ccd358cde (diff)
xen/netback: Calculate the number of SKB slots required correctly
When calculating the number of slots required for a packet header, the code was reserving too many slots if the header crossed a page boundary. Since netbk_gop_skb copies the header to the start of the page, the count of slots required for the header should be based solely on the header size. This problem is easy to reproduce if a VIF is bridged to a USB 3G modem device as the skb->data value always starts near the end of the first page. Signed-off-by: Simon Graham <simon.graham@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback/netback.c')
-rw-r--r--drivers/net/xen-netback/netback.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 2596401308a8..f4a6fcaeffb1 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -325,8 +325,7 @@ unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb)
325 unsigned int count; 325 unsigned int count;
326 int i, copy_off; 326 int i, copy_off;
327 327
328 count = DIV_ROUND_UP( 328 count = DIV_ROUND_UP(skb_headlen(skb), PAGE_SIZE);
329 offset_in_page(skb->data)+skb_headlen(skb), PAGE_SIZE);
330 329
331 copy_off = skb_headlen(skb) % PAGE_SIZE; 330 copy_off = skb_headlen(skb) % PAGE_SIZE;
332 331