From a719ccd095ee89b3241bcf018dd4200ea34dd0bc Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 17 Aug 2024 02:21:42 +1000 Subject: [PATCH 1/3] [vioscsi] Fixed regression in SendSRB and refactored to improve performance --- vioscsi/helper.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/vioscsi/helper.c b/vioscsi/helper.c index 9574a3111..6d98a0c03 100755 --- a/vioscsi/helper.c +++ b/vioscsi/helper.c @@ -56,6 +56,7 @@ SendSRB( UCHAR ScsiStatus = SCSISTAT_GOOD; ULONG MessageID; int res = 0; + BOOLEAN notify = FALSE; PREQUEST_LIST element; ULONG index; ENTER_FN_SRB(); @@ -110,17 +111,11 @@ ENTER_FN_SRB(); &srbExt->cmd, va, pa); if (res >= 0) { + notify = virtqueue_kick_prepare(adaptExt->vq[QueueNumber]); element = &adaptExt->processing_srbs[index]; InsertTailList(&element->srb_list, &srbExt->list_entry); element->srb_cnt++; - } - VioScsiVQUnlock(DeviceExtension, MessageID, &LockHandle, FALSE); - if ( res >= 0){ - if (virtqueue_kick_prepare(adaptExt->vq[QueueNumber])) { - virtqueue_notify(adaptExt->vq[QueueNumber]); - } } else { - virtqueue_notify(adaptExt->vq[QueueNumber]); ScsiStatus = SCSISTAT_QUEUE_FULL; SRB_SET_SRB_STATUS(Srb, SRB_STATUS_BUSY); SRB_SET_SCSI_STATUS(Srb, ScsiStatus); @@ -128,7 +123,10 @@ ENTER_FN_SRB(); CompleteRequest(DeviceExtension, Srb); RhelDbgPrint(TRACE_LEVEL_FATAL, " Could not put an SRB into a VQ, so complete it with SRB_STATUS_BUSY. QueueNumber = %d, SRB = 0x%p, Lun = %d, TimeOut = %d.\n", QueueNumber, srbExt->Srb, SRB_LUN(Srb), Srb->TimeOutValue); } - + VioScsiVQUnlock(DeviceExtension, MessageID, &LockHandle, FALSE); + if (notify){ + virtqueue_notify(adaptExt->vq[QueueNumber]); + } EXIT_FN_SRB(); } From 2887e8b1e4ce7f8362a8e32212e0a06f37f8c467 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 20 Aug 2024 10:51:20 +1000 Subject: [PATCH 2/3] [viostor] Backported SendSRB improvements from vioscsi --- viostor/virtio_stor_hw_helper.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/viostor/virtio_stor_hw_helper.c b/viostor/virtio_stor_hw_helper.c index 24928fd6a..570ef5e59 100755 --- a/viostor/virtio_stor_hw_helper.c +++ b/viostor/virtio_stor_hw_helper.c @@ -160,6 +160,7 @@ RhelDoReadWrite(PVOID DeviceExtension, ULONG QueueNumber = 0; ULONG MessageId = 1; + int res = 0; ULONG OldIrql = 0; BOOLEAN result = FALSE; bool notify = FALSE; @@ -194,30 +195,29 @@ RhelDoReadWrite(PVOID DeviceExtension, vq = adaptExt->vq[QueueNumber]; RhelDbgPrint(TRACE_LEVEL_VERBOSE, " QueueNumber 0x%x vq = %p\n", QueueNumber, vq); - element = &adaptExt->processing_srbs[QueueNumber]; VioStorVQLock(DeviceExtension, MessageId, &LockHandle, FALSE); - if (virtqueue_add_buf(vq, - &srbExt->sg[0], - srbExt->out, srbExt->in, - &srbExt->vbr, va, pa) >= 0) { + res = virtqueue_add_buf(vq, + &srbExt->sg[0], + srbExt->out, srbExt->in, + &srbExt->vbr, va, pa); + + if (res >= 0) { notify = virtqueue_kick_prepare(vq); + element = &adaptExt->processing_srbs[QueueNumber]; InsertTailList(&element->srb_list, &srbExt->vbr.list_entry); element->srb_cnt++; - VioStorVQUnlock(DeviceExtension, MessageId, &LockHandle, FALSE); #ifdef DBG InterlockedIncrement((LONG volatile*)&adaptExt->inqueue_cnt); #endif result = TRUE; - } - else { - VioStorVQUnlock(DeviceExtension, MessageId, &LockHandle, FALSE); + } else { RhelDbgPrint(TRACE_LEVEL_ERROR, " Can not add packet to queue %d.\n", QueueNumber); StorPortBusy(DeviceExtension, 2); } - if (notify) { + VioStorVQUnlock(DeviceExtension, MessageId, &LockHandle, FALSE); + if (notify){ virtqueue_notify(vq); } - if (adaptExt->num_queues > 1) { if (CHECKFLAG(adaptExt->perfFlags, STOR_PERF_OPTIMIZE_FOR_COMPLETION_DURING_STARTIO)) { VioStorCompleteRequest(DeviceExtension, MessageId, FALSE); From 976c325fb15ac3162a6d7602640418ab6b38fc5a Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 20 Aug 2024 11:10:28 +1000 Subject: [PATCH 3/3] [vioscsi] Updated WPP and refactored for optimum performance --- vioscsi/helper.c | 193 ++++++++++++++++++++++++++++------------------ vioscsi/helper.h | 33 +++++--- vioscsi/trace.h | 60 +++++++++++--- vioscsi/utils.c | 29 ++++++- vioscsi/vioscsi.c | 94 +++++++++++++++------- 5 files changed, 281 insertions(+), 128 deletions(-) diff --git a/vioscsi/helper.c b/vioscsi/helper.c index 6d98a0c03..ae05800eb 100755 --- a/vioscsi/helper.c +++ b/vioscsi/helper.c @@ -59,19 +59,22 @@ SendSRB( BOOLEAN notify = FALSE; PREQUEST_LIST element; ULONG index; -ENTER_FN_SRB(); - if (!Srb) - return; +ENTER_FN_SRB(); + if (!Srb) { +EXIT_FN_SRB(); + return; + } + if (adaptExt->bRemoved) { SRB_SET_SRB_STATUS(Srb, SRB_STATUS_NO_DEVICE); CompleteRequest(DeviceExtension, Srb); - return; - } - +EXIT_FN_SRB(); + return; + } LOG_SRB_INFO(); - + if (adaptExt->num_queues > 1) { STARTIO_PERFORMANCE_PARAMETERS param; param.Size = sizeof(STARTIO_PERFORMANCE_PARAMETERS); @@ -83,33 +86,38 @@ ENTER_FN_SRB(); } } else { RhelDbgPrint(TRACE_LEVEL_ERROR, " StorPortGetStartIoPerfParams failed srb 0x%p status 0x%x MessageNumber %d.\n", Srb, status, param.MessageNumber); + // FIXME + // Should we return on this error..? + // Should it be TRACE_LEVEL_FATAL..? + //is_done = TRUE; } } - + srbExt = SRB_EXTENSION(Srb); - + if (!srbExt) { RhelDbgPrint(TRACE_LEVEL_INFORMATION, " No SRB Extenstion for SRB 0x%p \n", Srb); +EXIT_FN_SRB(); return; } - + MessageID = QUEUE_TO_MESSAGE(QueueNumber); index = QueueNumber - VIRTIO_SCSI_REQUEST_QUEUE_0; - + if (adaptExt->reset_in_progress) { - RhelDbgPrint(TRACE_LEVEL_FATAL, " Reset is in progress, completing SRB 0x%p with SRB_STATUS_BUS_RESET.\n", Srb); + RhelDbgPrint(TRACE_LEVEL_WARNING, " Reset is in progress, completing SRB 0x%p with SRB_STATUS_BUS_RESET.\n", Srb); SRB_SET_SRB_STATUS(Srb, SRB_STATUS_BUS_RESET); CompleteRequest(DeviceExtension, Srb); +EXIT_FN_SRB(); return; } - - VioScsiVQLock(DeviceExtension, MessageID, &LockHandle, FALSE); + VioScsiLockManager(DeviceExtension, MessageID, &LockHandle, FALSE, VIOSCSI_VQLOCKOP_LOCK); SET_VA_PA(); res = virtqueue_add_buf(adaptExt->vq[QueueNumber], srbExt->psgl, srbExt->out, srbExt->in, &srbExt->cmd, va, pa); - + if (res >= 0) { notify = virtqueue_kick_prepare(adaptExt->vq[QueueNumber]); element = &adaptExt->processing_srbs[index]; @@ -121,9 +129,9 @@ ENTER_FN_SRB(); SRB_SET_SCSI_STATUS(Srb, ScsiStatus); StorPortBusy(DeviceExtension, 10); CompleteRequest(DeviceExtension, Srb); - RhelDbgPrint(TRACE_LEVEL_FATAL, " Could not put an SRB into a VQ, so complete it with SRB_STATUS_BUSY. QueueNumber = %d, SRB = 0x%p, Lun = %d, TimeOut = %d.\n", QueueNumber, srbExt->Srb, SRB_LUN(Srb), Srb->TimeOutValue); + RhelDbgPrint(TRACE_LEVEL_WARNING, " Could not put an SRB into a VQ, so complete it with SRB_STATUS_BUSY. QueueNumber = %d, SRB = 0x%p, Lun = %d, TimeOut = %d.\n", QueueNumber, srbExt->Srb, SRB_LUN(Srb), Srb->TimeOutValue); } - VioScsiVQUnlock(DeviceExtension, MessageID, &LockHandle, FALSE); + VioScsiLockManager(DeviceExtension, MessageID, &LockHandle, FALSE, VIOSCSI_VQLOCKOP_UNLOCK); if (notify){ virtqueue_notify(adaptExt->vq[QueueNumber]); } @@ -183,6 +191,7 @@ DeviceReset( ENTER_FN(); if (adaptExt->dump_mode) { +EXIT_FN(); return TRUE; } ASSERT(adaptExt->tmf_infly == FALSE); @@ -195,7 +204,7 @@ ENTER_FN(); cmd->req.tmf.lun[3] = 0; cmd->req.tmf.type = VIRTIO_SCSI_T_TMF; cmd->req.tmf.subtype = VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET; - + srbExt->psgl = srbExt->vio_sg; srbExt->pdesc = srbExt->desc_alias; sgElement = 0; @@ -210,9 +219,11 @@ ENTER_FN(); StorPortPause(DeviceExtension, 60); if (!SendTMF(DeviceExtension, Srb)) { StorPortResume(DeviceExtension); +EXIT_FN(); return FALSE; } adaptExt->tmf_infly = TRUE; +EXIT_FN(); return TRUE; } @@ -382,46 +393,48 @@ ENTER_FN(); SP_INTERNAL_ADAPTER_ERROR, __LINE__); RhelDbgPrint(TRACE_LEVEL_FATAL, " CANNOT READ PCI CONFIGURATION SPACE %d\n", pci_cfg_len); +EXIT_FN(); return FALSE; } - + + UCHAR CapOffset; + PPCI_MSIX_CAPABILITY pMsixCapOffset; + PPCI_COMMON_HEADER pPciComHeader; + pPciComHeader = &adaptExt->pci_config; + if ((pPciComHeader->Status & PCI_STATUS_CAPABILITIES_LIST) == 0) { - UCHAR CapOffset; - PPCI_MSIX_CAPABILITY pMsixCapOffset; - PPCI_COMMON_HEADER pPciComHeader; - pPciComHeader = &adaptExt->pci_config; - if ((pPciComHeader->Status & PCI_STATUS_CAPABILITIES_LIST) == 0) - { - RhelDbgPrint(TRACE_LEVEL_INFORMATION, " NO CAPABILITIES_LIST\n"); - } - else + RhelDbgPrint(TRACE_LEVEL_INFORMATION, " NO CAPABILITIES_LIST\n"); + } else + { + if ((pPciComHeader->HeaderType & (~PCI_MULTIFUNCTION)) == PCI_DEVICE_TYPE) { - if ((pPciComHeader->HeaderType & (~PCI_MULTIFUNCTION)) == PCI_DEVICE_TYPE) + CapOffset = pPciComHeader->u.type0.CapabilitiesPtr; + while (CapOffset != 0) { - CapOffset = pPciComHeader->u.type0.CapabilitiesPtr; - while (CapOffset != 0) + pMsixCapOffset = (PPCI_MSIX_CAPABILITY)&adaptExt->pci_config_buf[CapOffset]; + if (pMsixCapOffset->Header.CapabilityID == PCI_CAPABILITY_ID_MSIX) { - pMsixCapOffset = (PPCI_MSIX_CAPABILITY)&adaptExt->pci_config_buf[CapOffset]; - if (pMsixCapOffset->Header.CapabilityID == PCI_CAPABILITY_ID_MSIX) - { - RhelDbgPrint(TRACE_LEVEL_INFORMATION, "MessageControl.TableSize = %d\n", pMsixCapOffset->MessageControl.TableSize); - RhelDbgPrint(TRACE_LEVEL_INFORMATION, "MessageControl.FunctionMask = %d\n", pMsixCapOffset->MessageControl.FunctionMask); - RhelDbgPrint(TRACE_LEVEL_INFORMATION, "MessageControl.MSIXEnable = %d\n", pMsixCapOffset->MessageControl.MSIXEnable); - - RhelDbgPrint(TRACE_LEVEL_INFORMATION, " MessageTable = %lu\n", pMsixCapOffset->MessageTable.TableOffset); - RhelDbgPrint(TRACE_LEVEL_INFORMATION, " PBATable = %lu\n", pMsixCapOffset->PBATable.TableOffset); - adaptExt->msix_enabled = (pMsixCapOffset->MessageControl.MSIXEnable == 1); - } else - { - RhelDbgPrint(TRACE_LEVEL_INFORMATION, " CapabilityID = %x, Next CapOffset = %x\n", pMsixCapOffset->Header.CapabilityID, CapOffset); - } - CapOffset = pMsixCapOffset->Header.Next; + RhelDbgPrint(TRACE_LEVEL_INFORMATION, "MessageControl.TableSize = %d\n", pMsixCapOffset->MessageControl.TableSize); + RhelDbgPrint(TRACE_LEVEL_INFORMATION, "MessageControl.FunctionMask = %d\n", pMsixCapOffset->MessageControl.FunctionMask); + RhelDbgPrint(TRACE_LEVEL_INFORMATION, "MessageControl.MSIXEnable = %d\n", pMsixCapOffset->MessageControl.MSIXEnable); + + RhelDbgPrint(TRACE_LEVEL_INFORMATION, " MessageTable = %lu\n", pMsixCapOffset->MessageTable.TableOffset); + RhelDbgPrint(TRACE_LEVEL_INFORMATION, " PBATable = %lu\n", pMsixCapOffset->PBATable.TableOffset); + adaptExt->msix_enabled = (pMsixCapOffset->MessageControl.MSIXEnable == 1); + } else + { + RhelDbgPrint(TRACE_LEVEL_INFORMATION, " CapabilityID = %x, Next CapOffset = %x\n", pMsixCapOffset->Header.CapabilityID, CapOffset); } - RhelDbgPrint(TRACE_LEVEL_INFORMATION, " msix_enabled = %d\n", adaptExt->msix_enabled); - } else - { - RhelDbgPrint(TRACE_LEVEL_FATAL, " NOT A PCI_DEVICE_TYPE\n"); + CapOffset = pMsixCapOffset->Header.Next; } + RhelDbgPrint(TRACE_LEVEL_INFORMATION, " msix_enabled = %d\n", adaptExt->msix_enabled); + } else + { + RhelDbgPrint(TRACE_LEVEL_FATAL, " NOT A PCI_DEVICE_TYPE\n"); + // FIXME + // Should we not return on this error..? +//EXIT_FN(); + //return FALSE; } } @@ -433,6 +446,7 @@ ENTER_FN(); if (iBar == -1) { RhelDbgPrint(TRACE_LEVEL_FATAL, " Cannot get index for BAR %I64d\n", accessRange->RangeStart.QuadPart); +EXIT_FN(); return FALSE; } adaptExt->pci_bars[iBar].BasePA = accessRange->RangeStart; @@ -440,12 +454,13 @@ ENTER_FN(); adaptExt->pci_bars[iBar].bPortSpace = !accessRange->RangeInMemory; } } - + /* initialize the virtual device */ if (!InitVirtIODevice(DeviceExtension)) { +EXIT_FN(); return FALSE; } - + EXIT_FN(); return TRUE; } @@ -489,53 +504,78 @@ ENTER_FN(); RtlZeroMemory((PVOID)EventNode, sizeof(VirtIOSCSIEventNode)); EventNode->sg.physAddr = StorPortGetPhysicalAddress(DeviceExtension, NULL, &EventNode->event, &fragLen); EventNode->sg.length = sizeof(VirtIOSCSIEvent); +EXIT_FN(); return SynchronizedKickEventRoutine(DeviceExtension, (PVOID)EventNode); +} + +VOID +// +// FORCEINLINE <<---- DO NOT FORCE INLINE +// Wrapper for VioScsiVQLock and VioScsiVQUnlock, so they can be forced inline for optimum performance. +// +VioScsiLockManager( + IN PVOID DeviceExtension, + IN ULONG MessageID, + IN OUT PSTOR_LOCK_HANDLE LockHandle, + IN BOOLEAN isr, + IN BOOLEAN LockOp + ) +{ +ENTER_FN(); + if (!isr) { + // ^^^^^^ Checking NOT isr moved here... + switch (LockOp) { + case VIOSCSI_VQLOCKOP_LOCK: + VioScsiVQLock(DeviceExtension, MessageID, LockHandle, "VioScsiVQLock"); + break; + case VIOSCSI_VQLOCKOP_UNLOCK: + VioScsiVQUnlock(DeviceExtension, LockHandle, "VioScsiVQUnlock"); + break; + default: + break; + } + } EXIT_FN(); } VOID -//FORCEINLINE +FORCEINLINE VioScsiVQLock( IN PVOID DeviceExtension, IN ULONG MessageID, IN OUT PSTOR_LOCK_HANDLE LockHandle, - IN BOOLEAN isr + IN PVOID InlineFuncName ) { PADAPTER_EXTENSION adaptExt = (PADAPTER_EXTENSION)DeviceExtension; ULONG QueueNumber = MESSAGE_TO_QUEUE(MessageID); - ENTER_FN(); - - if (!isr) { - if (adaptExt->msix_enabled) { - // Queue numbers start at 0, message ids at 1. - NT_ASSERT(MessageID > VIRTIO_SCSI_REQUEST_QUEUE_0); - if (QueueNumber >= (adaptExt->num_queues + VIRTIO_SCSI_REQUEST_QUEUE_0)) { - QueueNumber %= adaptExt->num_queues; - } - StorPortAcquireSpinLock(DeviceExtension, DpcLock, &adaptExt->dpc[QueueNumber - VIRTIO_SCSI_REQUEST_QUEUE_0], LockHandle); - } - else { - StorPortAcquireSpinLock(DeviceExtension, InterruptLock, NULL, LockHandle); + +ENTER_INL_FN(); + + if (adaptExt->msix_enabled) { + // Queue numbers start at 0, message ids at 1. + NT_ASSERT(MessageID > VIRTIO_SCSI_REQUEST_QUEUE_0); + if (QueueNumber >= (adaptExt->num_queues + VIRTIO_SCSI_REQUEST_QUEUE_0)) { + QueueNumber %= adaptExt->num_queues; } + StorPortAcquireSpinLock(DeviceExtension, DpcLock, &adaptExt->dpc[QueueNumber - VIRTIO_SCSI_REQUEST_QUEUE_0], LockHandle); + } else { + StorPortAcquireSpinLock(DeviceExtension, InterruptLock, NULL, LockHandle); } -EXIT_FN(); +EXIT_INL_FN(); } VOID -//FORCEINLINE +FORCEINLINE VioScsiVQUnlock( IN PVOID DeviceExtension, - IN ULONG MessageID, IN PSTOR_LOCK_HANDLE LockHandle, - IN BOOLEAN isr + IN PVOID InlineFuncName ) { -ENTER_FN(); - if (!isr) { - StorPortReleaseSpinLock(DeviceExtension, LockHandle); - } -EXIT_FN(); +ENTER_INL_FN(); + StorPortReleaseSpinLock(DeviceExtension, LockHandle); +EXIT_INL_FN(); } VOID FirmwareRequest( @@ -558,6 +598,7 @@ ENTER_FN(); SRB_SET_SRB_STATUS(Srb, SRB_STATUS_BAD_SRB_BLOCK_LENGTH); RhelDbgPrint(TRACE_LEVEL_ERROR, " FirmwareRequest Bad Block Length %ul\n", dataLen); +EXIT_FN(); return; } diff --git a/vioscsi/helper.h b/vioscsi/helper.h index ac38977f0..0f0b49af4 100755 --- a/vioscsi/helper.h +++ b/vioscsi/helper.h @@ -49,6 +49,9 @@ #define CACHE_LINE_SIZE 64 #define ROUND_TO_CACHE_LINES(Size) (((ULONG_PTR)(Size) + CACHE_LINE_SIZE - 1) & ~(CACHE_LINE_SIZE - 1)) +#define VIOSCSI_VQLOCKOP_UNLOCK 0 +#define VIOSCSI_VQLOCKOP_LOCK 1 + #include // Note: SrbGetCdbLength is defined in srbhelper.h @@ -162,14 +165,16 @@ SynchronizedKickEventRoutine( ); VOID +//FORCEINLINE VioScsiCompleteDpcRoutine( IN PSTOR_DPC Dpc, IN PVOID Context, IN PVOID SystemArgument1, IN PVOID SystemArgument2 -); + ); VOID +//FORCEINLINE ProcessQueue( IN PVOID DeviceExtension, IN ULONG MessageID, @@ -177,28 +182,38 @@ ProcessQueue( ); VOID -//FORCEINLINE +//FORCEINLINE Wrapper for VioScsiVQUnlock and VioScsiVQLock, so they can be optimised. +VioScsiLockManager( + IN PVOID DeviceExtension, + IN ULONG MessageID, + IN OUT PSTOR_LOCK_HANDLE LockHandle, + IN BOOLEAN isr, + IN BOOLEAN LockOp + ); + +VOID +FORCEINLINE VioScsiVQLock( IN PVOID DeviceExtension, IN ULONG MessageID, IN OUT PSTOR_LOCK_HANDLE LockHandle, - IN BOOLEAN isr + IN PVOID InlineFuncName ); VOID -//FORCEINLINE +FORCEINLINE VioScsiVQUnlock( IN PVOID DeviceExtension, - IN ULONG MessageID, IN PSTOR_LOCK_HANDLE LockHandle, - IN BOOLEAN isr + IN PVOID InlineFuncName ); VOID -//FORCEINLINE +FORCEINLINE HandleResponse( IN PVOID DeviceExtension, - IN PVirtIOSCSICmd cmd + IN PVirtIOSCSICmd cmd, + IN PVOID InlineFuncName ); PVOID @@ -211,7 +226,7 @@ VOID CompleteRequest( IN PVOID DeviceExtension, IN PSRB_TYPE Srb - ); + ); VOID FirmwareRequest( IN PVOID DeviceExtension, diff --git a/vioscsi/trace.h b/vioscsi/trace.h index fd4089957..3a070ff68 100755 --- a/vioscsi/trace.h +++ b/vioscsi/trace.h @@ -108,7 +108,7 @@ extern int nVioscsiDebugLevel; ) // begin_wpp config -// USEPREFIX (RhelDbgPrint, "%!STDPREFIX! %!FUNC!"); +// USEPREFIX (RhelDbgPrint, "%!STDPREFIX! ####\t\t[%!FUNC!]"); // FUNC RhelDbgPrint(LEVEL, MSG, ...); // end_wpp @@ -118,7 +118,7 @@ extern int nVioscsiDebugLevel; WPP_CONTROL(WPP_BIT_ ## Flags).Level >= level) // begin_wpp config -// USEPREFIX (ENTER_FN, "%!STDPREFIX! [%!FUNC!] --> entry"); +// USEPREFIX (ENTER_FN, "%!STDPREFIX! ===>\t\t[%!FUNC!] X---X Working X---X"); // FUNC ENTER_FN{ENTRYLEVEL=TRACE_LEVEL_VERBOSE}(...); // end_wpp @@ -126,40 +126,82 @@ extern int nVioscsiDebugLevel; #define WPP_ENTRYLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) // begin_wpp config -// USEPREFIX (EXIT_FN, "%!STDPREFIX! [%!FUNC!] <-- exit"); +// USEPREFIX (EXIT_FN, "%!STDPREFIX! <===\t\t[%!FUNC!] Processing complete."); // FUNC EXIT_FN{EXITLEVEL=TRACE_LEVEL_VERBOSE}(...); // end_wpp #define WPP_EXITLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) #define WPP_EXITLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) // begin_wpp config -// USEPREFIX (EXIT_ERR, "%!STDPREFIX! <--> %!FUNC! ERROR line %d", __LINE__); +// USEPREFIX (ENTER_INL_FN(PVOID InlineFuncName), "%!STDPREFIX! ===>\t\t[%!FUNC!]>>>[%s] X---X Working X---X", InlineFuncName); +// FUNC ENTER_INL_FN{INLENTRYLEVEL=TRACE_LEVEL_VERBOSE}(...); +// end_wpp +#define WPP_INLENTRYLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) +#define WPP_INLENTRYLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) + +// begin_wpp config +// USEPREFIX (EXIT_INL_FN(PVOID InlineFuncName), "%!STDPREFIX! <===\t\t[%!FUNC!]<<<[%s] Processing complete.", InlineFuncName); +// FUNC EXIT_INL_FN{INLEXITLEVEL=TRACE_LEVEL_VERBOSE}(...); +// end_wpp +#define WPP_INLEXITLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) +#define WPP_INLEXITLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) + +// begin_wpp config +// USEPREFIX (EXIT_ERR, "%!STDPREFIX! >>>>\t\t[%!FUNC!] ERROR line %d", __LINE__); // FUNC EXIT_ERR{ERRORLEVEL=TRACE_LEVEL_ERROR}(...); // end_wpp #define WPP_ERRORLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) #define WPP_ERRORLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) // begin_wpp config -// USEPREFIX (ENTER_FN_SRB(PVOID Srb), "%!STDPREFIX! ---> %!FUNC! 0x%p.", Srb); -// FUNC ENTER_FN_SRB{SRBENTRYLEVEL=TRACE_LEVEL_INFORMATION}(...); +// USEPREFIX (ENTER_FN_SRB(PVOID Srb), "%!STDPREFIX! ===>\t\t[%!FUNC!] SRB 0x%p", Srb); +// FUNC ENTER_FN_SRB{SRBENTRYLEVEL=TRACE_LEVEL_VERBOSE}(...); // end_wpp #define WPP_SRBENTRYLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) #define WPP_SRBENTRYLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) // begin_wpp config -// USEPREFIX (EXIT_FN_SRB(PVOID Srb), "%!STDPREFIX! <--- %!FUNC! 0x%p.", Srb); -// FUNC EXIT_FN_SRB{SRBEXITLEVEL=TRACE_LEVEL_INFORMATION}(...); +// USEPREFIX (EXIT_FN_SRB(PVOID Srb), "%!STDPREFIX! <===\t\t[%!FUNC!] SRB 0x%p", Srb); +// FUNC EXIT_FN_SRB{SRBEXITLEVEL=TRACE_LEVEL_VERBOSE}(...); // end_wpp #define WPP_SRBEXITLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) #define WPP_SRBEXITLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) // begin_wpp config -// USEPREFIX (LOG_SRB_INFO(PVOID Srb), "%!STDPREFIX! %!FUNC! <--> Operation %s (0x%X), Target (%d::%d::%d), SRB 0x%p", DbgGetScsiOpStr(DbgGetScsiOp(Srb)), DbgGetScsiOp(Srb), SRB_PATH_ID(Srb), SRB_TARGET_ID(Srb), SRB_LUN(Srb), Srb); +// USEPREFIX (LOG_SRB_INFO(PVOID Srb), "%!STDPREFIX! ####\t\t[%!FUNC!] Operation %s (0x%X), Target (%d::%d::%d), SRB 0x%p", DbgGetScsiOpStr(DbgGetScsiOp(Srb)), DbgGetScsiOp(Srb), SRB_PATH_ID(Srb), SRB_TARGET_ID(Srb), SRB_LUN(Srb), Srb); // FUNC LOG_SRB_INFO{SRBINFOLEVEL=TRACE_LEVEL_INFORMATION}(...); // end_wpp #define WPP_SRBINFOLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) #define WPP_SRBINFOLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) +// begin_wpp config +// USEPREFIX (ENTER_INL_FN_SRB(PVOID InlineFuncName, PVOID Srb), "%!STDPREFIX! ===>\t\t[%!FUNC!]>>>[%s] SRB 0x%p", InlineFuncName, Srb); +// FUNC ENTER_INL_FN_SRB{INLSRBENTRYLEVEL=TRACE_LEVEL_VERBOSE}(...); +// end_wpp +#define WPP_INLSRBENTRYLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) +#define WPP_INLSRBENTRYLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) + +// begin_wpp config +// USEPREFIX (EXIT_INL_FN_SRB(PVOID InlineFuncName, PVOID Srb), "%!STDPREFIX! <===\t\t[%!FUNC!]<<<[%s] SRB 0x%p", InlineFuncName, Srb); +// FUNC EXIT_INL_FN_SRB{INLSRBEXITLEVEL=TRACE_LEVEL_VERBOSE}(...); +// end_wpp +#define WPP_INLSRBEXITLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) +#define WPP_INLSRBEXITLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) + +// begin_wpp config +// USEPREFIX (LOG_SRB_INFO_FROM_INLFN(PVOID InlineFuncName, PVOID Srb), "%!STDPREFIX! ####\t\t[%!FUNC!]:[%s] Operation %s (0x%X), Target (%d::%d::%d), SRB 0x%p", InlineFuncName, DbgGetScsiOpStr(DbgGetScsiOp(Srb)), DbgGetScsiOp(Srb), SRB_PATH_ID(Srb), SRB_TARGET_ID(Srb), SRB_LUN(Srb), Srb); +// FUNC LOG_SRB_INFO_FROM_INLFN{INLSRBINFOLEVEL=TRACE_LEVEL_INFORMATION}(...); +// end_wpp +#define WPP_INLSRBINFOLEVEL_ENABLED(LEVEL) WPP_LEVEL_ENABLED(LEVEL) +#define WPP_INLSRBINFOLEVEL_LOGGER(LEVEL) WPP_LEVEL_LOGGER(LEVEL) + +// +// Configure WPP macros for optimum performance +// by disabling checking for 'WPP_INIT_TRACING' +// as we call it in DriverEntry() anyway. +// +#define WPP_CHECK_INIT + #endif #endif //__TRACING_H___ diff --git a/vioscsi/utils.c b/vioscsi/utils.c index 8af5fcbbe..a45651118 100755 --- a/vioscsi/utils.c +++ b/vioscsi/utils.c @@ -88,7 +88,7 @@ void InitializeDebugPrints(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING R //TBD - Read nDebugLevel and bDebugPrint from the registry bDebugPrint = 1; virtioDebugLevel = 0; - nVioscsiDebugLevel = TRACE_LEVEL_ERROR; + nVioscsiDebugLevel = TRACE_LEVEL_WARNING; #if defined(PRINT_DEBUG) VirtioDebugPrintProc = DebugPrintFunc; @@ -101,15 +101,36 @@ void InitializeDebugPrints(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING R tDebugPrintFunc VirtioDebugPrintProc; #else +//static void NoDebugPrintFunc(const char *format, ...) +//{ + +//} + void InitializeDebugPrints(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { - //TBD - Read nDebugLevel and bDebugPrint from the registry + // + // We implement RhelDbgPrint() messages via ETW using WPP. + // Implementation is via FLAGS and LEVEL [nVioscsiDebugLevel() here] has no effect. + // This way RhelDbgPrint() messages match TRACE_LEVEL of WPP functions, which is very convenient. + // No need for DEBUG settings here - breaks are never sent... + // + // Note: Messages matching definitions in stortrce.h are logged to the Windows System Event Log instead. + // + + // TODO - Remove this code... ¯\_(ツ)_/¯ + /* bDebugPrint = 0; virtioDebugLevel = 0; - nVioscsiDebugLevel = 4;// TRACE_LEVEL_ERROR; + nVioscsiDebugLevel = 3;// TRACE_LEVEL_WARNING + + if (bDebugPrint) { + VirtioDebugPrintProc = DbgPrint; + } else { + VirtioDebugPrintProc = NoDebugPrintFunc; + }*/ } -tDebugPrintFunc VirtioDebugPrintProc = DbgPrint; +tDebugPrintFunc VirtioDebugPrintProc; #endif diff --git a/vioscsi/vioscsi.c b/vioscsi/vioscsi.c index 37de7c481..c18967661 100755 --- a/vioscsi/vioscsi.c +++ b/vioscsi/vioscsi.c @@ -140,21 +140,24 @@ BOOLEAN FORCEINLINE PreProcessRequest( IN PVOID DeviceExtension, - IN PSRB_TYPE Srb + IN PSRB_TYPE Srb, + IN PVOID InlineFuncName ); VOID FORCEINLINE PostProcessRequest( IN PVOID DeviceExtension, - IN PSRB_TYPE Srb + IN PSRB_TYPE Srb, + IN PVOID InlineFuncName ); VOID FORCEINLINE DispatchQueue( IN PVOID DeviceExtension, - IN ULONG MessageID + IN ULONG MessageID, + IN PVOID InlineFuncName ); BOOLEAN @@ -474,6 +477,7 @@ ENTER_FN(); if (!InitHW(DeviceExtension, ConfigInfo)) { RhelDbgPrint(TRACE_LEVEL_FATAL, " Cannot initialize HardWare\n"); +EXIT_FN(); return SP_RETURN_NOT_FOUND; } @@ -582,6 +586,7 @@ ENTER_FN(); __LINE__); RhelDbgPrint(TRACE_LEVEL_FATAL, " Virtual queue %d config failed.\n", index); +EXIT_FN(); return SP_RETURN_ERROR; } adaptExt->pageAllocationSize += ROUND_TO_PAGES(Size); @@ -620,6 +625,7 @@ ENTER_FN(); __LINE__); RhelDbgPrint(TRACE_LEVEL_FATAL, " Can't get uncached extension allocation size = %d\n", extensionSize); +EXIT_FN(); return SP_RETURN_ERROR; } @@ -759,6 +765,7 @@ ENTER_FN(); adaptExt->msix_one_vector = TRUE; } if (!InitializeVirtualQueues(adaptExt, adaptExt->num_queues + VIRTIO_SCSI_REQUEST_QUEUE_0)) { +EXIT_FN(); return FALSE; } } @@ -767,6 +774,7 @@ ENTER_FN(); /* initialize queues with no MSI interrupts */ adaptExt->msix_enabled = FALSE; if (!InitializeVirtualQueues(adaptExt, adaptExt->num_queues + VIRTIO_SCSI_REQUEST_QUEUE_0)) { +EXIT_FN(); return FALSE; } } @@ -853,6 +861,7 @@ ENTER_FN(); } if (!adaptExt->dpc_ok && !StorPortEnablePassiveInitialization(DeviceExtension, VioScsiPassiveInitializeRoutine)) { RhelDbgPrint(TRACE_LEVEL_FATAL, " StorPortEnablePassiveInitialization FAILED\n"); +EXIT_FN(); return FALSE; } } @@ -885,7 +894,7 @@ VioScsiStartIo( ) { ENTER_FN_SRB(); - if (PreProcessRequest(DeviceExtension, (PSRB_TYPE)Srb)) + if (PreProcessRequest(DeviceExtension, (PSRB_TYPE)Srb, "PreProcessRequest")) { CompleteRequest(DeviceExtension, (PSRB_TYPE)Srb); } @@ -898,9 +907,11 @@ EXIT_FN_SRB(); } VOID +FORCEINLINE HandleResponse( IN PVOID DeviceExtension, - IN PVirtIOSCSICmd cmd + IN PVirtIOSCSICmd cmd, + IN PVOID InlineFuncName ) { PSRB_TYPE Srb = (PSRB_TYPE)(cmd->srb); @@ -911,9 +922,9 @@ HandleResponse( UCHAR srbStatus = SRB_STATUS_SUCCESS; ULONG srbDataTransferLen = SRB_DATA_TRANSFER_LENGTH(Srb); -ENTER_FN(); +ENTER_INL_FN_SRB(); - LOG_SRB_INFO(); +LOG_SRB_INFO_FROM_INLFN(); switch (resp->response) { case VIRTIO_SCSI_S_OK: @@ -988,7 +999,7 @@ ENTER_FN(); SRB_SET_SRB_STATUS(Srb, srbStatus); CompleteRequest(DeviceExtension, Srb); -EXIT_FN(); +EXIT_INL_FN_SRB(); } BOOLEAN @@ -1085,11 +1096,11 @@ VioScsiMSInterruptWorker( adaptExt = (PADAPTER_EXTENSION)DeviceExtension; RhelDbgPrint(TRACE_LEVEL_VERBOSE, - " MessageID 0x%x\n", MessageID); + " MessageID : 0x%x\n", MessageID); if (MessageID >= QUEUE_TO_MESSAGE(VIRTIO_SCSI_REQUEST_QUEUE_0)) { - DispatchQueue(DeviceExtension, MessageID); + DispatchQueue(DeviceExtension, MessageID, "DispatchQueue"); return TRUE; } if (MessageID == 0) @@ -1306,7 +1317,7 @@ ENTER_FN(); PREQUEST_LIST element = &adaptExt->processing_srbs[index]; QueuNum = index + VIRTIO_SCSI_REQUEST_QUEUE_0; MsgId = QUEUE_TO_MESSAGE(QueuNum); - VioScsiVQLock(DeviceExtension, MsgId, &LockHandle, FALSE); + VioScsiLockManager(DeviceExtension, MsgId, &LockHandle, FALSE, VIOSCSI_VQLOCKOP_LOCK); if (!IsListEmpty(&element->srb_list)) { PLIST_ENTRY entry = element->srb_list.Flink; @@ -1327,7 +1338,7 @@ ENTER_FN(); } } } - VioScsiVQUnlock(DeviceExtension, MsgId, &LockHandle, FALSE); + VioScsiLockManager(DeviceExtension, MsgId, &LockHandle, FALSE, VIOSCSI_VQLOCKOP_UNLOCK); } Status = ScsiUnitControlSuccess; break; @@ -1373,6 +1384,7 @@ ENTER_FN_SRB(); StorPortNotification(RequestComplete, DeviceExtension, Srb); +EXIT_FN_SRB(); return FALSE; } @@ -1458,11 +1470,12 @@ VOID FORCEINLINE DispatchQueue( IN PVOID DeviceExtension, - IN ULONG MessageID + IN ULONG MessageID, + IN PVOID InlineFuncName ) { PADAPTER_EXTENSION adaptExt; -ENTER_FN(); +ENTER_INL_FN(); adaptExt = (PADAPTER_EXTENSION)DeviceExtension; @@ -1472,7 +1485,7 @@ ENTER_FN(); &adaptExt->dpc[MessageID - QUEUE_TO_MESSAGE(VIRTIO_SCSI_REQUEST_QUEUE_0)], ULongToPtr(MessageID), ULongToPtr(MessageID)); -EXIT_FN(); +EXIT_INL_FN(); return; } ProcessQueue(DeviceExtension, MessageID, TRUE); @@ -1502,7 +1515,7 @@ ProcessQueue( ENTER_FN(); vq = adaptExt->vq[index]; - VioScsiVQLock(DeviceExtension, MessageID, &queueLock, isr); + VioScsiLockManager(DeviceExtension, MessageID, &queueLock, isr, VIOSCSI_VQLOCKOP_LOCK); do { virtqueue_disable_cb(vq); @@ -1529,12 +1542,12 @@ ENTER_FN(); } } if (bFound) { - HandleResponse(DeviceExtension, cmd); + HandleResponse(DeviceExtension, cmd, "HandleResponse"); } } } while (!virtqueue_enable_cb(vq)); - VioScsiVQUnlock(DeviceExtension, MessageID, &queueLock, isr); + VioScsiLockManager(DeviceExtension, MessageID, &queueLock, isr, VIOSCSI_VQLOCKOP_UNLOCK); EXIT_FN(); } @@ -1578,7 +1591,7 @@ CompletePendingRequests( RhelDbgPrint(TRACE_LEVEL_FATAL, " queue %d cnt %d\n", index, element->srb_cnt); QueueNum = index + VIRTIO_SCSI_REQUEST_QUEUE_0; MsgId = QUEUE_TO_MESSAGE(QueueNum); - VioScsiVQLock(DeviceExtension, MsgId, &LockHandle, FALSE); + VioScsiLockManager(DeviceExtension, MsgId, &LockHandle, FALSE, VIOSCSI_VQLOCKOP_LOCK); while (!IsListEmpty(&element->srb_list)) { PLIST_ENTRY entry = RemoveHeadList(&element->srb_list); if (entry) { @@ -1594,7 +1607,7 @@ CompletePendingRequests( if (element->srb_cnt) { element->srb_cnt = 0; } - VioScsiVQUnlock(DeviceExtension, MsgId, &LockHandle, FALSE); + VioScsiLockManager(DeviceExtension, MsgId, &LockHandle, FALSE, VIOSCSI_VQLOCKOP_UNLOCK); } StorPortResume(DeviceExtension); } @@ -1657,21 +1670,24 @@ BOOLEAN FORCEINLINE PreProcessRequest( IN PVOID DeviceExtension, - IN PSRB_TYPE Srb + IN PSRB_TYPE Srb, + IN PVOID InlineFuncName ) { PADAPTER_EXTENSION adaptExt; -ENTER_FN_SRB(); +ENTER_INL_FN_SRB(); adaptExt = (PADAPTER_EXTENSION)DeviceExtension; switch (SRB_FUNCTION(Srb)) { case SRB_FUNCTION_PNP: SRB_SET_SRB_STATUS(Srb, VioScsiProcessPnP(DeviceExtension, Srb)); +EXIT_INL_FN_SRB(); return TRUE; case SRB_FUNCTION_POWER: SRB_SET_SRB_STATUS(Srb, SRB_STATUS_SUCCESS); +EXIT_INL_FN_SRB(); return TRUE; case SRB_FUNCTION_RESET_BUS: @@ -1683,42 +1699,51 @@ ENTER_FN_SRB(); RhelDbgPrint(TRACE_LEVEL_INFORMATION, " Completing all pending SRBs\n"); CompletePendingRequests(DeviceExtension); SRB_SET_SRB_STATUS(Srb, SRB_STATUS_SUCCESS); +EXIT_INL_FN_SRB(); return TRUE; case VioscsiResetDoNothing: RhelDbgPrint(TRACE_LEVEL_INFORMATION, " Doing nothing with all pending SRBs\n"); SRB_SET_SRB_STATUS(Srb, SRB_STATUS_SUCCESS); +EXIT_INL_FN_SRB(); return TRUE; case VioscsiResetBugCheck: RhelDbgPrint(TRACE_LEVEL_INFORMATION, " Let's bugcheck due to this reset event\n"); KeBugCheckEx(0xDEADDEAD, (ULONG_PTR)Srb, SRB_PATH_ID(Srb), SRB_TARGET_ID(Srb), SRB_LUN(Srb)); +EXIT_INL_FN_SRB(); return TRUE; } case SRB_FUNCTION_WMI: VioScsiWmiSrb(DeviceExtension, Srb); +EXIT_INL_FN_SRB(); return TRUE; case SRB_FUNCTION_IO_CONTROL: VioScsiIoControl(DeviceExtension, Srb); +EXIT_INL_FN_SRB(); return TRUE; } -EXIT_FN_SRB(); +EXIT_INL_FN_SRB(); return FALSE; } VOID +FORCEINLINE PostProcessRequest( IN PVOID DeviceExtension, - IN PSRB_TYPE Srb + IN PSRB_TYPE Srb, + IN PVOID InlineFuncName ) { PCDB cdb = NULL; PADAPTER_EXTENSION adaptExt = NULL; PSRB_EXTENSION srbExt = NULL; -ENTER_FN_SRB(); +ENTER_INL_FN_SRB(); if (SRB_FUNCTION(Srb) != SRB_FUNCTION_EXECUTE_SCSI) { +EXIT_INL_FN_SRB(); return; } cdb = SRB_CDB(Srb); if (!cdb) +EXIT_INL_FN_SRB(); return; adaptExt = (PADAPTER_EXTENSION)DeviceExtension; @@ -1743,7 +1768,7 @@ ENTER_FN_SRB(); break; } -EXIT_FN_SRB(); +EXIT_INL_FN_SRB(); } VOID @@ -1757,7 +1782,7 @@ CompleteRequest( ENTER_FN_SRB(); adaptExt = (PADAPTER_EXTENSION)DeviceExtension; - PostProcessRequest(DeviceExtension, Srb); + PostProcessRequest(DeviceExtension, Srb, "PostProcessRequest"); if (adaptExt->resp_time) { @@ -1906,6 +1931,7 @@ ENTER_FN_SRB(); ASSERT(SRB_DATA_BUFFER(Srb)); if (!pSrbWmi) +EXIT_FN_SRB(); return; if (!(pSrbWmi->WMIFlags & SRB_WMI_FLAGS_ADAPTER_REQUEST)) { @@ -2027,6 +2053,7 @@ ParseIdentificationDescr( RhelDbgPrint(TRACE_LEVEL_ERROR, " Unsupported IdentifierType = %x!\n", IdentifierType); break; } +EXIT_FN(); return IdentificationDescr->IdentifierLength; } EXIT_FN(); @@ -2047,15 +2074,18 @@ VioScsiSaveInquiryData( ENTER_FN_SRB(); if (!Srb) +EXIT_FN_SRB(); return; cdb = SRB_CDB(Srb); if (!cdb) +EXIT_FN_SRB(); return; SRB_GET_SCSI_STATUS(Srb, SrbStatus); if (SrbStatus == SRB_STATUS_ERROR) +EXIT_FN_SRB(); return; adaptExt = (PADAPTER_EXTENSION)DeviceExtension; @@ -2126,18 +2156,21 @@ VioScsiPatchInquiryData( PCDB cdb; ULONG dataLen; UCHAR SrbStatus = SRB_STATUS_SUCCESS; - ENTER_FN_SRB(); +ENTER_FN_SRB(); if (!Srb) +EXIT_FN_SRB(); return; cdb = SRB_CDB(Srb); if (!cdb) +EXIT_FN_SRB(); return; SRB_GET_SCSI_STATUS(Srb, SrbStatus); if (SrbStatus == SRB_STATUS_ERROR) +EXIT_FN_SRB(); return; adaptExt = (PADAPTER_EXTENSION)DeviceExtension; @@ -2222,7 +2255,7 @@ ENTER_FN(); case VIOSCSI_MS_ADAPTER_INFORM_GUID_INDEX: { PMS_SM_AdapterInformationQuery pOutBfr = (PMS_SM_AdapterInformationQuery)Buffer; - RhelDbgPrint(TRACE_LEVEL_FATAL, " --> VIOSCSI_MS_ADAPTER_INFORM_GUID_INDEX\n"); + RhelDbgPrint(TRACE_LEVEL_WARNING, " --> VIOSCSI_MS_ADAPTER_INFORM_GUID_INDEX\n"); size = sizeof(MS_SM_AdapterInformationQuery); if (OutBufferSize < size) { @@ -2304,7 +2337,7 @@ VioScsiExecuteWmiMethod( UCHAR status = SRB_STATUS_SUCCESS; UNREFERENCED_PARAMETER(InstanceIndex); - ENTER_FN(); +ENTER_FN(); switch (GuidIndex) { case VIOSCSI_SETUP_GUID_INDEX: @@ -2534,6 +2567,7 @@ ENTER_FN(); UNREFERENCED_PARAMETER(RequestContext); *MofResourceName = VioScsiWmi_MofResourceName; +EXIT_FN(); return SRB_STATUS_SUCCESS; }