diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2022-10-31 08:20:07 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2022-10-31 08:20:07 +0000 |
commit | a8ec96085f21a53ca14f4c060780798c91ddc6c5 (patch) | |
tree | ac07d7cb0cb2044e0388661f425b6726b0cef995 | |
parent | 117bc8ff117ba31749d09a393a790a40facb542c (diff) | |
download | VirtualBox-svn-a8ec96085f21a53ca14f4c060780798c91ddc6c5.tar.gz |
NetworkServices/IntNetSwitch,Devices/Network/DrvIntNet,Devices/Network/SrvIntNetR0: Don't require a dedicated waiting thread to get notified when there is something to receive but make it possible to register a callback which is called and sends an IPC message instead, bugref:10297 [build and scm fixes]
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@97339 cfe28804-0f27-0410-a406-dd0f0b0b656f
-rw-r--r-- | src/VBox/Devices/Network/SrvIntNetR0.cpp | 8 | ||||
-rw-r--r-- | src/VBox/Devices/Network/testcase/tstIntNetR0.cpp | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/VBox/Devices/Network/SrvIntNetR0.cpp b/src/VBox/Devices/Network/SrvIntNetR0.cpp index e19afefa14b..cb163107c68 100644 --- a/src/VBox/Devices/Network/SrvIntNetR0.cpp +++ b/src/VBox/Devices/Network/SrvIntNetR0.cpp @@ -2841,7 +2841,7 @@ static int intnetR0RingWriteFrame(PINTNETRINGBUF pRingBuf, PCINTNETSG pSG, PCRTM /** * Notifies consumers of incoming data from @a pIf that data is available. - */ + */ DECL_FORCE_INLINE(void) intnetR0IfNotifyRecv(PINTNETIF pIf) { #if !defined(VBOX_WITH_INTNET_SERVICE_IN_R3) || !defined(IN_RING3) @@ -4688,6 +4688,7 @@ INTNETR0DECL(int) IntNetR0IfWait(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, ui #if defined(VBOX_WITH_INTNET_SERVICE_IN_R3) && defined(IN_RING3) AssertReleaseFailed(); /* Should never be called. */ + RT_NOREF(cMillies); return VERR_NOT_SUPPORTED; #else const RTSEMEVENT hRecvEvent = pIf->hRecvEvent; @@ -4791,6 +4792,7 @@ INTNETR0DECL(int) IntNetR0IfAbortWait(INTNETIFHANDLE hIf, PSUPDRVSESSION pSessio #if defined(VBOX_WITH_INTNET_SERVICE_IN_R3) && defined(IN_RING3) AssertReleaseFailed(); + RT_NOREF(fNoMoreWaits); return VERR_NOT_SUPPORTED; #else const RTSEMEVENT hRecvEvent = pIf->hRecvEvent; @@ -6650,14 +6652,14 @@ static int intnetR0CreateNetwork(PINTNET pIntNet, PSUPDRVSESSION pSession, const * access check or not. * @param cbSend The send buffer size. * @param cbRecv The receive buffer size. - * @param pfnRecvAvail The receive available callback to call instead of + * @param pfnRecvAvail The receive available callback to call instead of * signalling the semaphore (R3 service only). * @param pvUser The opaque user data to pass to the callback. * @param phIf Where to store the handle to the network interface. */ INTNETR0DECL(int) IntNetR0Open(PSUPDRVSESSION pSession, const char *pszNetwork, INTNETTRUNKTYPE enmTrunkType, const char *pszTrunk, uint32_t fFlags, - uint32_t cbSend, uint32_t cbRecv, PFNINTNETIFRECVAVAIL pfnRecvAvail, void *pvUser, + uint32_t cbSend, uint32_t cbRecv, PFNINTNETIFRECVAVAIL pfnRecvAvail, void *pvUser, PINTNETIFHANDLE phIf) { LogFlow(("IntNetR0Open: pSession=%p pszNetwork=%p:{%s} enmTrunkType=%d pszTrunk=%p:{%s} fFlags=%#x cbSend=%u cbRecv=%u phIf=%p\n", diff --git a/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp b/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp index 9f087a31558..e7c70babb3e 100644 --- a/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp +++ b/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp @@ -446,7 +446,7 @@ typedef TSTSTATE *PTSTSTATE; static int tstOpenInterfaces(PTSTSTATE pThis, const char *pszNetwork, uint32_t cbSend, uint32_t cbRecv) { pThis->hIf0 = INTNET_HANDLE_INVALID; - RTTESTI_CHECK_RC_OK_RET(IntNetR0Open(g_pSession, pszNetwork, kIntNetTrunkType_None, "", 0/*fFlags*/, cbSend, cbRecv, + RTTESTI_CHECK_RC_OK_RET(IntNetR0Open(g_pSession, pszNetwork, kIntNetTrunkType_None, "", 0/*fFlags*/, cbSend, cbRecv, NULL /*pfnRecvAvail*/, NULL /*pvUser*/, &pThis->hIf0), rcCheck); RTTESTI_CHECK_RET(pThis->hIf0 != INTNET_HANDLE_INVALID, VERR_INTERNAL_ERROR); RTTESTI_CHECK_RC_RET(IntNetR0IfGetBufferPtrs(pThis->hIf0, g_pSession, &pThis->pBuf0, NULL), VINF_SUCCESS, rcCheck); @@ -454,7 +454,7 @@ static int tstOpenInterfaces(PTSTSTATE pThis, const char *pszNetwork, uint32_t c pThis->hIf1 = INTNET_HANDLE_INVALID; - RTTESTI_CHECK_RC_OK_RET(IntNetR0Open(g_pSession, pszNetwork, kIntNetTrunkType_None, "", 0/*fFlags*/, cbSend, cbRecv, + RTTESTI_CHECK_RC_OK_RET(IntNetR0Open(g_pSession, pszNetwork, kIntNetTrunkType_None, "", 0/*fFlags*/, cbSend, cbRecv, NULL /*pfnRecvAvail*/, NULL /*pvUser*/, &pThis->hIf1), rcCheck); RTTESTI_CHECK_RET(pThis->hIf1 != INTNET_HANDLE_INVALID, VERR_INTERNAL_ERROR); RTTESTI_CHECK_RC_RET(IntNetR0IfGetBufferPtrs(pThis->hIf1, g_pSession, &pThis->pBuf1, NULL), VINF_SUCCESS, rcCheck); |