VirtualBox

Changeset 22458 in vbox


Ignore:
Timestamp:
Aug 26, 2009 9:11:26 AM (15 years ago)
Author:
vboxsync
Message:

Fixed bad STAM_PROFILE_STOP usage in drvNATRecv

Location:
trunk/src/VBox/Devices/Network
Files:
2 edited

Legend:

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

    r22449 r22458  
    5454#define COUNTERS_INIT
    5555#include "counters.h"
     56
    5657
    5758/*******************************************************************************
     
    168169    HANDLE                  hWakeupEvent;
    169170#endif
    170    
     171
    171172#define DRV_PROFILE_COUNTER(name, dsc)     STAMPROFILE Stat ## name
    172173#define DRV_COUNTING_COUNTER(name, dsc)    STAMCOUNTER Stat ## name
     
    209210
    210211#ifdef SLIRP_SPLIT_CAN_OUTPUT
     212
    211213static DECLCALLBACK(int) drvNATRecv(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
    212214 {
     
    218220    while (pThread->enmState == PDMTHREADSTATE_RUNNING)
    219221    {
    220         RTReqProcess(pThis->pRecvReqQueue, 0); 
     222        RTReqProcess(pThis->pRecvReqQueue, 0);
    221223        RTSemEventWait(pThis->EventRecv, RT_INDEFINITE_WAIT);
    222224    }
     
    235237}
    236238
     239
    237240static DECLCALLBACK(void) drvNATRecvWorker(PDRVNAT pThis, uint8_t *pu8Buf, int cb)
    238241{
    239242    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);
    246252    RTMemFree(pu8Buf);
     253
    247254    STAM_PROFILE_STOP(&pThis->StatNATRecv, a);
    248     AssertRC(rc);
    249 }
    250 #endif
     255}
     256
     257#endif /* SLIRP_SPLIT_CAN_OUTPUT */
    251258
    252259/**
     
    650657    pReq->u.Internal.aArgs[2] = (uintptr_t)cb;
    651658    pReq->fFlags              = RTREQFLAGS_VOID|RTREQFLAGS_NO_WAIT;
    652     rc = RTReqQueue(pReq, 0); 
     659    rc = RTReqQueue(pReq, 0);
    653660    AssertReleaseRC(rc);
    654661    drvNATRecvWakeup(pThis->pDrvIns, pThis->pRecvThread);
     
    865872     * Validate the config.
    866873     */
    867     if (!CFGMR3AreValuesValid(pCfgHandle, 
     874    if (!CFGMR3AreValuesValid(pCfgHandle,
    868875                              "PassDomain\0TFTPPrefix\0BootFile\0Network"
    869876                              "\0NextServer\0DNSProxy\0BindIP\0"
     
    975982# define DRV_PROFILE_COUNTER(name, dsc)     REGISTER_COUNTER(name, pThis, STAMTYPE_PROFILE, STAMUNIT_TICKS_PER_CALL, dsc)
    976983# define DRV_COUNTING_COUNTER(name, dsc)    REGISTER_COUNTER(name, pThis, STAMTYPE_COUNTER, STAMUNIT_COUNT,          dsc)
    977 # include "counters.h" 
     984# include "counters.h"
    978985#endif
    979986
     
    11031110    NULL,
    11041111    /* pfnDetach */
    1105     NULL, 
     1112    NULL,
    11061113    /* pfnPowerOff */
    1107     NULL, 
     1114    NULL,
    11081115    /* pfnSoftReset */
    11091116    NULL,
  • trunk/src/VBox/Devices/Network/slirp/counters.h

    r22449 r22458  
    2525
    2626/*
    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
    2828 * definitions for (de-)registering counters
    2929 */
    3030#ifndef COUNTERS_H
    3131# define COUNTERS_H
    32 # if defined(VBOX_WITH_STATISTICS) 
     32# if defined(VBOX_WITH_STATISTICS)
    3333#  define REGISTER_COUNTER(name, storage, type, units, dsc)         \
    3434    do {                                                            \
     
    122122DRV_PROFILE_COUNTER(NATRecvWait,"Time spent in NATRecv worker in waiting of free RX buffers");
    123123#  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 */
     124DRV_COUNTING_COUNTER(QueuePktSent, "counting packet sent via PDM Queue");
     125DRV_COUNTING_COUNTER(QueuePktDropped, "counting packet drops by PDM Queue");
     126DRV_COUNTING_COUNTER(ConsumerFalse, "counting consumer's reject number to process the queue's item");
    127127# endif
    128128#endif /*!COUNTERS_INIT*/
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