]> xenbits.xensource.com Git - people/pauldu/xenvif.git/commitdiff
Make sure transmitter DPC does not try to unmask non-existent evtchn
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 6 May 2016 08:51:30 +0000 (09:51 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Mon, 9 May 2016 09:00:28 +0000 (10:00 +0100)
In the case where the backend does not support split event channels (one
for RX and one for TX) then the transmitter code in XENVIF does not open
the combined channel; it is handled by the receiver code. So, the
transmitter DPC should not make any attempt to unmask the event channel at
the end of processing.

This patch adds the necessary check for FrontendIsSplit before doing the
unmask and also removes an unnecessary check for FrontendIsSplit in the
transmitter ring enable function.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reported-by: Eytan Heidingsfeld <eytanh@gmail.com>
Tested-by: Eytan Heidingsfeld <eytanh@gmail.com>
src/xenvif/transmitter.c

index 5289c6ce3b471d738c67ea523d9b14986936018b..9406cab632ef83dbb6a2a746ed103b3c16ebddc9 100644 (file)
@@ -2921,11 +2921,13 @@ __TransmitterRingUnmask(
     )
 {
     PXENVIF_TRANSMITTER             Transmitter;
-
-    if (!Ring->Connected)
-        return;
+    PXENVIF_FRONTEND                Frontend;
 
     Transmitter = Ring->Transmitter;
+    Frontend = Transmitter->Frontend;
+
+    if (!Ring->Connected || !FrontendIsSplit(Frontend))
+        return;
 
     XENBUS_EVTCHN(Unmask,
                   &Transmitter->EvtchnInterface,
@@ -3607,8 +3609,7 @@ __TransmitterRingEnable(
     ASSERT(!Ring->Enabled);
     Ring->Enabled = TRUE;
 
-    if (FrontendIsSplit(Frontend))
-        KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
+    KeInsertQueueDpc(&Ring->Dpc, NULL, NULL);
 
     __TransmitterRingReleaseLock(Ring);