From: Herbert Xu Subject: [1/4] [NET] back: Fix off-by-one error in netbk_tx_err Date: Mon, 3 Jul 2006 14:44:45 +1000 Message-ID: <20060703044445.GA22928@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 Keir: Here are the GSO changes again which should address your concerns. Let me know if you have any other problems. [NET] back: Fix off-by-one error in netbk_tx_err The generalised extra request info patch introduced a bug with the use of netbk_tx_err since it advanced the req_cons pointer by one. This patch fixes thing by delaying the increment in netbk_tx_err. 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 3fe11185adfb -r 3656a2985ae1 linux-2.6-xen-sparse/drivers/xen/netback/netback.c --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Sat Jul 01 09:37:24 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Mon Jul 03 14:18:54 2006 +1000 @@ -496,9 +496,9 @@ static void netbk_tx_err(netif_t *netif, do { make_tx_response(netif, txp, NETIF_RSP_ERROR); - if (++cons >= end) + if (cons >= end) break; - txp = RING_GET_REQUEST(&netif->tx, cons); + txp = RING_GET_REQUEST(&netif->tx, cons++); } while (1); netif->tx.req_cons = cons; netif_schedule_work(netif); @@ -764,11 +764,11 @@ static void net_tx_action(unsigned long if (txreq.flags & NETTXF_extra_info) { work_to_do = netbk_get_extras(netif, extras, work_to_do); + i = netif->tx.req_cons; if (unlikely(work_to_do < 0)) { - netbk_tx_err(netif, &txreq, 0); + netbk_tx_err(netif, &txreq, i); continue; } - i = netif->tx.req_cons; } ret = netbk_count_requests(netif, &txreq, work_to_do);