From: Isaku Yamahata Date: Wed, 15 Oct 2008 00:50:42 +0000 (-0700) Subject: xen-netfront: Avoid unaligned accesses to IP header X-Git-Tag: v2.6.28-rc1~104^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=617a20bbd099040b68f3578a0a1da5e8780d1831;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git xen-netfront: Avoid unaligned accesses to IP header Align ip header to a 16 byte boundary to avoid unaligned access like other drivers. Without this patch, xen-netfront doesn't work well on ia64. Signed-off-by: Isaku Yamahata Signed-off-by: Jeremy Fitzhardinge Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index c749bdb..9ffe743 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -239,11 +239,14 @@ static void xennet_alloc_rx_buffers(struct net_device *dev) */ batch_target = np->rx_target - (req_prod - np->rx.rsp_cons); for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) { - skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD, + skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD + NET_IP_ALIGN, GFP_ATOMIC | __GFP_NOWARN); if (unlikely(!skb)) goto no_skb; + /* Align ip header to a 16 bytes boundary */ + skb_reserve(skb, NET_IP_ALIGN); + page = alloc_page(GFP_ATOMIC | __GFP_NOWARN); if (!page) { kfree_skb(skb);