From: Herbert Xu Subject: [4/4] [NET] front: Zero negotiated bits in xen_set_features Date: Mon, 3 Jul 2006 14:46:33 +1000 Message-ID: <20060703044633.GD22928@gondor.apana.org.au> References: <20060630124703.GA23466@gondor.apana.org.au> <69ce918a310b3e9597230c7d8521eed3@cl.cam.ac.uk> <20060630132141.GA23719@gondor.apana.org.au> <6119c0c588ef3a01c19119bda86298fd@cl.cam.ac.uk> <20060701032609.GA29803@gondor.apana.org.au> <20060701033315.GA30050@gondor.apana.org.au> <69b713d882b30e730f7e83514eebe737@cl.cam.ac.uk> <20060701095948.GA387@gondor.apana.org.au> <20060701123825.GA4387@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20060701123825.GA4387@gondor.apana.org.au> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen Development Mailing List List-Id: xen-devel@lists.xenproject.org Hi: [NET] front: Zero negotiated bits in xen_set_features When we reconnect to the backend we need to first zero all negotiated bits as the functions xen_set_sg and xen_set_tso do not (and are not supposed to) zero bits when they fail to set them. This patch also permanently enables the NETIF_F_GSO_ROBUST bit as we never parse any GSO fields ourselves (even if we did the backend could not trust us so it's wasted effort). Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff -r 8c5fd9867b3c -r 531033849420 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Mon Jul 03 14:35:47 2006 +1000 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Mon Jul 03 14:42:09 2006 +1000 @@ -1112,6 +1112,11 @@ static int xennet_set_tso(struct net_dev static void xennet_set_features(struct net_device *dev) { + /* Turn off all GSO bits except ROBUST. */ + dev->features &= (1 << NETIF_F_GSO_SHIFT) - 1; + dev->features |= NETIF_F_GSO_ROBUST; + xennet_set_sg(dev, 0); + if (!xennet_set_sg(dev, 1)) xennet_set_tso(dev, 1); }