[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH] Remove erroneous use of transmitter DPC



If the backend does not support split event channels then the transmitter
DPC should not be used, and it contains an assertion to that effect.
The ring enable function, however, unconditionally queues the DPC leading
to an assertion failure. This patch makes sure the DPC is only queued if
the backend does indeed support split event channels.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/xenvif/transmitter.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/xenvif/transmitter.c b/src/xenvif/transmitter.c
index 1a3e26f..b833ab6 100644
--- a/src/xenvif/transmitter.c
+++ b/src/xenvif/transmitter.c
@@ -2683,11 +2683,10 @@ TransmitterRingDpc(
     ASSERT(Ring != NULL);
 
     Transmitter = Ring->Transmitter;
+    ASSERT(Transmitter->Split);
 
-    if (Ring->Enabled) {
-        ASSERT(Transmitter->Split);
+    if (Ring->Enabled)
         __TransmitterRingNotify(Ring);
-    }
 
     __TransmitterRingUnmask(Ring);
 }
@@ -2696,16 +2695,20 @@ KSERVICE_ROUTINE    TransmitterRingEvtchnCallback;
 
 BOOLEAN
 TransmitterRingEvtchnCallback(
-    IN  PKINTERRUPT         InterruptObject,
-    IN  PVOID               Argument
+    IN  PKINTERRUPT             InterruptObject,
+    IN  PVOID                   Argument
     )
 {
     PXENVIF_TRANSMITTER_RING    Ring = Argument;
+    PXENVIF_TRANSMITTER         Transmitter;
 
     UNREFERENCED_PARAMETER(InterruptObject);
 
     ASSERT(Ring != NULL);
 
+    Transmitter = Ring->Transmitter;
+    ASSERT(Transmitter->Split);
+
     Ring->Events++;
 
     if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
@@ -3256,12 +3259,17 @@ __TransmitterRingEnable(
     IN  PXENVIF_TRANSMITTER_RING    Ring
     )
 {
+    PXENVIF_TRANSMITTER             Transmitter;
+
+    Transmitter = Ring->Transmitter;
+
     __TransmitterRingAcquireLock(Ring);
 
     ASSERT(!Ring->Enabled);
     Ring->Enabled = TRUE;
 
-    if (KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
+    if (Transmitter->Split &&
+        KeInsertQueueDpc(&Ring->Dpc, NULL, NULL))
         Ring->Dpcs++;
 
     __TransmitterRingReleaseLock(Ring);
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.