Commit 617a20bb authored by Isaku Yamahata's avatar Isaku Yamahata Committed by Jeff Garzik

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: default avatarIsaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 8ab7b667
...@@ -239,11 +239,14 @@ static void xennet_alloc_rx_buffers(struct net_device *dev) ...@@ -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); batch_target = np->rx_target - (req_prod - np->rx.rsp_cons);
for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) { 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); GFP_ATOMIC | __GFP_NOWARN);
if (unlikely(!skb)) if (unlikely(!skb))
goto no_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); page = alloc_page(GFP_ATOMIC | __GFP_NOWARN);
if (!page) { if (!page) {
kfree_skb(skb); kfree_skb(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment