Mailing List Archive

Fix rx buffer allocation in netfront. The final allocation size
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID 7f2ccea5a4ec96af72e83c13ee25845e5d2cbb61
# Parent 8b3454b6bf5efdb170b570bcf9558bfc0708265a
Fix rx buffer allocation in netfront. The final allocation size
was ending up bigger than PAGE_SIZE.

Signed-off-by: Keir Fraser <keir@xensource.com>

diff -r 8b3454b6bf5e -r 7f2ccea5a4ec linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Dec 13 00:56:50 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Dec 13 02:47:47 2005
@@ -540,8 +540,8 @@
* tailroom then round down to SKB_DATA_ALIGN boundary.
*/
skb = alloc_xen_skb(
- (PAGE_SIZE - 16 - sizeof(struct skb_shared_info)) &
- (-SKB_DATA_ALIGN(1)));
+ ((PAGE_SIZE - sizeof(struct skb_shared_info)) &
+ (-SKB_DATA_ALIGN(1))) - 16);
if (skb == NULL)
break;
__skb_queue_tail(&np->rx_batch, skb);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog