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 accel: cleanup accelerators

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] netfront accel: cleanup accelerators list on netfront unload
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 Oct 2007 15:00:51 -0700
Delivery-date: Wed, 31 Oct 2007 15:02:52 -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 Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1193765666 0
# Node ID c807b5387fbba317b03bc0e5787edf3b2d4d2c52
# Parent  d85cb3fd1011b1e3e086efc4e682a2b0e1732481
netfront accel: cleanup accelerators list on netfront unload
Signed-off-by <kmansley@xxxxxxxxxxxxxx>
---
 drivers/xen/netfront/accel.c    |   18 ++++++++++++++++++
 drivers/xen/netfront/netfront.c |    2 ++
 drivers/xen/netfront/netfront.h |    2 ++
 3 files changed, 22 insertions(+)

diff -r d85cb3fd1011 -r c807b5387fbb drivers/xen/netfront/accel.c
--- a/drivers/xen/netfront/accel.c      Tue Oct 30 17:33:49 2007 +0000
+++ b/drivers/xen/netfront/accel.c      Tue Oct 30 17:34:26 2007 +0000
@@ -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 d85cb3fd1011 -r c807b5387fbb drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c   Tue Oct 30 17:33:49 2007 +0000
+++ b/drivers/xen/netfront/netfront.c   Tue Oct 30 17:34:26 2007 +0000
@@ -2210,6 +2210,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 d85cb3fd1011 -r c807b5387fbb drivers/xen/netfront/netfront.h
--- a/drivers/xen/netfront/netfront.h   Tue Oct 30 17:33:49 2007 +0000
+++ b/drivers/xen/netfront/netfront.h   Tue Oct 30 17:34:26 2007 +0000
@@ -293,6 +293,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,

_______________________________________________
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 accel: cleanup accelerators list on netfront unload, Xen patchbot-linux-2.6.18-xen <=