diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-10-14 20:50:42 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-10-16 05:11:07 -0400 |
commit | 617a20bbd099040b68f3578a0a1da5e8780d1831 (patch) | |
tree | 28be551ea379012afea820e809591883c47f992e | |
parent | 8ab7b66796920e785d27c88fcde1539fa661ae14 (diff) |
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 <yamahata@valinux.co.jp>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/net/xen-netfront.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index c749bdba214c..9ffe743f4eb1 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) | |||
239 | */ | 239 | */ |
240 | batch_target = np->rx_target - (req_prod - np->rx.rsp_cons); | 240 | batch_target = np->rx_target - (req_prod - np->rx.rsp_cons); |
241 | for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) { | 241 | for (i = skb_queue_len(&np->rx_batch); i < batch_target; i++) { |
242 | skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD, | 242 | skb = __netdev_alloc_skb(dev, RX_COPY_THRESHOLD + NET_IP_ALIGN, |
243 | GFP_ATOMIC | __GFP_NOWARN); | 243 | GFP_ATOMIC | __GFP_NOWARN); |
244 | if (unlikely(!skb)) | 244 | if (unlikely(!skb)) |
245 | goto no_skb; | 245 | goto no_skb; |
246 | 246 | ||
247 | /* Align ip header to a 16 bytes boundary */ | ||
248 | skb_reserve(skb, NET_IP_ALIGN); | ||
249 | |||
247 | page = alloc_page(GFP_ATOMIC | __GFP_NOWARN); | 250 | page = alloc_page(GFP_ATOMIC | __GFP_NOWARN); |
248 | if (!page) { | 251 | if (!page) { |
249 | kfree_skb(skb); | 252 | kfree_skb(skb); |