[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [NET] back: Fix off-by-one error in netbk_tx_err



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 18abc9eb9a311863529a1b7ee536bf2b3c8b2eb8
# Parent  ef80b6e4e03ab973d062f6b3bf9ca023c3ffe922
[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@xxxxxxxxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/netback/netback.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r ef80b6e4e03a -r 18abc9eb9a31 
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
--- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Mon Jul 03 
08:56:29 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c        Mon Jul 03 
08:57:15 2006 +0100
@@ -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);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.