lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <143565.70888.qm@web110315.mail.gq1.yahoo.com>
Date:	Wed, 9 Feb 2011 03:04:10 -0800 (PST)
From:	Ken Stailey <kstailey@...oo.com>
To:	linux-kernel@...r.kernel.org
Subject: [PATCH] virtio-net: add schedule check to napi_enable call, kernel 2.6.38-RC4

Several people are experiencing virtio-net driver lock ups while attempting to do real work and this patch which was submitted in the past and ignored fixes that.  For details see:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/579276

--- drivers/net/virtio_net.c.orig    2011-02-08 14:34:51.444099190 -0500
+++ drivers/net/virtio_net.c    2011-02-08 14:18:00.484400134 -0500
@@ -446,6 +446,20 @@
     }
 }
 
+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)) {
+        virtqueue_disable_cb(vi->rvq);
+        __napi_schedule(&vi->napi);
+    }
+}
+
 static void refill_work(struct work_struct *work)
 {
     struct virtnet_info *vi;
@@ -454,7 +468,7 @@
     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. */
@@ -638,16 +652,7 @@
 {
     struct virtnet_info *vi = netdev_priv(dev);
 
-    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)) {
-        virtqueue_disable_cb(vi->rvq);
-        __napi_schedule(&vi->napi);
-    }
+    virtnet_napi_enable(vi);
     return 0;
 }


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ