This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [NET] front: Restore 16 bytes of reservation

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>, Xen Development Mailing List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [NET] front: Restore 16 bytes of reservation
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 12 Aug 2006 12:29:19 +1000
Delivery-date: Fri, 11 Aug 2006 19:29:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
Hi Keir:

I noticed that the recent change to netfront accidetanlly removed the
16-byte reservation.  This patch puts it back.

[NET] front: Restore 16 bytes of reservation

By replacing dev_alloc_skb with alloc_skb we need to do the 16-byte
reservation ourselves.  Also, it's unnecessary to align the size
when calling alloc_skb since the alignment is an implementation
detail of alloc_skb and it already takes care of it for us.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff -r 1d817bfc5ed9 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Fri Aug 11 
14:22:54 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Sat Aug 12 
12:26:06 2006 +1000
@@ -615,7 +615,7 @@ static void network_alloc_rx_buffers(str
                 * necessary here.
                 * 16 bytes added as necessary headroom for netif_receive_skb.
-               skb = alloc_skb(SKB_DATA_ALIGN(RX_COPY_THRESHOLD + 16),
+               skb = alloc_skb(RX_COPY_THRESHOLD + 16,
                                GFP_ATOMIC | __GFP_NOWARN);
                if (unlikely(!skb))
                        goto no_skb;
@@ -633,6 +633,7 @@ no_skb:
+               skb_reserve(skb, 16);
                skb_shinfo(skb)->frags[0].page = page;
                skb_shinfo(skb)->nr_frags = 1;
                __skb_queue_tail(&np->rx_batch, skb);

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [NET] front: Restore 16 bytes of reservation, Herbert Xu <=