ia64/xen-unstable

changeset 14895:6139337e2690

netback: Copy skbuffs that are presented to the start_xmit() function
with a multi-page head buffer. The new skbuff will not have a
multi-page head buffer, which is a necessary restriction until this is
supported by the internals of the netback driver.
Signed-off-by: Steven Smith <ssmith@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Apr 23 16:37:03 2007 +0100 (2007-04-23)
parents 6f4735ba9b07
children f033cc5cc0d5
files linux-2.6-xen-sparse/drivers/xen/netback/netback.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Sat Apr 21 14:12:09 2007 -0700
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Mon Apr 23 16:37:03 2007 +0100
     1.3 @@ -252,8 +252,11 @@ int netif_be_start_xmit(struct sk_buff *
     1.4  	/*
     1.5  	 * Copy the packet here if it's destined for a flipping interface
     1.6  	 * but isn't flippable (e.g. extra references to data).
     1.7 +	 * XXX For now we also copy skbuffs whose head crosses a page
     1.8 +	 * boundary, because netbk_gop_skb can't handle them.
     1.9  	 */
    1.10 -	if (!netif->copying_receiver) {
    1.11 +	if (!netif->copying_receiver ||
    1.12 +	    ((skb_headlen(skb) + offset_in_page(skb->data)) >= PAGE_SIZE)) {
    1.13  		struct sk_buff *nskb = netbk_copy_skb(skb);
    1.14  		if ( unlikely(nskb == NULL) )
    1.15  			goto drop;
    1.16 @@ -425,8 +428,9 @@ static void netbk_gop_skb(struct sk_buff
    1.17  	}
    1.18  
    1.19  	/*
    1.20 -	 * This must occur at the end to ensure that we don't trash
    1.21 -	 * skb_shinfo until we're done.
    1.22 +	 * This must occur at the end to ensure that we don't trash skb_shinfo
    1.23 +	 * until we're done. We know that the head doesn't cross a page
    1.24 +	 * boundary because such packets get copied in netif_be_start_xmit.
    1.25  	 */
    1.26  	head_meta->id = netbk_gop_frag(netif, head_meta, 0, npo,
    1.27  				       virt_to_page(skb->data),