ia64/xen-unstable
changeset 10641:18abc9eb9a31
[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 <herbert@gondor.apana.org.au>
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 <herbert@gondor.apana.org.au>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Mon Jul 03 08:57:15 2006 +0100 (2006-07-03) |
parents | ef80b6e4e03a |
children | 4b9876fe2f1f |
files | linux-2.6-xen-sparse/drivers/xen/netback/netback.c |
line diff
1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Mon Jul 03 08:56:29 2006 +0100 1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c Mon Jul 03 08:57:15 2006 +0100 1.3 @@ -496,9 +496,9 @@ static void netbk_tx_err(netif_t *netif, 1.4 1.5 do { 1.6 make_tx_response(netif, txp, NETIF_RSP_ERROR); 1.7 - if (++cons >= end) 1.8 + if (cons >= end) 1.9 break; 1.10 - txp = RING_GET_REQUEST(&netif->tx, cons); 1.11 + txp = RING_GET_REQUEST(&netif->tx, cons++); 1.12 } while (1); 1.13 netif->tx.req_cons = cons; 1.14 netif_schedule_work(netif); 1.15 @@ -764,11 +764,11 @@ static void net_tx_action(unsigned long 1.16 if (txreq.flags & NETTXF_extra_info) { 1.17 work_to_do = netbk_get_extras(netif, extras, 1.18 work_to_do); 1.19 + i = netif->tx.req_cons; 1.20 if (unlikely(work_to_do < 0)) { 1.21 - netbk_tx_err(netif, &txreq, 0); 1.22 + netbk_tx_err(netif, &txreq, i); 1.23 continue; 1.24 } 1.25 - i = netif->tx.req_cons; 1.26 } 1.27 1.28 ret = netbk_count_requests(netif, &txreq, work_to_do);