From: VMware, Inc <> Date: Fri, 12 Apr 2013 19:55:15 +0000 (-0700) Subject: Optimize send and receive on VMX vSockets. X-Git-Tag: 2013.04.16-1098359~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e5cd57b6be70b210dcb10e001be9e0d10f7c2e9;p=thirdparty%2Fopen-vm-tools.git Optimize send and receive on VMX vSockets. Skip a lot of extraneous logic in VSockSocket_Send and VSockSocket_Recv by using vmci_qpair_enqueue and vmci_qpair_dequeue directly. This is the same idea as what happens on Mac OS X when data is copied into the host pipe in VSockOS_HandleStreamRecv. This allows us to copy data out of the queue pair as quickly as possible and flush send buffers into the queue pair without waiting for a callback on the poll thread. Client callbacks must still be fired on the poll thread to preserve the AsyncSocket API. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/asyncsocket/asyncsocket.c b/open-vm-tools/lib/asyncsocket/asyncsocket.c index 8375c8c45..db6c1ad2c 100644 --- a/open-vm-tools/lib/asyncsocket/asyncsocket.c +++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c @@ -2654,6 +2654,10 @@ AsyncSocketCheckAndDispatchRecv(AsyncSocket *s, // IN { ASSERT(s); ASSERT(result); + ASSERT(s->recvFn); + ASSERT(s->recvBuf); + ASSERT(s->recvLen > 0); + ASSERT(s->recvPos <= s->recvLen); if (s->recvPos == s->recvLen || s->recvFireOnPartial) { void *recvBuf = s->recvBuf;