2012-05-30 09:18:33 +00:00
|
|
|
From: Simon Graham <simon.graham@citrix.com>
|
|
|
|
To: Ian Campbell <Ian.Campbell@citrix.com>, "konrad.wilk@oracle.com"
|
|
|
|
<konrad.wilk@oracle.com>, "xen-devel@lists.xensource.com"
|
|
|
|
<xen-devel@lists.xensource.com>, "netdev@vger.kernel.org"
|
|
|
|
<netdev@vger.kernel.org>
|
|
|
|
Date: Thu, 24 May 2012 12:26:07 -0400
|
|
|
|
Cc: "bhutchings@solarflare.com" <bhutchings@solarflare.com>,
|
|
|
|
Simon Graham <simon.graham@citrix.com>,
|
|
|
|
"davem@davemloft.net" <davem@davemloft.net>,
|
|
|
|
"adnan.misherfi@oracle.com" <adnan.misherfi@oracle.com>
|
|
|
|
Subject: [Xen-devel] [PATCH] 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>
|
2012-05-23 22:27:00 +00:00
|
|
|
---
|
2012-05-30 09:18:33 +00:00
|
|
|
drivers/net/xen-netback/netback.c | 3 +--
|
|
|
|
1 files changed, 1 insertions(+), 2 deletions(-)
|
2012-05-23 22:27:00 +00:00
|
|
|
|
2012-05-30 09:18:33 +00:00
|
|
|
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
|
|
|
|
index 2596401..f4a6fca 100644
|
2012-05-23 22:27:00 +00:00
|
|
|
--- a/drivers/net/xen-netback/netback.c
|
|
|
|
+++ b/drivers/net/xen-netback/netback.c
|
2012-05-30 09:18:33 +00:00
|
|
|
@@ -325,8 +325,7 @@ unsigned int xen_netbk_count_skb_slots(struct xenvif *vif, struct sk_buff *skb)
|
|
|
|
unsigned int count;
|
2012-05-23 22:27:00 +00:00
|
|
|
int i, copy_off;
|
2012-05-30 09:18:33 +00:00
|
|
|
|
|
|
|
- count = DIV_ROUND_UP(
|
2012-05-23 22:27:00 +00:00
|
|
|
- offset_in_page(skb->data)+skb_headlen(skb), PAGE_SIZE);
|
2012-05-30 09:18:33 +00:00
|
|
|
+ count = DIV_ROUND_UP(skb_headlen(skb), PAGE_SIZE);
|
|
|
|
|
2012-05-23 22:27:00 +00:00
|
|
|
copy_off = skb_headlen(skb) % PAGE_SIZE;
|
2012-05-30 09:18:33 +00:00
|
|
|
|
2012-05-23 22:27:00 +00:00
|
|
|
--
|
2012-05-30 09:18:33 +00:00
|
|
|
1.7.9.1
|