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-devel

[Xen-devel] [Patch 6/8] Netfront accelerator bug fixes

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [Patch 6/8] Netfront accelerator bug fixes
From: Kieran Mansley <kmansley@xxxxxxxxxxxxxx>
Date: Tue, 30 Oct 2007 17:07:59 +0000
Delivery-date: Tue, 30 Oct 2007 10:12:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
cleanup accelerators list on netfront unload

Signed-off-by <kmansley@xxxxxxxxxxxxxx>

diff -r fdfd708d2ec4 drivers/xen/netfront/accel.c
--- a/drivers/xen/netfront/accel.c      Wed Oct 24 15:38:35 2007 +0100
+++ b/drivers/xen/netfront/accel.c      Wed Oct 24 16:25:57 2007 +0100
@@ -75,6 +75,24 @@ void netif_init_accel(void)
        spin_lock_init(&accelerators_lock);
 }
 
+void netif_exit_accel(void)
+{
+       struct netfront_accelerator *accelerator, *tmp;
+       unsigned flags;
+
+       spin_lock_irqsave(&accelerators_lock, flags);
+
+       list_for_each_entry_safe(accelerator, tmp, &accelerators_list, link) {
+               BUG_ON(!list_empty(&accelerator->vif_states));
+
+               list_del(&accelerator->link);
+               kfree(accelerator->frontend);
+               kfree(accelerator);
+       }
+
+       spin_unlock_irqrestore(&accelerators_lock, flags);
+}
+
 
 /* 
  * Initialise the accel_vif_state field in the netfront state
diff -r fdfd708d2ec4 drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Wed Oct 24 15:38:35 2007 +0100
+++ b/drivers/xen/netfront/netfront.c   Wed Oct 24 15:57:26 2007 +0100
@@ -2212,6 +2212,8 @@ static void __exit netif_exit(void)
 
        unregister_inetaddr_notifier(&notifier_inetdev);
 
+       netif_exit_accel();
+
        return xenbus_unregister_driver(&netfront);
 }
 module_exit(netif_exit);
diff -r fdfd708d2ec4 drivers/xen/netfront/netfront.h
--- a/drivers/xen/netfront/netfront.h   Wed Oct 24 15:38:35 2007 +0100
+++ b/drivers/xen/netfront/netfront.h   Wed Oct 24 16:11:32 2007 +0100
@@ -306,6 +306,8 @@ int netfront_load_accelerator(struct net
 
 extern
 void netif_init_accel(void);
+extern
+void netif_exit_accel(void);
 
 extern
 void init_accelerator_vif(struct netfront_info *np,

Attachment: accelerator_list_cleanup
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [Patch 6/8] Netfront accelerator bug fixes, Kieran Mansley <=