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] [linux-2.6.18-xen] Netfront accelerator bug fix

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] Netfront accelerator bug fix
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Nov 2007 13:50:12 -0800
Delivery-date: Fri, 23 Nov 2007 13:50:43 -0800
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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1195835216 0
# Node ID fd879c0688bf123a85dcfa371f863da3542ab8af
# Parent  a9f723af5e187da97efe374ffd5b7ca8cf493a36
Netfront accelerator bug fix

In testing Xen for the upcoming 3.2.0 release, we've found a bug in
the netfront accelerator support where if an accelerator was removed
before it had properly initialised it wasn't handled correctly.

Signed-off-by: Kieran Mansley <kmansley@xxxxxxxxxxxxxx>
---
 drivers/xen/netfront/accel.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff -r a9f723af5e18 -r fd879c0688bf drivers/xen/netfront/accel.c
--- a/drivers/xen/netfront/accel.c      Thu Nov 22 14:28:31 2007 +0000
+++ b/drivers/xen/netfront/accel.c      Fri Nov 23 16:26:56 2007 +0000
@@ -465,15 +465,18 @@ static void accelerator_remove_hooks(str
                                 link) {
                spin_lock_irqsave(&accelerator->vif_states_lock, flags);
 
-               BUG_ON(vif_state->hooks == NULL);
-               hooks = vif_state->hooks;
-               accelerator_remove_single_hook(accelerator, vif_state);
+               if(vif_state->hooks) {
+                       hooks = vif_state->hooks;
+                       accelerator_remove_single_hook(accelerator, vif_state);
+                       
+                       /* Last chance to get statistics from the accelerator */
+                       hooks->get_stats(vif_state->np->netdev,
+                                        &vif_state->np->stats);
+               }
 
                spin_unlock_irqrestore(&accelerator->vif_states_lock, flags);
 
-               /* Last chance to get statistics from the accelerator */
-               hooks->get_stats(vif_state->np->netdev, &vif_state->np->stats);
-               hooks->remove(vif_state->dev);
+               accelerator->hooks->remove(vif_state->dev);
        }
        
        accelerator->hooks = NULL;
@@ -530,15 +533,16 @@ static int do_remove(struct netfront_inf
 
                /* Last chance to get statistics from the accelerator */
                hooks->get_stats(np->netdev, &np->stats);
-
+       }
+
+       if (accelerator->hooks) {
                spin_unlock_irqrestore(&accelerator->vif_states_lock, 
                                       *lock_flags);
 
-               rc = hooks->remove(dev);
+               rc = accelerator->hooks->remove(dev);
 
                spin_lock_irqsave(&accelerator->vif_states_lock, *lock_flags);
        }
-
  
        return rc;
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] Netfront accelerator bug fix, Xen patchbot-linux-2.6.18-xen <=