From: VMware, Inc <> Date: Thu, 27 Oct 2011 18:19:45 +0000 (-0700) Subject: Fix QPair wakeup on suspend X-Git-Tag: 2011.10.26-514583~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4973c5ad7a8efc843bfd60f3d246cfbb4f84bd35;p=thirdparty%2Fopen-vm-tools.git Fix QPair wakeup on suspend On vmkernel, we do not unregister the guest memory, when a VM is quiesced, so the queue pairs stay in a *_MEM state, if already there. When detaching from a queue pair, we were only waking up blocked kernel endpoints, if the queue pair was in the *_NO_MEM state, since that would indicate that the QP is quiesced. However, what we need to determine is whether the queue pair headers are still mapped, since that is the common operation for hosted and vmkernel on quiesce/unquiesce. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/modules/linux/vmci/common/vmciQueuePair.c b/open-vm-tools/modules/linux/vmci/common/vmciQueuePair.c index d11636535..340ccaaaf 100644 --- a/open-vm-tools/modules/linux/vmci/common/vmciQueuePair.c +++ b/open-vm-tools/modules/linux/vmci/common/vmciQueuePair.c @@ -1593,6 +1593,7 @@ VMCIQPBroker_Detach(VMCIHandle handle, // IN if (contextId != VMCI_HOST_CONTEXT_ID) { int result; + Bool headersMapped; ASSERT(!isLocal); @@ -1602,8 +1603,9 @@ VMCIQPBroker_Detach(VMCIHandle handle, // IN * more recent VMX'en may detach from a queue pair in the quiesced state. */ + VMCI_AcquireQueueMutex(entry->produceQ); + headersMapped = entry->produceQ->qHeader || entry->consumeQ->qHeader; if (QPBROKERSTATE_HAS_MEM(entry)) { - VMCI_AcquireQueueMutex(entry->produceQ); result = VMCIHost_UnmapQueueHeaders(INVALID_VMCI_GUEST_MEM_ID, entry->produceQ, entry->consumeQ); @@ -1617,14 +1619,13 @@ VMCIQPBroker_Detach(VMCIHandle handle, // IN } else { VMCIHost_UnregisterUserMemory(entry->produceQ, entry->consumeQ); } - VMCI_ReleaseQueueMutex(entry->produceQ); - } else { - VMCI_AcquireQueueMutex(entry->produceQ); + } + if (!headersMapped) { QueuePairResetSavedHeaders(entry); - VMCI_ReleaseQueueMutex(entry->produceQ); - if (entry->wakeupCB) { - entry->wakeupCB(entry->clientData); - } + } + VMCI_ReleaseQueueMutex(entry->produceQ); + if (!headersMapped && entry->wakeupCB) { + entry->wakeupCB(entry->clientData); } } else { if (entry->wakeupCB) { diff --git a/open-vm-tools/modules/linux/vmci/linux/vmci_version.h b/open-vm-tools/modules/linux/vmci/linux/vmci_version.h index 1be2010be..d6a556881 100644 --- a/open-vm-tools/modules/linux/vmci/linux/vmci_version.h +++ b/open-vm-tools/modules/linux/vmci/linux/vmci_version.h @@ -25,8 +25,8 @@ #ifndef _VMCI_VERSION_H_ #define _VMCI_VERSION_H_ -#define VMCI_DRIVER_VERSION 9.3.13.0 -#define VMCI_DRIVER_VERSION_COMMAS 9,3,13,0 -#define VMCI_DRIVER_VERSION_STRING "9.3.13.0" +#define VMCI_DRIVER_VERSION 9.3.14.0 +#define VMCI_DRIVER_VERSION_COMMAS 9,3,14,0 +#define VMCI_DRIVER_VERSION_STRING "9.3.14.0" #endif /* _VMCI_VERSION_H_ */