Herbert Xu
2006-Aug-16 01:11 UTC
[Xen-devel] [NET] front: Fix features on resume when csum is off
Hi Keir: [NET] front: Fix features on resume when csum is off When the netfront driver is resumed the features are renegotiated with the backend. However, I forgot take into account the status of the TX checksum setting. When TX checksum is disabled by the user, we cannot enable SG or TSO since both require checksum offload. This patch makes xennet check the checksum setting before renegotiating SG or TSO. This bug was fixed thanks to a report from Anton Burtsev. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff -r ec03b24a2d83 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Tue Aug 15 19:53:55 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Wed Aug 16 11:07:11 2006 +1000 @@ -1369,6 +1369,9 @@ static void xennet_set_features(struct n dev->features |= NETIF_F_GSO_ROBUST; xennet_set_sg(dev, 0); + if (!(dev->features & NETIF_F_IP_CSUM)) + return; + if (!xennet_set_sg(dev, 1)) xennet_set_tso(dev, 1); } _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Aug-16 13:00 UTC
[Xen-devel] Re: [NET] front: Fix features on resume when csum is off
On 16/8/06 2:11 am, "Herbert Xu" <herbert@gondor.apana.org.au> wrote:> [NET] front: Fix features on resume when csum is off > > When the netfront driver is resumed the features are renegotiated with > the backend. However, I forgot take into account the status of the TX > checksum setting. When TX checksum is disabled by the user, we cannot > enable SG or TSO since both require checksum offload. This patch makes > xennet check the checksum setting before renegotiating SG or TSO.This seems a bit odd. Shouldn''t it be up to the network stack to not use SG/TSO if it can''t use them with a non-checksumming interface? What is the failure mode currently? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Herbert Xu
2006-Aug-16 13:04 UTC
[Xen-devel] Re: [NET] front: Fix features on resume when csum is off
On Wed, Aug 16, 2006 at 02:00:02PM +0100, Keir Fraser wrote:> > This seems a bit odd. Shouldn''t it be up to the network stack to not use > SG/TSO if it can''t use them with a non-checksumming interface? What is the > failure mode currently?As it is it''s the partly the responsibility of the drivers to maintain the consistency of the features set. The network stack assists this task by turning off SG/TSO when TX checksum is turned off through ethtool. It also ensures that when the user tries to enable SG/TSO that TX checksum must be enabled. In this case, SG/TSO is being turned on by the driver (as opposed to the user) so the driver needs to ensure that TX checksum is supported. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Herbert Xu
2006-Aug-16 13:26 UTC
[Xen-devel] Re: [NET] front: Fix features on resume when csum is off
On Wed, Aug 16, 2006 at 11:04:25PM +1000, herbert wrote:> On Wed, Aug 16, 2006 at 02:00:02PM +0100, Keir Fraser wrote: > > > > This seems a bit odd. Shouldn''t it be up to the network stack to not use > > SG/TSO if it can''t use them with a non-checksumming interface? What is the > > failure mode currently?I forgot to answer the second part of your question :) 1) Turn off TX checksum with ethtool in domU. 2) Suspend domU. 3) Resume domU. If you run ethtool now you''ll see that TX checksum is off while SG/TSO is on. If you send anything out bigger than one MTU through TCP it''ll get dropped. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel