Changeset 105025 in vbox
- Timestamp:
- Jun 25, 2024 8:40:19 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNATlibslirp.cpp
r105024 r105025 184 184 { 185 185 Assert(!pSgBuf->pvUser); 186 187 186 RTMemFree(pSgBuf->aSegs[0].pvSeg); 188 RTMemFree(pSgBuf->pvAllocator);189 190 187 pSgBuf->pvAllocator = NULL; 191 188 } … … 205 202 * @param pThis Pointer to the NAT instance. 206 203 * @param pSgBuf The scatter/gather buffer. 204 * 207 205 * @thread NAT 208 206 */ 209 207 static DECLCALLBACK(void) drvNATSendWorker(PDRVNAT pThis, PPDMSCATTERGATHER pSgBuf) 210 208 { 211 LogFlowFunc(("pThis=%p pSgBuf=%p\n", pThis, pSgBuf));212 213 209 if (pThis->enmLinkState == PDMNETWORKLINKSTATE_UP) 214 210 { … … 219 215 * A normal frame. 220 216 */ 221 LogFlowFunc(("m=%p\n", m));222 217 slirp_input(pThis->pNATState->pSlirp, (uint8_t const *)pSgBuf->pvAllocator, (int)pSgBuf->cbUsed); 223 218 } … … 225 220 { 226 221 /* 227 * M_EXT buf, need to segment it.222 * Large/GSO frame. 228 223 */ 229 224 … … 254 249 } 255 250 256 LogFlowFunc(("leave\n"));257 251 drvNATFreeSgBuf(pThis, pSgBuf); 258 252 } … … 260 254 /** 261 255 * @interface_method_impl{PDMINETWORKUP,pfnBeginXmit} 256 * 257 * @param pInterface Pointer to UP network interface. 258 * @param fOnWorkerThread Unused. 259 * 260 * @returns VBox status code. 261 * 262 * @thread ? 262 263 */ 263 264 static DECLCALLBACK(int) drvNATNetworkUp_BeginXmit(PPDMINETWORKUP pInterface, bool fOnWorkerThread) … … 277 278 /** 278 279 * @interface_method_impl{PDMINETWORKUP,pfnAllocBuf} 280 * 281 * Allocates a scatter/gather buffer for packet/frame handling. 282 * 283 * @param pInterface Pointer to UP network interface. 284 * @param cbMin Minimum size of buffer to hold packet/frame. 285 * @param pGso The GSO context. 286 * @param ppSgBuf Pointer to the resulting scatter/gather buffer. 287 * 288 * @returns VBox status code 289 * 290 * @thread ? 279 291 */ 280 292 static DECLCALLBACK(int) drvNATNetworkUp_AllocBuf(PPDMINETWORKUP pInterface, size_t cbMin, … … 283 295 PDRVNAT pThis = RT_FROM_MEMBER(pInterface, DRVNAT, INetworkUp); 284 296 Assert(RTCritSectIsOwner(&pThis->XmitLock)); 285 286 LogFlowFunc(("enter\n"));287 297 288 298 /* … … 367 377 /** 368 378 * @interface_method_impl{PDMINETWORKUP,pfnFreeBuf} 379 * 380 * Wrapper function for drvNATFreeSgBuff. 381 * 382 * @param pInterface Pointer to UP network interface. 383 * @param pSgBuf Pointer to scatter/gather buffer to be freed. 384 * 385 * @thread ? 369 386 */ 370 387 static DECLCALLBACK(int) drvNATNetworkUp_FreeBuf(PPDMINETWORKUP pInterface, PPDMSCATTERGATHER pSgBuf) … … 378 395 /** 379 396 * @interface_method_impl{PDMINETWORKUP,pfnSendBuf} 397 * 398 * Sends packet/frame out to network (up from guest). 399 * 400 * @param pInterface Pointer to UP network interface. 401 * @param pSgBuf Pointer to scatter/gather packet/frame buffer. 402 * @param fOnWorkerThread Unused. 403 * 404 * @thread ? 380 405 */ 381 406 static DECLCALLBACK(int) drvNATNetworkUp_SendBuf(PPDMINETWORKUP pInterface, PPDMSCATTERGATHER pSgBuf, bool fOnWorkerThread) … … 386 411 Assert(RTCritSectIsOwner(&pThis->XmitLock)); 387 412 388 LogFlowFunc(("enter\n"));389 390 413 int rc; 391 414 if (pThis->pSlirpThread->enmState == PDMTHREADSTATE_RUNNING) … … 397 420 { 398 421 drvNATNotifyNATThread(pThis, "drvNATNetworkUp_SendBuf"); 399 LogFlowFunc(("leave success\n"));400 422 return VINF_SUCCESS; 401 423 } … … 405 427 else 406 428 rc = VERR_NET_DOWN; 429 407 430 drvNATFreeSgBuf(pThis, pSgBuf); 408 LogFlowFunc(("leave rc=%Rrc\n", rc));409 431 return rc; 410 432 } … … 412 434 /** 413 435 * @interface_method_impl{PDMINETWORKUP,pfnEndXmit} 436 * 437 * End transmission. 438 * 439 * @param pInterface Pointer to UP network interface. 440 * 441 * @thread ? 414 442 */ 415 443 static DECLCALLBACK(void) drvNATNetworkUp_EndXmit(PPDMINETWORKUP pInterface) … … 421 449 /** 422 450 * Get the NAT thread out of poll/WSAWaitForMultipleEvents 451 * 452 * @param pThis Pointer to DRVNAT state for current context. 453 * @param pszWho String identifying caller. 454 * 455 * @thread ? 423 456 */ 424 457 static void drvNATNotifyNATThread(PDRVNAT pThis, const char *pszWho) … … 430 463 size_t cbIgnored; 431 464 rc = RTPipeWrite(pThis->hPipeWrite, "", 1, &cbIgnored); 432 #else433 /* kick WSAWaitForMultipleEvents */434 rc = WSASetEvent(pThis->hWakeupEvent);435 465 #endif 436 466 AssertRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.