ia64/xen-unstable

changeset 9586:806d04252761

Fix checksum-offload problems introduced in c/s 9514, due to
data_validated flag not being properly specified on the
device channel.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Apr 05 10:37:37 2006 +0100 (2006-04-05)
parents 5baf152d63ef
children d1ddd7d35ed5
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	Tue Apr 04 15:20:12 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Wed Apr 05 10:37:37 2006 +0100
     1.3 @@ -329,9 +329,9 @@ static void net_rx_action(unsigned long 
     1.4  		irq = netif->irq;
     1.5  		id = RING_GET_REQUEST(&netif->rx, netif->rx.rsp_prod_pvt)->id;
     1.6  		flags = 0;
     1.7 -		if (skb->ip_summed == CHECKSUM_HW)
     1.8 -			flags |= NETRXF_csum_blank;
     1.9 -		if (skb->proto_data_valid)
    1.10 +		if (skb->ip_summed == CHECKSUM_HW) /* local packet? */
    1.11 +			flags |= NETRXF_csum_blank | NETRXF_data_validated;
    1.12 +		else if (skb->proto_data_valid) /* remote but checksummed? */
    1.13  			flags |= NETRXF_data_validated;
    1.14  		if (make_rx_response(netif, id, status,
    1.15  				     (unsigned long)skb->data & ~PAGE_MASK,
    1.16 @@ -658,7 +658,11 @@ static void net_tx_action(unsigned long 
    1.17  		skb->dev      = netif->dev;
    1.18  		skb->protocol = eth_type_trans(skb, skb->dev);
    1.19  
    1.20 -		if (txreq.flags & NETTXF_data_validated) {
    1.21 +		/*
    1.22 +		 * Old frontends do not assert data_validated but we
    1.23 +		 * can infer it from csum_blank so test both flags.
    1.24 +		 */
    1.25 +		if (txreq.flags & (NETTXF_data_validated|NETTXF_csum_blank)) {
    1.26  			skb->ip_summed = CHECKSUM_UNNECESSARY;
    1.27  			skb->proto_data_valid = 1;
    1.28  		} else {
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Apr 04 15:20:12 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed Apr 05 10:37:37 2006 +0100
     2.3 @@ -698,9 +698,9 @@ static int network_start_xmit(struct sk_
     2.4  	tx->size = skb->len;
     2.5  
     2.6  	tx->flags = 0;
     2.7 -	if (skb->ip_summed == CHECKSUM_HW)
     2.8 -		tx->flags |= NETTXF_csum_blank;
     2.9 -	if (skb->proto_data_valid)
    2.10 +	if (skb->ip_summed == CHECKSUM_HW) /* local packet? */
    2.11 +		tx->flags |= NETTXF_csum_blank | NETTXF_data_validated;
    2.12 +	if (skb->proto_data_valid) /* remote but checksummed? */
    2.13  		tx->flags |= NETTXF_data_validated;
    2.14  
    2.15  	np->tx.req_prod_pvt = i + 1;
    2.16 @@ -816,7 +816,11 @@ static int netif_poll(struct net_device 
    2.17  		skb->len  = rx->status;
    2.18  		skb->tail = skb->data + skb->len;
    2.19  
    2.20 -		if (rx->flags & NETRXF_data_validated) {
    2.21 +		/*
    2.22 +		 * Old backends do not assert data_validated but we
    2.23 +		 * can infer it from csum_blank so test both flags.
    2.24 +		 */
    2.25 +		if (rx->flags & (NETRXF_data_validated|NETRXF_csum_blank)) {
    2.26  			skb->ip_summed = CHECKSUM_UNNECESSARY;
    2.27  			skb->proto_data_valid = 1;
    2.28  		} else {
    2.29 @@ -1017,8 +1021,11 @@ static void network_connect(struct net_d
    2.30  		tx->gref = np->grant_tx_ref[i];
    2.31  		tx->offset = (unsigned long)skb->data & ~PAGE_MASK;
    2.32  		tx->size = skb->len;
    2.33 -		tx->flags = (skb->ip_summed == CHECKSUM_HW) ?
    2.34 -			NETTXF_csum_blank : 0;
    2.35 +		tx->flags = 0;
    2.36 +		if (skb->ip_summed == CHECKSUM_HW) /* local packet? */
    2.37 +			tx->flags |= NETTXF_csum_blank | NETTXF_data_validated;
    2.38 +		if (skb->proto_data_valid) /* remote but checksummed? */
    2.39 +			tx->flags |= NETTXF_data_validated;
    2.40  
    2.41  		np->stats.tx_bytes += skb->len;
    2.42  		np->stats.tx_packets++;