From: Herbert Xu Subject: [NET] front: Fix features on resume when csum is off Date: Wed, 16 Aug 2006 11:11:22 +1000 Message-ID: <20060816011122.GA22978@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline 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 , Xen Development Mailing List Cc: Anton Burtsev List-Id: xen-devel@lists.xenproject.org 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 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 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); }