direct-io.hg

changeset 12208:36d020268c6c

PV-on-HVM: Conditionally disable checksum offload for receive on some
older kernels.

On some older kernels the CHECKSUM_UNNECESSARY flag on received
skbuffs is not honoured by all subsystems, specifically netfilter
under 2.6.9-42.EL

To work around this we need to ensure that the correct checksum is
calculated at some point. We can cause the backend to do this for us
by advertising to the backend that we cannot support checksum offload.

The correlation of this issue with the presence of NETIF_F_TSO is not
100% but it is a good first approximation.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Thu Nov 02 11:56:26 2006 +0000 (2006-11-02)
parents f3fbe9549f5f
children 002856e70ca1
files linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Nov 02 11:56:26 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Nov 02 11:56:26 2006 +0000
     1.3 @@ -101,6 +101,14 @@ static inline void dev_disable_gso_featu
     1.4  }
     1.5  #elif defined(NETIF_F_TSO)
     1.6  #define HAVE_TSO                       1
     1.7 +
     1.8 +/* Some older kernels cannot cope with incorrect checksums,
     1.9 + * particularly in netfilter. I'm not sure there is 100% correlation
    1.10 + * with the presence of NETIF_F_TSO but it appears to be a good first
    1.11 + * approximiation.
    1.12 + */
    1.13 +#define HAVE_NO_CSUM_OFFLOAD           1
    1.14 +
    1.15  #define gso_size tso_size
    1.16  #define gso_segs tso_segs
    1.17  static inline void dev_disable_gso_features(struct net_device *dev)
    1.18 @@ -394,6 +402,14 @@ again:
    1.19  		goto abort_transaction;
    1.20  	}
    1.21  
    1.22 +#ifdef HAVE_NO_CSUM_OFFLOAD
    1.23 +	err = xenbus_printf(xbt, dev->nodename, "feature-no-csum-offload", "%d", 1);
    1.24 +	if (err) {
    1.25 +		message = "writing feature-no-csum-offload";
    1.26 +		goto abort_transaction;
    1.27 +	}
    1.28 +#endif
    1.29 +
    1.30  	err = xenbus_printf(xbt, dev->nodename, "feature-sg", "%d", 1);
    1.31  	if (err) {
    1.32  		message = "writing feature-sg";