ia64/xen-unstable

changeset 11888:797430d25f1b

[NET] front/back: Avoid unaligned accesses to IP datagrams. These
cause noisy warnings on IA64.

Signed-off-by: Kouya SHIMURA <kouya@jp.fujitsu.com>
Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Wed Oct 18 17:59:04 2006 +0100 (2006-10-18)
parents 58144f4b102c
children da66691687df
files linux-2.6-xen-sparse/drivers/xen/netback/netback.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Wed Oct 18 17:54:58 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Wed Oct 18 17:59:04 2006 +0100
     1.3 @@ -187,7 +187,7 @@ static struct sk_buff *netbk_copy_skb(st
     1.4  	if (unlikely(!nskb))
     1.5  		goto err;
     1.6  
     1.7 -	skb_reserve(nskb, 16);
     1.8 +	skb_reserve(nskb, 16 + NET_IP_ALIGN);
     1.9  	headlen = nskb->end - nskb->data;
    1.10  	if (headlen > skb_headlen(skb))
    1.11  		headlen = skb_headlen(skb);
    1.12 @@ -1210,7 +1210,7 @@ static void net_tx_action(unsigned long 
    1.13  			    ret < MAX_SKB_FRAGS) ?
    1.14  			PKT_PROT_LEN : txreq.size;
    1.15  
    1.16 -		skb = alloc_skb(data_len+16, GFP_ATOMIC);
    1.17 +		skb = alloc_skb(data_len + 16 + NET_IP_ALIGN, GFP_ATOMIC);
    1.18  		if (unlikely(skb == NULL)) {
    1.19  			DPRINTK("Can't allocate a skb in start_xmit.\n");
    1.20  			netbk_tx_err(netif, &txreq, i);
    1.21 @@ -1218,7 +1218,7 @@ static void net_tx_action(unsigned long 
    1.22  		}
    1.23  
    1.24  		/* Packets passed to netif_rx() must have some headroom. */
    1.25 -		skb_reserve(skb, 16);
    1.26 +		skb_reserve(skb, 16 + NET_IP_ALIGN);
    1.27  
    1.28  		if (extras[XEN_NETIF_EXTRA_TYPE_GSO - 1].type) {
    1.29  			struct netif_extra_info *gso;
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed Oct 18 17:54:58 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed Oct 18 17:59:04 2006 +0100
     2.3 @@ -684,7 +684,7 @@ static void network_alloc_rx_buffers(str
     2.4  		 * necessary here.
     2.5  		 * 16 bytes added as necessary headroom for netif_receive_skb.
     2.6  		 */
     2.7 -		skb = alloc_skb(RX_COPY_THRESHOLD + 16,
     2.8 +		skb = alloc_skb(RX_COPY_THRESHOLD + 16 + NET_IP_ALIGN,
     2.9  				GFP_ATOMIC | __GFP_NOWARN);
    2.10  		if (unlikely(!skb))
    2.11  			goto no_skb;
    2.12 @@ -702,7 +702,7 @@ no_skb:
    2.13  			break;
    2.14  		}
    2.15  
    2.16 -		skb_reserve(skb, 16); /* mimic dev_alloc_skb() */
    2.17 +		skb_reserve(skb, 16 + NET_IP_ALIGN); /* mimic dev_alloc_skb() */
    2.18  		skb_shinfo(skb)->frags[0].page = page;
    2.19  		skb_shinfo(skb)->nr_frags = 1;
    2.20  		__skb_queue_tail(&np->rx_batch, skb);