netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: xen-netback: correctly restart Tx after a VM restore/migrate
@ 2011-09-30 16:37 David Vrabel
  2011-09-30 16:45 ` Ian Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: David Vrabel @ 2011-09-30 16:37 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, xen-devel, David Vrabel, Ian Campbell

If a VM is saved and restored (or migrated) the netback driver will no
longer process any Tx packets from the frontend.  xenvif_up() does not
schedule the processing of any pending Tx requests from the front end
because the carrier is off.  Without this initial kick the frontend
just adds Tx requests to the ring without raising an event (until the
ring is full).

This was caused by 47103041e91794acdbc6165da0ae288d844c820b (net:
xen-netback: convert to hw_features) which reordered the calls to
xenvif_up() and netif_carrier_on() in xenvif_connect().

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
 drivers/net/xen-netback/interface.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 0ca86f9..1825629 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -327,12 +327,12 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
 	xenvif_get(vif);
 
 	rtnl_lock();
-	if (netif_running(vif->dev))
-		xenvif_up(vif);
 	if (!vif->can_sg && vif->dev->mtu > ETH_DATA_LEN)
 		dev_set_mtu(vif->dev, ETH_DATA_LEN);
 	netdev_update_features(vif->dev);
 	netif_carrier_on(vif->dev);
+	if (netif_running(vif->dev))
+		xenvif_up(vif);
 	rtnl_unlock();
 
 	return 0;
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: xen-netback: correctly restart Tx after a VM restore/migrate
  2011-09-30 16:37 [PATCH] net: xen-netback: correctly restart Tx after a VM restore/migrate David Vrabel
@ 2011-09-30 16:45 ` Ian Campbell
  2011-10-03 18:16   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2011-09-30 16:45 UTC (permalink / raw)
  To: David Vrabel
  Cc: netdev@vger.kernel.org, xen-devel@lists.xensource.com,
	David S. Miller

On Fri, 2011-09-30 at 17:37 +0100, David Vrabel wrote:
> If a VM is saved and restored (or migrated) the netback driver will no
> longer process any Tx packets from the frontend.  xenvif_up() does not
> schedule the processing of any pending Tx requests from the front end
> because the carrier is off.  Without this initial kick the frontend
> just adds Tx requests to the ring without raising an event (until the
> ring is full).
> 
> This was caused by 47103041e91794acdbc6165da0ae288d844c820b (net:
> xen-netback: convert to hw_features) which reordered the calls to
> xenvif_up() and netif_carrier_on() in xenvif_connect().

Ah, so the bit of that patch which moved "netif_carrier_on(vif->dev);"
should have actually moved the entire block
 	netif_carrier_on(vif->dev);
	if (netif_running(vif->dev))
		xenvif_up(vif);

Since it it is logically a single thing. Make sense. Thanks!

> Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

Ian.

> ---
>  drivers/net/xen-netback/interface.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index 0ca86f9..1825629 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -327,12 +327,12 @@ int xenvif_connect(struct xenvif *vif, unsigned long tx_ring_ref,
>  	xenvif_get(vif);
>  
>  	rtnl_lock();
> -	if (netif_running(vif->dev))
> -		xenvif_up(vif);
>  	if (!vif->can_sg && vif->dev->mtu > ETH_DATA_LEN)
>  		dev_set_mtu(vif->dev, ETH_DATA_LEN);
>  	netdev_update_features(vif->dev);
>  	netif_carrier_on(vif->dev);
> +	if (netif_running(vif->dev))
> +		xenvif_up(vif);
>  	rtnl_unlock();
>  
>  	return 0;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: xen-netback: correctly restart Tx after a VM restore/migrate
  2011-09-30 16:45 ` Ian Campbell
@ 2011-10-03 18:16   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-10-03 18:16 UTC (permalink / raw)
  To: Ian.Campbell; +Cc: david.vrabel, netdev, xen-devel

From: Ian Campbell <Ian.Campbell@eu.citrix.com>
Date: Fri, 30 Sep 2011 17:45:05 +0100

> On Fri, 2011-09-30 at 17:37 +0100, David Vrabel wrote:
>> If a VM is saved and restored (or migrated) the netback driver will no
>> longer process any Tx packets from the frontend.  xenvif_up() does not
>> schedule the processing of any pending Tx requests from the front end
>> because the carrier is off.  Without this initial kick the frontend
>> just adds Tx requests to the ring without raising an event (until the
>> ring is full).
>> 
>> This was caused by 47103041e91794acdbc6165da0ae288d844c820b (net:
>> xen-netback: convert to hw_features) which reordered the calls to
>> xenvif_up() and netif_carrier_on() in xenvif_connect().
> 
> Ah, so the bit of that patch which moved "netif_carrier_on(vif->dev);"
> should have actually moved the entire block
>  	netif_carrier_on(vif->dev);
> 	if (netif_running(vif->dev))
> 		xenvif_up(vif);
> 
> Since it it is logically a single thing. Make sense. Thanks!
> 
>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-03 18:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-30 16:37 [PATCH] net: xen-netback: correctly restart Tx after a VM restore/migrate David Vrabel
2011-09-30 16:45 ` Ian Campbell
2011-10-03 18:16   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).