From: Kieran Mansley Subject: [Patch 3/8] Netfront accelerator bug fixes Date: Tue, 30 Oct 2007 17:07:47 +0000 Message-ID: <1193764067.4223.115.camel@moonstone.uk.level5networks.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-EFzAdv7hCc14h3d8zsXo" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-EFzAdv7hCc14h3d8zsXo Content-Type: text/plain Content-Transfer-Encoding: 7bit Remove backend changed accelerator hook Signed-off-by diff -r 7f2237e423b7 drivers/xen/netfront/accel.c --- a/drivers/xen/netfront/accel.c Tue Oct 30 13:22:35 2007 +0000 +++ b/drivers/xen/netfront/accel.c Tue Oct 30 13:23:13 2007 +0000 @@ -813,40 +813,6 @@ void netfront_accelerator_resume(struct } -void netfront_accelerator_call_backend_changed(struct netfront_info *np, - struct xenbus_device *dev, - enum xenbus_state backend_state) -{ - struct netfront_accel_hooks *hooks; - unsigned flags; - - /* - * Call the backend_changed accelerator hook. The use count - * for the accelerator's hooks is incremented for the duration - * of the call to prevent the accelerator being able to modify - * the hooks in the middle (by, for example, unloading) - */ - if (np->accel_vif_state.hooks) { - spin_lock_irqsave(&np->accelerator->vif_states_lock, flags); - hooks = np->accel_vif_state.hooks; - if (hooks) { - kref_get(&np->accel_vif_state.vif_kref); - spin_unlock_irqrestore - (&np->accelerator->vif_states_lock, flags); - - np->accel_vif_state.hooks->backend_changed - (dev, backend_state); - - kref_put(&np->accel_vif_state.vif_kref, - vif_kref_release); - } else { - spin_unlock_irqrestore - (&np->accelerator->vif_states_lock, flags); - } - } -} - - void netfront_accelerator_call_stop_napi_irq(struct netfront_info *np, struct net_device *dev) { diff -r 7f2237e423b7 drivers/xen/netfront/netfront.c --- a/drivers/xen/netfront/netfront.c Tue Oct 30 13:22:35 2007 +0000 +++ b/drivers/xen/netfront/netfront.c Tue Oct 30 13:24:00 2007 +0000 @@ -549,8 +549,6 @@ static void backend_changed(struct xenbu xenbus_frontend_closed(dev); break; } - - netfront_accelerator_call_backend_changed(np, dev, backend_state); } /** Send a packet on a net device to encourage switches to learn the diff -r 7f2237e423b7 drivers/xen/netfront/netfront.h --- a/drivers/xen/netfront/netfront.h Tue Oct 30 13:22:35 2007 +0000 +++ b/drivers/xen/netfront/netfront.h Tue Oct 30 13:23:42 2007 +0000 @@ -63,12 +63,6 @@ struct netfront_accel_hooks { * remove: Opposite of new_device */ int (*remove)(struct xenbus_device *dev); - /* - * backend_changed: Callback from watch based on backend's - * xenbus state changing - */ - void (*backend_changed)(struct xenbus_device *dev, - enum xenbus_state backend_state); /* * The net_device is being polled, check the accelerated * hardware for any pending packets @@ -287,10 +281,6 @@ void netfront_accelerator_resume(struct void netfront_accelerator_resume(struct netfront_info *np, struct xenbus_device *dev); extern -void netfront_accelerator_call_backend_changed(struct netfront_info *np, - struct xenbus_device *dev, - enum xenbus_state backend_state); -extern void netfront_accelerator_call_stop_napi_irq(struct netfront_info *np, struct net_device *dev); extern --=-EFzAdv7hCc14h3d8zsXo Content-Disposition: attachment; filename=remove_backend_changed Content-Type: text/plain; name=remove_backend_changed; charset=UTF-8 Content-Transfer-Encoding: 7bit Remove backend changed accelerator hook diff -r 7f2237e423b7 drivers/xen/netfront/accel.c --- a/drivers/xen/netfront/accel.c Tue Oct 30 13:22:35 2007 +0000 +++ b/drivers/xen/netfront/accel.c Tue Oct 30 13:23:13 2007 +0000 @@ -813,40 +813,6 @@ void netfront_accelerator_resume(struct } -void netfront_accelerator_call_backend_changed(struct netfront_info *np, - struct xenbus_device *dev, - enum xenbus_state backend_state) -{ - struct netfront_accel_hooks *hooks; - unsigned flags; - - /* - * Call the backend_changed accelerator hook. The use count - * for the accelerator's hooks is incremented for the duration - * of the call to prevent the accelerator being able to modify - * the hooks in the middle (by, for example, unloading) - */ - if (np->accel_vif_state.hooks) { - spin_lock_irqsave(&np->accelerator->vif_states_lock, flags); - hooks = np->accel_vif_state.hooks; - if (hooks) { - kref_get(&np->accel_vif_state.vif_kref); - spin_unlock_irqrestore - (&np->accelerator->vif_states_lock, flags); - - np->accel_vif_state.hooks->backend_changed - (dev, backend_state); - - kref_put(&np->accel_vif_state.vif_kref, - vif_kref_release); - } else { - spin_unlock_irqrestore - (&np->accelerator->vif_states_lock, flags); - } - } -} - - void netfront_accelerator_call_stop_napi_irq(struct netfront_info *np, struct net_device *dev) { diff -r 7f2237e423b7 drivers/xen/netfront/netfront.c --- a/drivers/xen/netfront/netfront.c Tue Oct 30 13:22:35 2007 +0000 +++ b/drivers/xen/netfront/netfront.c Tue Oct 30 13:24:00 2007 +0000 @@ -549,8 +549,6 @@ static void backend_changed(struct xenbu xenbus_frontend_closed(dev); break; } - - netfront_accelerator_call_backend_changed(np, dev, backend_state); } /** Send a packet on a net device to encourage switches to learn the diff -r 7f2237e423b7 drivers/xen/netfront/netfront.h --- a/drivers/xen/netfront/netfront.h Tue Oct 30 13:22:35 2007 +0000 +++ b/drivers/xen/netfront/netfront.h Tue Oct 30 13:23:42 2007 +0000 @@ -63,12 +63,6 @@ struct netfront_accel_hooks { * remove: Opposite of new_device */ int (*remove)(struct xenbus_device *dev); - /* - * backend_changed: Callback from watch based on backend's - * xenbus state changing - */ - void (*backend_changed)(struct xenbus_device *dev, - enum xenbus_state backend_state); /* * The net_device is being polled, check the accelerated * hardware for any pending packets @@ -287,10 +281,6 @@ void netfront_accelerator_resume(struct void netfront_accelerator_resume(struct netfront_info *np, struct xenbus_device *dev); extern -void netfront_accelerator_call_backend_changed(struct netfront_info *np, - struct xenbus_device *dev, - enum xenbus_state backend_state); -extern void netfront_accelerator_call_stop_napi_irq(struct netfront_info *np, struct net_device *dev); extern --=-EFzAdv7hCc14h3d8zsXo Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-EFzAdv7hCc14h3d8zsXo--