VirtualBox

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


Ignore:
Timestamp:
Aug 12, 2009 4:18:32 AM (15 years ago)
Author:
vboxsync
Message:

NAT: slirp_can_send (on NAT thread and EMT)
flushes PDM queue on flushing Slirp's one

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

Legend:

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

    r22160 r22192  
    6161 */
    6262#define VBOX_NAT_DELAY_HACK
     63#if 0
     64#define SLIRP_CAN_SAND_IN_PDM 1
     65#define SLIRP_FLUSH_DEV 1
     66#endif
    6367
    6468#define GET_EXTRADATA(pthis, node, name, rc, type, type_name, var)                                  \
     
    537541int slirp_can_output(void *pvUser)
    538542{
     543#ifdef SLIRP_CAN_SAND_IN_PDM
    539544    int status = 0;
    540545    int rc = 0;
     
    552557    }
    553558    return 0;
    554 }
    555 
     559#else
     560   PDRVNAT pThis = (PDRVNAT)pvUser;
     561   return (RT_SUCCESS(pThis->pPort->pfnWaitReceiveAvail(pThis->pPort, 0))? 1 : 0);
     562#endif
     563}
     564
     565void slirp_flush_dev(void *pvUser)
     566{
     567#ifdef SLIRP_FLUSH_DEV
     568    PDRVNAT pThis = (PDRVNAT)pvUser;
     569    /*@todo: idealy should be done in other thread */
     570    PDMQueueFlush(pThis->pSendQueue);
     571#endif
     572}
    556573
    557574/**
  • trunk/src/VBox/Devices/Network/slirp/if.c

    r18902 r22192  
    226226        if_encap(pData, ETH_P_IP, ifm);
    227227
    228         if (!if_queued)
     228        if (!if_queued)
     229        {
     230            slirp_flush_dev(pData->pvUser);
    229231            return;
    230     }
    231 }
     232        }
     233    }
     234}
  • trunk/src/VBox/Devices/Network/slirp/libslirp.h

    r22020 r22192  
    113113 */
    114114unsigned int slirp_get_timeout_ms(PNATState pData);
     115void slirp_flush_dev(void *pvUser);
    115116
    116117# ifndef RT_OS_WINDOWS
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