From patchwork Thu Nov 19 07:25:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Rozenfeld X-Patchwork-Id: 61241 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAJ7PJQP032765 for ; Thu, 19 Nov 2009 07:25:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750945AbZKSHZM (ORCPT ); Thu, 19 Nov 2009 02:25:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752392AbZKSHZL (ORCPT ); Thu, 19 Nov 2009 02:25:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64792 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943AbZKSHZK (ORCPT ); Thu, 19 Nov 2009 02:25:10 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nAJ7PGrY021070 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 Nov 2009 02:25:16 -0500 Received: from localhost.localdomain (vpn-6-4.tlv.redhat.com [10.35.6.4]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAJ7PEJm007513 for ; Thu, 19 Nov 2009 02:25:15 -0500 Message-ID: <4B04F2DA.1080307@redhat.com> Date: Thu, 19 Nov 2009 09:25:14 +0200 From: Vadim Rozenfeld User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: kvm Subject: [PATCH] viostor driver. Xp driver performance. X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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