WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [NET] back: Fix off-by-one error in netbk_tx_err
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 03 Jul 2006 10:20:54 +0000
Delivery-date: Mon, 03 Jul 2006 03:29:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [NET] back: Fix off-by-one error in netbk_tx_err, Xen patchbot-unstable <=