From: kaf24@firebug.cl.cam.ac.uk Date: Thu, 19 Jan 2006 19:11:09 +0000 (+0100) Subject: Allow disabling the tx checksums on the xen loopback X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16541^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=31415c26f92b9b3c4b70032a7f768e7c19dfb0db;p=xen.git Allow disabling the tx checksums on the xen loopback interface, which is used for the virtual interfaces of dom0 instead of netfront/netback. I need to issue ethtool -K eth0 tx off to work around a bad checksum problem, which has been reported for domUs a few months ago. I'm bridging dom0's eth0 to a domU where I do NAT to a different virtual interface. Without this change, I get lots of packets with bad checksums. Signed-off-by: Jan Niehusmann --- diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c b/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c index 31f7978af8..58a717e36f 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c @@ -27,6 +27,7 @@ #include #include #include +#include #include static int nloopbacks = 8; @@ -122,6 +123,12 @@ static void loopback_construct(struct net_device *dev, struct net_device *lo) /*dev->mtu = 16*1024;*/ } +static struct ethtool_ops network_ethtool_ops = +{ + .get_tx_csum = ethtool_op_get_tx_csum, + .set_tx_csum = ethtool_op_set_tx_csum, +}; + static int __init make_loopback(int i) { struct net_device *dev1, *dev2; @@ -141,6 +148,8 @@ static int __init make_loopback(int i) dev1->features |= NETIF_F_NO_CSUM; dev2->features |= NETIF_F_IP_CSUM; + SET_ETHTOOL_OPS(dev2, &network_ethtool_ops); + /* * Initialise a dummy MAC address for the 'dummy backend' interface. We * choose the numerically largest non-broadcast address to prevent the