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

[win-pv-devel] [PATCH 1/2] rate limit BLKIF_OP failure log messages XSI-413


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Daniel Davis <Daniel.Davis@xxxxxxxxxx>
  • Date: Mon, 15 Jul 2019 14:12:55 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=Daniel.Davis@xxxxxxxxxx; spf=Pass smtp.mailfrom=daniel.davis@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Daniel Davis <Daniel.Davis@xxxxxxxxxx>
  • Delivery-date: Mon, 15 Jul 2019 13:13:14 +0000
  • Ironport-sdr: A3UaCVU2+kNIbF2uS/QkRBuUcT2R2OUtRI8YrsxMH/jYZGypvRNF/Pf9UTkAPzDxfcNChAxwVo /k9u0R8Nqaw53O6zGz9jtbzPIlEjmnHDIDnmbpb7rtDhtHC3JrBv67w6tIDic4rUQxzgnvhENn 5drNKon6NvWBqfeYYpVCyRjslsAt7dIsLRdYm+lQAPQWywIv+FS8AMBznGT+fa0PuVS02EOqqe Fu+Z3TEx9qtthdZD5F7GNyZwTYPpvS6JQPorDC5LmPfHEeTrZTYmUjKUUQ4ruQ5awJcMk9NwDH J1c=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Signed-off-by Daniel Davis <daniel.davis@xxxxxxxxxx> 

---
 src/xenvbd/ring.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/src/xenvbd/ring.c b/src/xenvbd/ring.c
index 93fd920..431e1b5 100644
--- a/src/xenvbd/ring.c
+++ b/src/xenvbd/ring.c
@@ -52,6 +52,7 @@
 #include "debug.h"
 #include "assert.h"
 
+
 #define XENVBD_MAX_RING_PAGE_ORDER  (4)
 #define XENVBD_MAX_RING_PAGES       (1 << XENVBD_MAX_RING_PAGE_ORDER)
 
@@ -94,6 +95,7 @@ typedef struct _XENVBD_BLKIF_RING {
     ULONG                           RequestsPushed;
     ULONG                           ResponsesProcessed;
     PXENBUS_DEBUG_CALLBACK          DebugCallback;
+       LARGE_INTEGER                                   TimeOfLastErrorLog;     
 } XENVBD_BLKIF_RING, *PXENVBD_BLKIF_RING;
 
 typedef enum _XENVBD_STAT {
@@ -1213,12 +1215,22 @@ __BlkifRingCompleteResponse(
 
     case BLKIF_RSP_ERROR:
     default:
-        Warning("Target[%u][%u] : %s BLKIF_RSP_ERROR\n",
-                FrontendGetTargetId(Frontend),
-                BlkifRing->Index,
-                __BlkifOperationName(Request->Operation));
-        Srb->SrbStatus = SRB_STATUS_ERROR;
-        break;
+       {
+               LARGE_INTEGER timeNow;
+
+               KeQuerySystemTime(&timeNow);
+
+               //if last log message was less than 10 seconds ago
+               if (timeNow.QuadPart - BlkifRing->TimeOfLastErrorLog.QuadPart < 
100000000) {
+                       Warning("Target[%u][%u] : %s BLKIF_RSP_ERROR\n",
+                               FrontendGetTargetId(Frontend),
+                               BlkifRing->Index,
+                               __BlkifOperationName(Request->Operation));
+                       KeQuerySystemTime(&BlkifRing->TimeOfLastErrorLog);
+               }
+               Srb->SrbStatus = SRB_STATUS_ERROR;
+               break;
+               }
     }
 
     BlkifRingPutRequest(BlkifRing, Request);
@@ -1229,6 +1241,7 @@ __BlkifRingCompleteResponse(
     }
 }
 
+
 static FORCEINLINE BOOLEAN
 BlkifRingPoll(
     IN  PXENVBD_BLKIF_RING  BlkifRing
-- 
2.22.0.windows.1


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

 


Rackspace

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