ia64/linux-2.6.18-xen.hg

changeset 775:107e10e0e07c

netfront/back: do not mark packets of length < MSS as GSO

Linux assumes that skbs marked for GSO are longer than MSS. In
particular tcp_tso_segment assumes that skb_segment will return a
chain of at least 2 skbs.

Both netfront and back should therefor not pass such a packet up the
stack.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 13 15:17:54 2009 +0000 (2009-01-13)
parents 28acedb66302
children 93ea69924241
files drivers/xen/netback/netback.c drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/drivers/xen/netback/netback.c	Wed Jan 07 12:21:54 2009 +0900
     1.2 +++ b/drivers/xen/netback/netback.c	Tue Jan 13 15:17:54 2009 +0000
     1.3 @@ -1345,6 +1345,11 @@ static void net_tx_action(unsigned long 
     1.4  			skb_shinfo(skb)->frags[0].page = (void *)~0UL;
     1.5  		}
     1.6  
     1.7 +		if (skb->data_len < skb_shinfo(skb)->gso_size) {
     1.8 +			skb_shinfo(skb)->gso_size = 0;
     1.9 +			skb_shinfo(skb)->gso_type = 0;
    1.10 +		}
    1.11 +
    1.12  		__skb_queue_tail(&tx_queue, skb);
    1.13  
    1.14  		pending_cons++;
     2.1 --- a/drivers/xen/netfront/netfront.c	Wed Jan 07 12:21:54 2009 +0900
     2.2 +++ b/drivers/xen/netfront/netfront.c	Tue Jan 13 15:17:54 2009 +0000
     2.3 @@ -1439,6 +1439,14 @@ err:
     2.4  		np->stats.rx_packets++;
     2.5  		np->stats.rx_bytes += skb->len;
     2.6  
     2.7 +#if HAVE_TSO
     2.8 +		if (skb->data_len < skb_shinfo(skb)->gso_size) {
     2.9 +			skb_shinfo(skb)->gso_size = 0;
    2.10 +#if HAVE_GSO
    2.11 +			skb_shinfo(skb)->gso_type = 0;
    2.12 +#endif
    2.13 +		}
    2.14 +#endif
    2.15  		__skb_queue_tail(&rxq, skb);
    2.16  
    2.17  		np->rx.rsp_cons = ++i;