Changeset 22361 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Aug 20, 2009 9:24:47 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r22360 r22361 151 151 /** Queue for NAT-thread-external events. */ 152 152 PRTREQQUEUE pSlirpReqQueue; 153 /* Send queue */154 153 #ifndef SLIRP_SPLIT_CAN_OUTPUT 155 PPDMQUEUE pSendQueue; 154 /* Receive PDM queue (deliver packets to the guest) */ 155 PPDMQUEUE pRecvQueue; 156 156 #endif 157 157 … … 170 170 STAMCOUNTER StatQueuePktSent; /**< counting packet sent via PDM queue */ 171 171 STAMCOUNTER StatQueuePktDropped; /**< counting packet drops by PDM queue */ 172 STAMCOUNTER StatConsumerFalse; 172 STAMCOUNTER StatConsumerFalse; /**< how often to wait for guest RX buffers */ 173 173 #ifdef SLIRP_SPLIT_CAN_OUTPUT 174 /** thread delivering packets for receiving by the guest */ 174 175 PPDMTHREAD pRecvThread; 176 /** event to wakeup the guest receive thread */ 175 177 RTSEMEVENT EventRecv; 176 STAMCOUNTER StatNATRecvWakeups;178 /** Receive Req queue (deliver packets to the guest) */ 177 179 PRTREQQUEUE pRecvReqQueue; 180 STAMCOUNTER StatNATRecvWakeups; /**< how often to wakeup the guest RX thread */ 178 181 #endif 179 182 } DRVNAT; … … 226 229 PDRVNAT pThis = PDMINS_2_DATA(pDrvIns, PDRVNAT); 227 230 int rc = RTSemEventSignal(pThis->EventRecv); 231 228 232 STAM_COUNTER_INC(&pThis->StatNATRecvWakeups); 229 233 AssertReleaseRC(rc); … … 233 237 static DECLCALLBACK(void) drvNATRecvWorker(PDRVNAT pThis, uint8_t *pu8Buf, int cb) 234 238 { 235 int rc;236 239 if (RT_FAILURE(pThis->pPort->pfnWaitReceiveAvail(pThis->pPort, RT_INDEFINITE_WAIT))) 237 240 { 238 241 AssertMsgFailed(("No RX available even on indefinite wait")); 239 242 } 240 rc = pThis->pPort->pfnReceive(pThis->pPort, pu8Buf, cb);243 int rc = pThis->pPort->pfnReceive(pThis->pPort, pu8Buf, cb); 241 244 RTMemFree(pu8Buf); 242 245 AssertRC(rc); … … 257 260 258 261 /** 259 * Send data to the network.262 * Called by the guest to send data to the network. 260 263 * 261 264 * @returns VBox status code. … … 608 611 609 612 #ifndef SLIRP_SPLIT_CAN_OUTPUT 610 PDRVNATQUEUITEM pItem = (PDRVNATQUEUITEM)PDMQueueAlloc(pThis->p SendQueue);613 PDRVNATQUEUITEM pItem = (PDRVNATQUEUITEM)PDMQueueAlloc(pThis->pRecvQueue); 611 614 if (pItem) 612 615 { … … 615 618 pItem->mbuf = pvArg; 616 619 Log2(("pItem:%p %.Rhxd\n", pItem, pItem->pu8Buf)); 617 PDMQueueInsert(pThis->p SendQueue, &pItem->Core);620 PDMQueueInsert(pThis->pRecvQueue, &pItem->Core); 618 621 STAM_COUNTER_INC(&pThis->StatQueuePktSent); 619 622 return; … … 1004 1007 #ifndef SLIRP_SPLIT_CAN_OUTPUT 1005 1008 rc = PDMDrvHlpPDMQueueCreate(pDrvIns, sizeof(DRVNATQUEUITEM), QUEUE_SIZE, 0, 1006 drvNATQueueConsumer, "NAT", &pThis->p SendQueue);1009 drvNATQueueConsumer, "NAT", &pThis->pRecvQueue); 1007 1010 if (RT_FAILURE(rc)) 1008 1011 {
Note:
See TracChangeset
for help on using the changeset viewer.