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

[win-pv-devel] [PATCH] Track StartIo and Failed SRB counts


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Wed, 9 Oct 2019 13:44:08 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=owen.smith@xxxxxxxxxx; spf=Pass smtp.mailfrom=owen.smith@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Wed, 09 Oct 2019 12:45:12 +0000
  • Ironport-sdr: bQGvmwKMm3EAN9CBL51hof6J32DoJc0rYQCPT5MkpFVRXWh+DdbnZBFP2Br4OOPmowkWQcOipW odm0XjYqLlmO3sp1uHCBz/i4bAMp+IGWPFaQjLgO2Q+cjkXYWY/NUMC92Bh17jPrH1CL7aFaVJ 6IJoWz5sd5Zm21JU+Wa2jcQ+lgYMg2HXwzTOoPbK6oX9IdLL1YdIAIPAEeJUIGqd1izExK7nE0 kr+cGZsRZpuLkPKR7AfcSXhXR2BPf74SdM9zUNnsz+1kLE3Hy++qjEtZm+mpXP/NmCMi24KrPR qb0=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/xenvbd/adapter.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/xenvbd/adapter.c b/src/xenvbd/adapter.c
index 1ae96cf..5e20944 100644
--- a/src/xenvbd/adapter.c
+++ b/src/xenvbd/adapter.c
@@ -93,6 +93,7 @@ struct _XENVBD_ADAPTER {
     ULONG                       BuildIo;
     ULONG                       StartIo;
     ULONG                       Completed;
+    ULONG                       Failed;
 };
 
 static FORCEINLINE PVOID
@@ -905,10 +906,11 @@ AdapterDebugCallback(
                  PowerDeviceStateName(Adapter->DevicePower));
     XENBUS_DEBUG(Printf,
                  &Adapter->DebugInterface,
-                 "ADAPTER: Srbs            : %u built, %u started, %u 
completed\n",
+                 "ADAPTER: Srbs            : %u built, %u started, %u 
completed, %u failed\n",
                  Adapter->BuildIo,
                  Adapter->StartIo,
-                 Adapter->Completed);
+                 Adapter->Completed,
+                 Adapter->Failed);
 }
 
 static NTSTATUS
@@ -1503,6 +1505,7 @@ AdapterTeardown(
     Adapter->BuildIo                = 0;
     Adapter->StartIo                = 0;
     Adapter->Completed              = 0;
+    Adapter->Failed                 = 0;
 
     ASSERT(IsZeroMemory(Adapter, sizeof(XENVBD_ADAPTER)));
     Trace("<===== (%d)\n", KeGetCurrentIrql());
@@ -1518,7 +1521,10 @@ AdapterCompleteSrb(
 
     ASSERT3U(Srb->SrbStatus, !=, SRB_STATUS_PENDING);
 
-    InterlockedIncrement((PLONG)&Adapter->Completed);
+    if (Srb->SrbStatus == SRB_STATUS_SUCCESS)
+        InterlockedIncrement((PLONG)&Adapter->Completed);
+    else
+        InterlockedIncrement((PLONG)&Adapter->Failed);
 
     StorPortNotification(RequestComplete, Adapter, Srb);
 }
@@ -1974,6 +1980,7 @@ AdapterHwStartIo(
     BOOLEAN                 WasQueued = FALSE;
     PXENVBD_TARGET          Target;
 
+    InterlockedIncrement((PLONG)&Adapter->StartIo);
     Target = AdapterGetTarget(Adapter, Srb->TargetId);
     if (Target == NULL) {
         Srb->SrbStatus = SRB_STATUS_NO_DEVICE;
-- 
2.16.2.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®.