diff options
author | Ian Campbell <ian.campbell@xensource.com> | 2006-11-02 11:56:26 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@xensource.com> | 2006-11-02 11:56:26 +0000 |
commit | 680c789da1c81f3fd29073abc2922feeb3764eb1 (patch) | |
tree | a7f2edb1c43fda75591eb6fe02bfdaa6a858afa7 /linux-2.6-xen-sparse | |
parent | 4101fafcc01b226bb48576d48ea36cc505d2c288 (diff) | |
download | xen-680c789da1c81f3fd29073abc2922feeb3764eb1.tar.gz xen-680c789da1c81f3fd29073abc2922feeb3764eb1.tar.bz2 xen-680c789da1c81f3fd29073abc2922feeb3764eb1.zip |
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>
Diffstat (limited to 'linux-2.6-xen-sparse')
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 10f6d47994..e379f5f314 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -101,6 +101,14 @@ static inline void dev_disable_gso_features(struct net_device *dev) } #elif defined(NETIF_F_TSO) #define HAVE_TSO 1 + +/* Some older kernels cannot cope with incorrect checksums, + * particularly in netfilter. I'm not sure there is 100% correlation + * with the presence of NETIF_F_TSO but it appears to be a good first + * approximiation. + */ +#define HAVE_NO_CSUM_OFFLOAD 1 + #define gso_size tso_size #define gso_segs tso_segs static inline void dev_disable_gso_features(struct net_device *dev) @@ -394,6 +402,14 @@ again: goto abort_transaction; } +#ifdef HAVE_NO_CSUM_OFFLOAD + err = xenbus_printf(xbt, dev->nodename, "feature-no-csum-offload", "%d", 1); + if (err) { + message = "writing feature-no-csum-offload"; + goto abort_transaction; + } +#endif + err = xenbus_printf(xbt, dev->nodename, "feature-sg", "%d", 1); if (err) { message = "writing feature-sg"; |