Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-06-14 23:08:50 +0200
committerJiri Kosina <jkosina@suse.cz>2010-06-14 23:08:50 +0200
commit9bd7c8d4e307e0ad85589dec1265e3f83c682538 (patch)
treea605ecb16d1c8da753a16d3be155c391e73816cc
parent2e4820bd9dcd126ae196e99d781493caf6165e52 (diff)
- patches.fixes/virtio_net-Add-napi-schedule-to-napi_enable-call.patch:
virtio_net: Add napi schedule to napi_enable call (bnc#606797).
-rw-r--r--kernel-source.changes6
-rw-r--r--patches.fixes/virtio_net-Add-napi-schedule-to-napi_enable-call.patch71
-rw-r--r--series.conf1
3 files changed, 78 insertions, 0 deletions
diff --git a/kernel-source.changes b/kernel-source.changes
index 0a3c11923a..a1df42b98a 100644
--- a/kernel-source.changes
+++ b/kernel-source.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Jun 14 23:08:46 CEST 2010 - jkosina@suse.cz
+
+- patches.fixes/virtio_net-Add-napi-schedule-to-napi_enable-call.patch:
+ virtio_net: Add napi schedule to napi_enable call (bnc#606797).
+
+-------------------------------------------------------------------
Mon Jun 14 19:34:45 CEST 2010 - jkosina@suse.cz
- patches.fixes/virtio_net-make-delayed-refill-more-reliable.patch:
diff --git a/patches.fixes/virtio_net-Add-napi-schedule-to-napi_enable-call.patch b/patches.fixes/virtio_net-Add-napi-schedule-to-napi_enable-call.patch
new file mode 100644
index 0000000000..777649a14f
--- /dev/null
+++ b/patches.fixes/virtio_net-Add-napi-schedule-to-napi_enable-call.patch
@@ -0,0 +1,71 @@
+From: Bruce Rogers <brogers@novell.com>
+Subject: virtio_net: Add napi schedule to napi_enable call
+Patch-mainline: not yet
+References: bnc#606797
+
+ virtio_net: Add schedule check to napi_enable call
+ Under harsh testing conditions, including low memory, the guest would
+ stop receiving packets. With this patch applied we no longer see any
+ problems in the driver while performing these tests for extended periods
+ of time.
+
+ Make sure napi is scheduled subsequent to each napi_enable.
+
+ Signed-off-by: Bruce Rogers <brogers@novell.com>
+ Signed-off-by: Olaf Kirch <okir@suse.de>
+ Acked-by: Rusty Russell <rusty@rustcorp.com.au>
+
+Acked-by: Jiri Kosina <jkosina@suse.cz>
+
+Index: linux-2.6.32-SLE11-SP1/drivers/net/virtio_net.c
+===================================================================
+--- linux-2.6.32-SLE11-SP1.orig/drivers/net/virtio_net.c
++++ linux-2.6.32-SLE11-SP1/drivers/net/virtio_net.c
+@@ -388,6 +388,20 @@ static void skb_recv_done(struct virtque
+ }
+ }
+
++static void virtnet_napi_enable(struct virtnet_info *vi)
++{
++ napi_enable(&vi->napi);
++
++ /* If all buffers were filled by other side before we napi_enabled, we
++ * won't get another interrupt, so process any outstanding packets
++ * now. virtnet_poll wants re-enable the queue, so we disable here.
++ * We synchronize against interrupts via NAPI_STATE_SCHED */
++ if (napi_schedule_prep(&vi->napi)) {
++ vi->rvq->vq_ops->disable_cb(vi->rvq);
++ __napi_schedule(&vi->napi);
++ }
++}
++
+ static void refill_work(struct work_struct *work)
+ {
+ struct virtnet_info *vi;
+@@ -396,7 +410,7 @@ static void refill_work(struct work_stru
+ vi = container_of(work, struct virtnet_info, refill.work);
+ napi_disable(&vi->napi);
+ still_empty = !try_fill_recv(vi, GFP_KERNEL);
+- napi_enable(&vi->napi);
++ virtnet_napi_enable(vi);
+
+ /* In theory, this can happen: if we don't get any buffers in
+ * we will *never* try to fill again. */
+@@ -588,16 +602,8 @@ static int virtnet_open(struct net_devic
+ {
+ struct virtnet_info *vi = netdev_priv(dev);
+
+- napi_enable(&vi->napi);
++ virtnet_napi_enable(vi);
+
+- /* If all buffers were filled by other side before we napi_enabled, we
+- * won't get another interrupt, so process any outstanding packets
+- * now. virtnet_poll wants re-enable the queue, so we disable here.
+- * We synchronize against interrupts via NAPI_STATE_SCHED */
+- if (napi_schedule_prep(&vi->napi)) {
+- vi->rvq->vq_ops->disable_cb(vi->rvq);
+- __napi_schedule(&vi->napi);
+- }
+ return 0;
+ }
+
diff --git a/series.conf b/series.conf
index f4307c4c96..11843aec29 100644
--- a/series.conf
+++ b/series.conf
@@ -1519,6 +1519,7 @@
patches.drivers/iw_cxgb3-dlpar.patch
patches.fixes/virtio_net-make-delayed-refill-more-reliable.patch
+ patches.fixes/virtio_net-Add-napi-schedule-to-napi_enable-call.patch
########################################################
# Wireless Networking