Changeset 22458 in vbox
- Timestamp:
- Aug 26, 2009 9:11:26 AM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r22449 r22458 54 54 #define COUNTERS_INIT 55 55 #include "counters.h" 56 56 57 57 58 /******************************************************************************* … … 168 169 HANDLE hWakeupEvent; 169 170 #endif 170 171 171 172 #define DRV_PROFILE_COUNTER(name, dsc) STAMPROFILE Stat ## name 172 173 #define DRV_COUNTING_COUNTER(name, dsc) STAMCOUNTER Stat ## name … … 209 210 210 211 #ifdef SLIRP_SPLIT_CAN_OUTPUT 212 211 213 static DECLCALLBACK(int) drvNATRecv(PPDMDRVINS pDrvIns, PPDMTHREAD pThread) 212 214 { … … 218 220 while (pThread->enmState == PDMTHREADSTATE_RUNNING) 219 221 { 220 RTReqProcess(pThis->pRecvReqQueue, 0); 222 RTReqProcess(pThis->pRecvReqQueue, 0); 221 223 RTSemEventWait(pThis->EventRecv, RT_INDEFINITE_WAIT); 222 224 } … … 235 237 } 236 238 239 237 240 static DECLCALLBACK(void) drvNATRecvWorker(PDRVNAT pThis, uint8_t *pu8Buf, int cb) 238 241 { 239 242 STAM_PROFILE_START(&pThis->StatNATRecv, a); 240 if (RT_FAILURE(pThis->pPort->pfnWaitReceiveAvail(pThis->pPort, RT_INDEFINITE_WAIT))) 241 { 242 AssertMsgFailed(("NAT: No RX available even on indefinite wait")); 243 } 244 STAM_PROFILE_STOP(&pThis->StatNATRecvWait, a); 245 int rc = pThis->pPort->pfnReceive(pThis->pPort, pu8Buf, cb); 243 244 STAM_PROFILE_START(&pThis->StatNATRecvWait, b); 245 int rc = pThis->pPort->pfnWaitReceiveAvail(pThis->pPort, RT_INDEFINITE_WAIT); 246 AssertMsgRC(rc, ("NAT: No RX available even on indefinite wait; rc=%Rrc", rc)); 247 248 STAM_PROFILE_STOP(&pThis->StatNATRecvWait, b); 249 250 rc = pThis->pPort->pfnReceive(pThis->pPort, pu8Buf, cb); 251 AssertRC(rc); 246 252 RTMemFree(pu8Buf); 253 247 254 STAM_PROFILE_STOP(&pThis->StatNATRecv, a); 248 AssertRC(rc); 249 } 250 #endif 255 } 256 257 #endif /* SLIRP_SPLIT_CAN_OUTPUT */ 251 258 252 259 /** … … 650 657 pReq->u.Internal.aArgs[2] = (uintptr_t)cb; 651 658 pReq->fFlags = RTREQFLAGS_VOID|RTREQFLAGS_NO_WAIT; 652 rc = RTReqQueue(pReq, 0); 659 rc = RTReqQueue(pReq, 0); 653 660 AssertReleaseRC(rc); 654 661 drvNATRecvWakeup(pThis->pDrvIns, pThis->pRecvThread); … … 865 872 * Validate the config. 866 873 */ 867 if (!CFGMR3AreValuesValid(pCfgHandle, 874 if (!CFGMR3AreValuesValid(pCfgHandle, 868 875 "PassDomain\0TFTPPrefix\0BootFile\0Network" 869 876 "\0NextServer\0DNSProxy\0BindIP\0" … … 975 982 # define DRV_PROFILE_COUNTER(name, dsc) REGISTER_COUNTER(name, pThis, STAMTYPE_PROFILE, STAMUNIT_TICKS_PER_CALL, dsc) 976 983 # define DRV_COUNTING_COUNTER(name, dsc) REGISTER_COUNTER(name, pThis, STAMTYPE_COUNTER, STAMUNIT_COUNT, dsc) 977 # include "counters.h" 984 # include "counters.h" 978 985 #endif 979 986 … … 1103 1110 NULL, 1104 1111 /* pfnDetach */ 1105 NULL, 1112 NULL, 1106 1113 /* pfnPowerOff */ 1107 NULL, 1114 NULL, 1108 1115 /* pfnSoftReset */ 1109 1116 NULL, -
trunk/src/VBox/Devices/Network/slirp/counters.h
r22449 r22458 25 25 26 26 /* 27 * COUNTERS_INIT is used before using counters.h to declare helping macro 27 * COUNTERS_INIT is used before using counters.h to declare helping macro 28 28 * definitions for (de-)registering counters 29 29 */ 30 30 #ifndef COUNTERS_H 31 31 # define COUNTERS_H 32 # if defined(VBOX_WITH_STATISTICS) 32 # if defined(VBOX_WITH_STATISTICS) 33 33 # define REGISTER_COUNTER(name, storage, type, units, dsc) \ 34 34 do { \ … … 122 122 DRV_PROFILE_COUNTER(NATRecvWait,"Time spent in NATRecv worker in waiting of free RX buffers"); 123 123 # endif 124 DRV_COUNTING_COUNTER(QueuePktSent, "counting packet sent via PDM Queue"); /**< counting packet sent via PDM queue */125 DRV_COUNTING_COUNTER(QueuePktDropped, "counting packet drops by PDM Queue"); /**< counting packet drops by PDM queue */126 DRV_COUNTING_COUNTER(ConsumerFalse, "counting consumer's reject number to process the queue's item"); /**< how often to wait for guest RX buffers */124 DRV_COUNTING_COUNTER(QueuePktSent, "counting packet sent via PDM Queue"); 125 DRV_COUNTING_COUNTER(QueuePktDropped, "counting packet drops by PDM Queue"); 126 DRV_COUNTING_COUNTER(ConsumerFalse, "counting consumer's reject number to process the queue's item"); 127 127 # endif 128 128 #endif /*!COUNTERS_INIT*/
Note:
See TracChangeset
for help on using the changeset viewer.