- Timestamp:
- May 5, 2008 8:09:26 PM (17 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r8599 r8610 600 600 static int pcnetSyncTransmit(PCNetState *pData); 601 601 #endif 602 static void pcnetPollTimerStart(PCNetState *pData); 602 603 603 604 /** … … 1581 1582 pData->aCSR[0] &= ~0x0004; /* clear STOP bit */ 1582 1583 pData->aCSR[0] |= 0x0002; /* STRT */ 1583 pcnetPollTimer (pData);/* start timer if it was stopped */1584 pcnetPollTimerStart(pData); /* start timer if it was stopped */ 1584 1585 } 1585 1586 … … 2533 2534 2534 2535 /** 2535 * Update the poller timer 2536 * @thread EMT, 2536 * Start the poller timer. 2537 * Poll timer interval is fixed to 500Hz. Don't stop it. 2538 * @thread EMT, TAP. 2539 */ 2540 static void pcnetPollTimerStart(PCNetState *pData) 2541 { 2542 TMTimerSet(pData->CTXSUFF(pTimerPoll), 2543 TMTimerGet(pData->CTXSUFF(pTimerPoll)) 2544 + TMTimerFromMilli(pData->CTXSUFF(pTimerPoll), 2)); 2545 } 2546 2547 2548 /** 2549 * Update the poller timer. 2550 * @thread EMT. 2537 2551 */ 2538 2552 static void pcnetPollTimer(PCNetState *pData) … … 2569 2583 * disabled. We wouldn't need to poll for new TX descriptors in that case but it will 2570 2584 * not hurt as waiting for RX descriptors should occur very seldom */ 2571 if ( RT_UNLIKELY(pData->fMaybeOutOfSpace) 2572 || RT_LIKELY(!CSR_STOP(pData) && !CSR_SPND(pData) && !CSR_DPOLL(pData))) 2585 if (RT_LIKELY( !CSR_STOP(pData) 2586 && !CSR_SPND(pData) 2587 && ( !CSR_DPOLL(pData) 2588 || pData->fMaybeOutOfSpace))) 2573 2589 { 2574 2590 /* We ensure that we poll at least every 2ms (500Hz) but not more often than … … 2588 2604 } 2589 2605 if (!TMTimerIsActive(pData->CTXSUFF(pTimerPoll))) 2590 /* Poll timer interval is fixed to 500Hz. Don't stop it. */ 2591 TMTimerSet(pData->CTXSUFF(pTimerPoll), 2592 TMTimerGet(pData->CTXSUFF(pTimerPoll)) 2593 + TMTimerFromMilli(pData->CTXSUFF(pTimerPoll), 2)); 2606 pcnetPollTimerStart(pData); 2594 2607 #endif 2595 2608 } … … 4332 4345 } 4333 4346 LogFlow(("pcnetWaitReceiveAvail: waiting cMillies=%u...\n", cMillies)); 4347 /* Start the poll timer once which will remain active as long fMaybeOutOfSpace 4348 * is true -- even if (transmit) polling is disabled (CSR_DPOLL). */ 4349 rc2 = PDMCritSectEnter(&pData->CritSect, VERR_SEM_BUSY); 4350 AssertReleaseRC(rc2); 4351 pcnetPollTimerStart(pData); 4352 PDMCritSectLeave(&pData->CritSect); 4334 4353 RTSemEventWait(pData->hEventOutOfRxSpace, cMillies); 4335 4354 } -
trunk/src/VBox/Devices/Network/DrvTAP.cpp
r8571 r8610 305 305 int rc = pData->pPort->pfnWaitReceiveAvail(pData->pPort, RT_INDEFINITE_WAIT); 306 306 STAM_PROFILE_ADV_START(&pData->StatReceive, a); 307 308 /* 309 * A return code != VINF_SUCCESS means that we were woken up during a VM 310 * state transistion. Drop the packet and wait for the next one. 311 */ 307 312 if (RT_FAILURE(rc)) 308 break;313 continue; 309 314 310 315 /* -
trunk/src/VBox/Devices/Network/DrvTAPOs2.cpp
r8155 r8610 256 256 257 257 /* 258 * Wait for the device to have some room. 258 * Wait for the device to have some room. A return code != VINF_SUCCESS 259 * means that we were woken up during a VM state transition. Drop the 260 * current packet and wait for the next one. 259 261 */ 260 262 rc = pThis->pPort->pfnWaitReceiveAvail(pThis->pPort, RT_INDEFINITE_WAIT); 261 263 if (RT_FAILURE(rc)) 262 break;264 continue; 263 265 264 266 /* -
trunk/src/VBox/Devices/Network/DrvTAPWin32.cpp
r8155 r8610 225 225 } 226 226 227 /* Not very nice, but what else can we do? */ 227 /* 228 * Wait for the device to have some room. A return code != VINF_SUCCESS 229 * means that we were woken up during a VM state transition. Drop the 230 * current packet and wait for the next one. 231 */ 228 232 rc = pData->pPort->pfnWaitReceiveAvail(pData->pPort, RT_INDEFINITE_WAIT); 229 233 if (RT_FAILURE(rc)) 230 break;234 continue; 231 235 232 236 STAM_COUNTER_INC(&pData->StatPktRecv);
Note:
See TracChangeset
for help on using the changeset viewer.