* [PATCH] xen/netback: Calculate the number of SKB slots required correctly
@ 2012-05-24 16:26 Simon Graham
2012-05-24 20:21 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Simon Graham @ 2012-05-24 16:26 UTC (permalink / raw)
To: Ian Campbell, konrad.wilk@oracle.com,
xen-devel@lists.xensource.com, netdev@vger.kernel.org
Cc: bhutchings@solarflare.com, davem@davemloft.net,
adnan.misherfi@oracle.com, Simon Graham
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>
---
drivers/net/xen-netback/netback.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 2596401..f4a6fca 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)
unsigned int count;
int i, copy_off;
- count = DIV_ROUND_UP(
- offset_in_page(skb->data)+skb_headlen(skb), PAGE_SIZE);
+ count = DIV_ROUND_UP(skb_headlen(skb), PAGE_SIZE);
copy_off = skb_headlen(skb) % PAGE_SIZE;
--
1.7.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xen/netback: Calculate the number of SKB slots required correctly
2012-05-24 16:26 [PATCH] xen/netback: Calculate the number of SKB slots required correctly Simon Graham
@ 2012-05-24 20:21 ` David Miller
2012-05-28 8:42 ` Ian Campbell
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2012-05-24 20:21 UTC (permalink / raw)
To: simon.graham
Cc: Ian.Campbell, konrad.wilk, xen-devel, netdev, bhutchings,
adnan.misherfi
From: Simon Graham <simon.graham@citrix.com>
Date: Thu, 24 May 2012 12:26:07 -0400
> 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>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xen/netback: Calculate the number of SKB slots required correctly
2012-05-24 20:21 ` David Miller
@ 2012-05-28 8:42 ` Ian Campbell
0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2012-05-28 8:42 UTC (permalink / raw)
To: David Miller
Cc: Simon Graham, konrad.wilk@oracle.com,
xen-devel@lists.xensource.com, netdev@vger.kernel.org,
bhutchings@solarflare.com, adnan.misherfi@oracle.com
On Thu, 2012-05-24 at 21:21 +0100, David Miller wrote:
> From: Simon Graham <simon.graham@citrix.com>
> Date: Thu, 24 May 2012 12:26:07 -0400
>
> > 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>
>
> Applied.
Thanks both!
Ian.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-28 8:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 16:26 [PATCH] xen/netback: Calculate the number of SKB slots required correctly Simon Graham
2012-05-24 20:21 ` David Miller
2012-05-28 8:42 ` Ian Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).