All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Rozenfeld <vrozenfe@redhat.com>
To: kvm <kvm@vger.kernel.org>
Subject: [PATCH] viostor driver. Xp driver performance.
Date: Thu, 19 Nov 2009 09:25:14 +0200	[thread overview]
Message-ID: <4B04F2DA.1080307@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4457 bytes --]



repository: /home/vadimr/shares/kvm-guest-drivers-windows
branch: XP
commit 3b2926a281a769499944a23cc3c9b905593e6838
Author: Vadim Rozenfeld<vrozenfe@redhat.com>
Date:   Thu Nov 19 09:14:38 2009 +0200

     [PATCH] viostor driver. Xp driver performance.

     Signed-off-by: Vadim Rozenfeld<vrozenfe@redhat.com>

diff --git a/viostor/virtio_stor.c b/viostor/virtio_stor.c
index c36b85b..e674dff 100644
--- a/viostor/virtio_stor.c
+++ b/viostor/virtio_stor.c
@@ -215,6 +215,7 @@ VirtIoFindAdapter(
      ConfigInfo->Dma32BitAddresses      = TRUE;
      ConfigInfo->Dma64BitAddresses      = TRUE;
      ConfigInfo->WmiDataProvider        = FALSE;
+
  #ifdef USE_STORPORT
      ConfigInfo->MapBuffers             = STOR_MAP_NON_READ_WRITE_BUFFERS;
      ConfigInfo->SynchronizationModel   = StorSynchronizeFullDuplex;
@@ -286,7 +287,7 @@ VirtIoFindAdapter(
      if(adaptExt->dump_mode) {
          ConfigInfo->NumberOfPhysicalBreaks = 8;
      } else {
-        ConfigInfo->NumberOfPhysicalBreaks = 16;
+        ConfigInfo->NumberOfPhysicalBreaks = MAX_PHYS_SEGMENTS-1;
      }

      ConfigInfo->MaximumTransferLength = ConfigInfo->NumberOfPhysicalBreaks * PAGE_SIZE;
@@ -316,7 +317,6 @@ VirtIoFindAdapter(

      InitializeListHead(&adaptExt->list_head);
      InitializeListHead(&adaptExt->complete_list);
-
      return SP_RETURN_FOUND;
  }

@@ -470,9 +470,7 @@ VirtIoStartIo(
  {
      PCDB cdb = (PCDB)&Srb->Cdb[0];

-    PADAPTER_EXTENSION adaptExt;
-
-    adaptExt = (PADAPTER_EXTENSION)DeviceExtension;
+    PADAPTER_EXTENSION adaptExt = (PADAPTER_EXTENSION)DeviceExtension;

      switch (Srb->Function) {
          case SRB_FUNCTION_EXECUTE_SCSI:
@@ -591,7 +589,6 @@ VirtIoStartIo(
      return TRUE;
  }

-
  BOOLEAN
  VirtIoInterrupt(
      IN PVOID DeviceExtension
@@ -600,12 +597,10 @@ VirtIoInterrupt(
      pblk_req            vbr;
      unsigned int        len;
      unsigned long       flags;
-    PADAPTER_EXTENSION  adaptExt;
+    PADAPTER_EXTENSION  adaptExt = (PADAPTER_EXTENSION)DeviceExtension;
      BOOLEAN             isInterruptServiced = FALSE;
      PSCSI_REQUEST_BLOCK Srb;

-    adaptExt = (PADAPTER_EXTENSION)DeviceExtension;
-
      RhelDbgPrint(TRACE_LEVEL_VERBOSE, ("%s (%d)\n", __FUNCTION__, KeGetCurrentIrql()));

      if (VirtIODeviceISR(DeviceExtension)>  0) {
@@ -1019,7 +1014,6 @@ RhelGetLba(
      PCDB Cdb
      )
  {
-
      EIGHT_BYTE lba;

      switch (Cdb->CDB6GENERIC.OperationCode) {
@@ -1094,7 +1088,7 @@ CompleteDPC(
  {
      PSCSI_REQUEST_BLOCK Srb = (PSCSI_REQUEST_BLOCK)vbr->req;
      PADAPTER_EXTENSION adaptExt = (PADAPTER_EXTENSION)DeviceExtension;
-
+    PRHEL_SRB_EXTENSION srbExt   = (PRHEL_SRB_EXTENSION)Srb->SrbExtension;
      RemoveEntryList(&vbr->list_entry);

  #ifdef USE_STORPORT
@@ -1106,13 +1100,22 @@ CompleteDPC(
                           NULL);
          return;
      }
-#endif
      CompleteSRB(DeviceExtension, Srb);
-#ifndef USE_STORPORT
-    --adaptExt->requests;
+#else
+    ScsiPortNotification(RequestComplete,
+                         DeviceExtension,
+                         Srb);
+    if(srbExt->call_next) {
+        ScsiPortNotification(NextLuRequest,
+                         DeviceExtension,
+                         Srb->PathId,
+                         Srb->TargetId,
+                         Srb->Lun);
+    }
  #endif
  }

+
  #ifdef USE_STORPORT
  VOID
  CompleteDpcRoutine(
diff --git a/viostor/virtio_stor.h b/viostor/virtio_stor.h
index c00600c..ac143ea 100644
--- a/viostor/virtio_stor.h
+++ b/viostor/virtio_stor.h
@@ -52,7 +52,7 @@ typedef struct VirtIOBufferDescriptor VIO_SG, *PVIO_SG;
  #define VIRTIO_BLK_S_UNSUPP	2

  #define SECTOR_SIZE             512
-#define MAX_PHYS_SEGMENTS       128
+#define MAX_PHYS_SEGMENTS       17 //128
  #define VIRTIO_MAX_SG	        (3+MAX_PHYS_SEGMENTS)
  #define IO_PORT_LENGTH          0x40

@@ -105,8 +105,6 @@ typedef struct _ADAPTER_EXTENSION {
      LIST_ENTRY            complete_list;
  #ifdef USE_STORPORT
      STOR_DPC              completion_dpc;
-#else
-    ULONG                 requests;
  #endif
      BOOLEAN               has_sn;
      ULONG                 msix_vectors;
@@ -116,6 +114,10 @@ typedef struct _RHEL_SRB_EXTENSION {
      blk_req               vbr;
      ULONG                 out;
      ULONG                 in;
+    PSCSI_REQUEST_BLOCK   srb;
+#ifndef USE_STORPORT
+    BOOLEAN               call_next;
+#endif
  }RHEL_SRB_EXTENSION, *PRHEL_SRB_EXTENSION;

  ULONGLONG


[-- Attachment #2: xp_driver_performance.patch --]
[-- Type: text/plain, Size: 4090 bytes --]

diff --git a/viostor/virtio_stor.c b/viostor/virtio_stor.c
index c36b85b..e674dff 100644
--- a/viostor/virtio_stor.c
+++ b/viostor/virtio_stor.c
@@ -215,6 +215,7 @@ VirtIoFindAdapter(
     ConfigInfo->Dma32BitAddresses      = TRUE;
     ConfigInfo->Dma64BitAddresses      = TRUE;
     ConfigInfo->WmiDataProvider        = FALSE;
+
 #ifdef USE_STORPORT
     ConfigInfo->MapBuffers             = STOR_MAP_NON_READ_WRITE_BUFFERS;
     ConfigInfo->SynchronizationModel   = StorSynchronizeFullDuplex;
@@ -286,7 +287,7 @@ VirtIoFindAdapter(
     if(adaptExt->dump_mode) {
         ConfigInfo->NumberOfPhysicalBreaks = 8;
     } else {
-        ConfigInfo->NumberOfPhysicalBreaks = 16;
+        ConfigInfo->NumberOfPhysicalBreaks = MAX_PHYS_SEGMENTS-1;
     }
 
     ConfigInfo->MaximumTransferLength = ConfigInfo->NumberOfPhysicalBreaks * PAGE_SIZE;
@@ -316,7 +317,6 @@ VirtIoFindAdapter(
 
     InitializeListHead(&adaptExt->list_head);
     InitializeListHead(&adaptExt->complete_list);
-
     return SP_RETURN_FOUND;
 }
 
@@ -470,9 +470,7 @@ VirtIoStartIo(
 {
     PCDB cdb = (PCDB)&Srb->Cdb[0];
 
-    PADAPTER_EXTENSION adaptExt;
-
-    adaptExt = (PADAPTER_EXTENSION)DeviceExtension;
+    PADAPTER_EXTENSION adaptExt = (PADAPTER_EXTENSION)DeviceExtension;
 
     switch (Srb->Function) {
         case SRB_FUNCTION_EXECUTE_SCSI:
@@ -591,7 +589,6 @@ VirtIoStartIo(
     return TRUE;
 }
 
-
 BOOLEAN
 VirtIoInterrupt(
     IN PVOID DeviceExtension
@@ -600,12 +597,10 @@ VirtIoInterrupt(
     pblk_req            vbr;
     unsigned int        len;
     unsigned long       flags;
-    PADAPTER_EXTENSION  adaptExt;
+    PADAPTER_EXTENSION  adaptExt = (PADAPTER_EXTENSION)DeviceExtension;
     BOOLEAN             isInterruptServiced = FALSE;
     PSCSI_REQUEST_BLOCK Srb;
 
-    adaptExt = (PADAPTER_EXTENSION)DeviceExtension;
-
     RhelDbgPrint(TRACE_LEVEL_VERBOSE, ("%s (%d)\n", __FUNCTION__, KeGetCurrentIrql()));
 
     if (VirtIODeviceISR(DeviceExtension) > 0) {
@@ -1019,7 +1014,6 @@ RhelGetLba(
     PCDB Cdb
     )
 {
-
     EIGHT_BYTE lba;
 
     switch (Cdb->CDB6GENERIC.OperationCode) {
@@ -1094,7 +1088,7 @@ CompleteDPC(
 {
     PSCSI_REQUEST_BLOCK Srb = (PSCSI_REQUEST_BLOCK)vbr->req;
     PADAPTER_EXTENSION adaptExt = (PADAPTER_EXTENSION)DeviceExtension;
-
+    PRHEL_SRB_EXTENSION srbExt   = (PRHEL_SRB_EXTENSION)Srb->SrbExtension;
     RemoveEntryList(&vbr->list_entry);
 
 #ifdef USE_STORPORT
@@ -1106,13 +1100,22 @@ CompleteDPC(
                          NULL);
         return;
     }
-#endif
     CompleteSRB(DeviceExtension, Srb);
-#ifndef USE_STORPORT
-    --adaptExt->requests;
+#else
+    ScsiPortNotification(RequestComplete,
+                         DeviceExtension,
+                         Srb);
+    if(srbExt->call_next) {
+        ScsiPortNotification(NextLuRequest,
+                         DeviceExtension,
+                         Srb->PathId,
+                         Srb->TargetId,
+                         Srb->Lun);
+    }
 #endif
 }
 
+
 #ifdef USE_STORPORT
 VOID
 CompleteDpcRoutine(
diff --git a/viostor/virtio_stor.h b/viostor/virtio_stor.h
index c00600c..ac143ea 100644
--- a/viostor/virtio_stor.h
+++ b/viostor/virtio_stor.h
@@ -52,7 +52,7 @@ typedef struct VirtIOBufferDescriptor VIO_SG, *PVIO_SG;
 #define VIRTIO_BLK_S_UNSUPP	2
 
 #define SECTOR_SIZE             512
-#define MAX_PHYS_SEGMENTS       128
+#define MAX_PHYS_SEGMENTS       17 //128
 #define VIRTIO_MAX_SG	        (3+MAX_PHYS_SEGMENTS)
 #define IO_PORT_LENGTH          0x40
 
@@ -105,8 +105,6 @@ typedef struct _ADAPTER_EXTENSION {
     LIST_ENTRY            complete_list;
 #ifdef USE_STORPORT
     STOR_DPC              completion_dpc;
-#else
-    ULONG                 requests;
 #endif
     BOOLEAN               has_sn;
     ULONG                 msix_vectors;
@@ -116,6 +114,10 @@ typedef struct _RHEL_SRB_EXTENSION {
     blk_req               vbr;
     ULONG                 out;
     ULONG                 in;
+    PSCSI_REQUEST_BLOCK   srb;
+#ifndef USE_STORPORT
+    BOOLEAN               call_next;
+#endif
 }RHEL_SRB_EXTENSION, *PRHEL_SRB_EXTENSION;
 
 ULONGLONG

                 reply	other threads:[~2009-11-19  7:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B04F2DA.1080307@redhat.com \
    --to=vrozenfe@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.