VirtualBox

Changeset 22361 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Aug 20, 2009 9:24:47 AM (15 years ago)
Author:
vboxsync
Message:

NAT: more comments (send/recv are terms from the guest's point of view)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r22360 r22361  
    151151    /** Queue for NAT-thread-external events. */
    152152    PRTREQQUEUE             pSlirpReqQueue;
    153     /* Send queue */
    154153#ifndef SLIRP_SPLIT_CAN_OUTPUT
    155     PPDMQUEUE               pSendQueue;
     154    /* Receive PDM queue (deliver packets to the guest) */
     155    PPDMQUEUE               pRecvQueue;
    156156#endif
    157157
     
    170170    STAMCOUNTER             StatQueuePktSent;       /**< counting packet sent via PDM queue */
    171171    STAMCOUNTER             StatQueuePktDropped;    /**< counting packet drops by PDM queue */
    172     STAMCOUNTER             StatConsumerFalse;
     172    STAMCOUNTER             StatConsumerFalse;      /**< how often to wait for guest RX buffers */
    173173#ifdef SLIRP_SPLIT_CAN_OUTPUT
     174    /** thread delivering packets for receiving by the guest */
    174175    PPDMTHREAD              pRecvThread;
     176    /** event to wakeup the guest receive thread */
    175177    RTSEMEVENT              EventRecv;
    176     STAMCOUNTER             StatNATRecvWakeups;
     178    /** Receive Req queue (deliver packets to the guest) */
    177179    PRTREQQUEUE             pRecvReqQueue;
     180    STAMCOUNTER             StatNATRecvWakeups;     /**< how often to wakeup the guest RX thread */
    178181#endif
    179182} DRVNAT;
     
    226229    PDRVNAT pThis = PDMINS_2_DATA(pDrvIns, PDRVNAT);
    227230    int rc = RTSemEventSignal(pThis->EventRecv);
     231
    228232    STAM_COUNTER_INC(&pThis->StatNATRecvWakeups);
    229233    AssertReleaseRC(rc);
     
    233237static DECLCALLBACK(void) drvNATRecvWorker(PDRVNAT pThis, uint8_t *pu8Buf, int cb)
    234238{
    235     int rc;
    236239    if (RT_FAILURE(pThis->pPort->pfnWaitReceiveAvail(pThis->pPort, RT_INDEFINITE_WAIT)))
    237240    {
    238241        AssertMsgFailed(("No RX available even on indefinite wait"));
    239242    }
    240     rc = pThis->pPort->pfnReceive(pThis->pPort, pu8Buf, cb);
     243    int rc = pThis->pPort->pfnReceive(pThis->pPort, pu8Buf, cb);
    241244    RTMemFree(pu8Buf);
    242245    AssertRC(rc);
     
    257260
    258261/**
    259  * Send data to the network.
     262 * Called by the guest to send data to the network.
    260263 *
    261264 * @returns VBox status code.
     
    608611
    609612#ifndef SLIRP_SPLIT_CAN_OUTPUT
    610     PDRVNATQUEUITEM pItem = (PDRVNATQUEUITEM)PDMQueueAlloc(pThis->pSendQueue);
     613    PDRVNATQUEUITEM pItem = (PDRVNATQUEUITEM)PDMQueueAlloc(pThis->pRecvQueue);
    611614    if (pItem)
    612615    {
     
    615618        pItem->mbuf = pvArg;
    616619        Log2(("pItem:%p %.Rhxd\n", pItem, pItem->pu8Buf));
    617         PDMQueueInsert(pThis->pSendQueue, &pItem->Core);
     620        PDMQueueInsert(pThis->pRecvQueue, &pItem->Core);
    618621        STAM_COUNTER_INC(&pThis->StatQueuePktSent);
    619622        return;
     
    10041007#ifndef SLIRP_SPLIT_CAN_OUTPUT
    10051008            rc = PDMDrvHlpPDMQueueCreate(pDrvIns, sizeof(DRVNATQUEUITEM), QUEUE_SIZE, 0,
    1006                                          drvNATQueueConsumer, "NAT", &pThis->pSendQueue);
     1009                                         drvNATQueueConsumer, "NAT", &pThis->pRecvQueue);
    10071010            if (RT_FAILURE(rc))
    10081011            {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette