[kernel] r16475 - in dists/sid/linux-2.6/debian: . patches/features/all/xen patches/series

Ian Campbell ijc-guest at alioth.debian.org
Sat Oct 23 10:34:49 UTC 2010


Author: ijc-guest
Date: Sat Oct 23 10:34:37 2010
New Revision: 16475

Log:
xen: additional fixes to netfront arising from disabling smartpoll
(Closes: #600992)

Added:
   dists/sid/linux-2.6/debian/patches/features/all/xen/Fix-one-race-condition-for-netfront-smartpoll-logic.patch
   dists/sid/linux-2.6/debian/patches/features/all/xen/xen-netfront-Fix-another-potential-race-condition.patch
   dists/sid/linux-2.6/debian/patches/features/all/xen/xen-netfront-unconditionally-initialize-smartpoll-hr.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/27-extra

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Fri Oct 22 22:19:34 2010	(r16474)
+++ dists/sid/linux-2.6/debian/changelog	Sat Oct 23 10:34:37 2010	(r16475)
@@ -11,6 +11,10 @@
     - execve: improve interactivity with large arguments
     - execve: make responsive to SIGKILL with large arguments
 
+  [ Ian Campbell ]
+  * xen: import additional fixes for disabling netfront smartpoll mode
+    (Closes: #600992).
+
  -- Ben Hutchings <ben at decadent.org.uk>  Tue, 19 Oct 2010 23:27:23 +0100
 
 linux-2.6 (2.6.32-26) unstable; urgency=high

Added: dists/sid/linux-2.6/debian/patches/features/all/xen/Fix-one-race-condition-for-netfront-smartpoll-logic.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/xen/Fix-one-race-condition-for-netfront-smartpoll-logic.patch	Sat Oct 23 10:34:37 2010	(r16475)
@@ -0,0 +1,49 @@
+From cb09635065163a933d0d00d077ddd9f0c0a908a1 Mon Sep 17 00:00:00 2001
+From: Dongxiao Xu <dongxiao.xu at intel.com>
+Date: Fri, 10 Sep 2010 09:00:54 +0800
+Subject: [PATCH] Fix one race condition for netfront smartpoll logic
+
+Assume one case like, netfront poll could not get any data,
+and it clears the shared flag to indicate it is not polling.
+However at this moment (netfront has cleared the flag but
+still in hrtimer callback), netback triggers one interrupt
+to netfront and tries to start the timer, the operation will
+be failed since the timer is still alive.
+
+Add this logic that, if the new hrtimer starts failed,
+netfront should clear the shared flag to indicate that it is
+not polling.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu at intel.com>
+Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+---
+ drivers/net/xen-netfront.c |   13 +++++++++----
+ 1 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
+index 6426bb8..02e7888 100644
+--- a/drivers/net/xen-netfront.c
++++ b/drivers/net/xen-netfront.c
+@@ -1401,10 +1401,15 @@ static irqreturn_t xennet_interrupt(int irq, void *dev_id)
+ 			napi_schedule(&np->napi);
+ 	}
+ 
+-	if (np->smart_poll.feature_smart_poll)
+-		hrtimer_start(&np->smart_poll.timer,
+-			ktime_set(0, NANO_SECOND/np->smart_poll.smart_poll_freq),
+-			HRTIMER_MODE_REL);
++	if (np->smart_poll.feature_smart_poll) {
++		if ( hrtimer_start(&np->smart_poll.timer,
++			ktime_set(0,NANO_SECOND/np->smart_poll.smart_poll_freq),
++			HRTIMER_MODE_REL) ) {
++			printk(KERN_DEBUG "Failed to start hrtimer,"
++					"use interrupt mode for this packet\n");
++			np->rx.sring->private.netif.smartpoll_active = 0;
++		}
++	}
+ 
+ 	spin_unlock_irqrestore(&np->tx_lock, flags);
+ 
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/xen/xen-netfront-Fix-another-potential-race-condition.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/xen/xen-netfront-Fix-another-potential-race-condition.patch	Sat Oct 23 10:34:37 2010	(r16475)
@@ -0,0 +1,40 @@
+From 00abe504c5cf268b73c45232aba56949af628349 Mon Sep 17 00:00:00 2001
+From: Dongxiao Xu <dongxiao.xu at intel.com>
+Date: Mon, 13 Sep 2010 10:17:58 +0800
+Subject: [PATCH] xen/netfront: Fix another potential race condition
+
+When trying to start next hrtimer in current callback,
+we should judge its return value and do error handling.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu at intel.com>
+Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+---
+ drivers/net/xen-netfront.c |   11 ++++++++---
+ 1 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
+index 02e7888..6661d6d 100644
+--- a/drivers/net/xen-netfront.c
++++ b/drivers/net/xen-netfront.c
+@@ -1376,10 +1376,15 @@ static enum hrtimer_restart smart_poll_function(struct hrtimer *timer)
+ 		np->smart_poll.active = 0;
+ 	}
+ 
+-	if (np->rx.sring->private.netif.smartpoll_active)
+-		hrtimer_start(timer,
++	if (np->rx.sring->private.netif.smartpoll_active) {
++		if ( hrtimer_start(timer,
+ 			ktime_set(0, NANO_SECOND/psmart_poll->smart_poll_freq),
+-			HRTIMER_MODE_REL);
++			HRTIMER_MODE_REL) ) {
++			printk(KERN_DEBUG "Failed to start hrtimer,"
++					"use interrupt mode for this packet\n");
++			np->rx.sring->private.netif.smartpoll_active = 0;
++		}
++	}
+ 
+ end:
+ 	spin_unlock_irqrestore(&np->tx_lock, flags);
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/features/all/xen/xen-netfront-unconditionally-initialize-smartpoll-hr.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/features/all/xen/xen-netfront-unconditionally-initialize-smartpoll-hr.patch	Sat Oct 23 10:34:37 2010	(r16475)
@@ -0,0 +1,34 @@
+From fad2197bcb570350cb03c4ed789015baf0f86c81 Mon Sep 17 00:00:00 2001
+From: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+Date: Thu, 16 Sep 2010 16:30:12 -0700
+Subject: [PATCH] xen/netfront: unconditionally initialize smartpoll hrtimer
+
+Make sure smartpoll.timer is properly initialized, even if we're not
+using it, so that hrtimer operations on it still work OK.  Specifically,
+this fixes a crash when suspending, as it tries to cancel any outstanding
+timer.
+
+Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge at citrix.com>
+---
+ drivers/net/xen-netfront.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
+index 6661d6d..47e6a71 100644
+--- a/drivers/net/xen-netfront.c
++++ b/drivers/net/xen-netfront.c
+@@ -1654,9 +1654,9 @@ static int xennet_connect(struct net_device *dev)
+ 			np->smart_poll.feature_smart_poll = 0;
+ 	}
+ 
++	hrtimer_init(&np->smart_poll.timer, CLOCK_MONOTONIC,
++		     HRTIMER_MODE_REL);
+ 	if (np->smart_poll.feature_smart_poll) {
+-		hrtimer_init(&np->smart_poll.timer, CLOCK_MONOTONIC,
+-			     HRTIMER_MODE_REL);
+ 		np->smart_poll.timer.function = smart_poll_function;
+ 		np->smart_poll.netdev = dev;
+ 		np->smart_poll.smart_poll_freq = DEFAULT_SMART_POLL_FREQ;
+-- 
+1.7.1
+

Modified: dists/sid/linux-2.6/debian/patches/series/27-extra
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/27-extra	Fri Oct 22 22:19:34 2010	(r16474)
+++ dists/sid/linux-2.6/debian/patches/series/27-extra	Sat Oct 23 10:34:37 2010	(r16475)
@@ -12,3 +12,6 @@
 + features/all/xen/pvops.patch featureset=xen
 + features/all/xen/xen-netfront-make-smartpoll-optional-and-default-off.patch featureset=xen
 + features/all/xen/xen-grant-table-do-not-truncate-machine-address-on-g.patch featureset=xen
++ features/all/xen/Fix-one-race-condition-for-netfront-smartpoll-logic.patch featureset=xen
++ features/all/xen/xen-netfront-Fix-another-potential-race-condition.patch featureset=xen
++ features/all/xen/xen-netfront-unconditionally-initialize-smartpoll-hr.patch featureset=xen



More information about the Kernel-svn-changes mailing list