Isaku Yamahata
2008-Jul-03 07:06 UTC
[PATCH] xen/netfront: Avoid unaligned accesses to IP datagrams.
Align ip header to a 16 byte boundary. This patch eliminates noisy warnings on IA64. Signed-off-by: Isaku Yamahata <yamahata at valinux.co.jp> --- 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 44aed80..2724688 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); -- 1.5.3 -- yamahata
Seemingly Similar Threads
- [PATCH] xen-netfront: Avoid unaligned accesses to IP header.
- [PATCH] xen-netfront: Avoid unaligned accesses to IP header.
- [PATCH] xen-netfront: Avoid unaligned accesses to IP header.
- [PATCH V5 2/7] xen-netfront: frags -> slots in xennet_get_responses
- [PATCH 3/8] xen: netfront: convert to SKB paged frag API.