]> xenbits.xensource.com Git - pvdrivers/win/xenvif.git/commitdiff
Add an extra transmitter ring poll
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 2 Nov 2016 11:51:54 +0000 (11:51 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 2 Nov 2016 11:51:54 +0000 (11:51 +0000)
If we are trying to post fragments into the ring and find it full then
do a single poll to try to free up the space, rather than bailing and
waiting for the DPC to run.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenvif/transmitter.c

index 1c88c51859069f1fcc2c9e1a48a3222fe2ef6be8..82ef27107508b1a503b7240284ee2125c194165d 100644 (file)
@@ -2927,21 +2927,30 @@ TransmitterRingSchedule(
     )
 {
     PXENVIF_TRANSMITTER_STATE       State;
+    BOOLEAN                         Polled;
 
-    if(!Ring->Enabled || Ring->Stopped)
+    if(!Ring->Enabled)
         return;
 
     State = &Ring->State;
+    Polled = FALSE;
 
-    for (;;) {
+    while (!Ring->Stopped) {
         NTSTATUS    status;
 
         if (State->Count != 0) {
             status = __TransmitterRingPostFragments(Ring);
-            if (!NT_SUCCESS(status)) {
+            if (!NT_SUCCESS(status))
                 Ring->Stopped = TRUE;
-                break;
+        }
+
+        if (Ring->Stopped) {
+            if (!Polled) {
+                (VOID) TransmitterRingPoll(Ring);
+                Polled = TRUE;
             }
+
+            continue;
         }
 
         if (Ring->RequestsPosted - Ring->RequestsPushed >=