VirtualBox

Changeset 9594 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 11, 2008 9:45:26 AM (17 years ago)
Author:
vboxsync
Message:

If IntNet is used as a service (for lwIP) then taking it down on suspend/poweroff is way too early. The service and the users of it come later in the notification order and thus have no chance of doing proper connection shutdown. This fixes the 10 seconds suspend/poweroff delay when using iSCSI over IntNet.

File:
1 edited

Legend:

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

    r8300 r9594  
    8585     * When the link is down all incoming packets will be dropped. */
    8686    bool volatile           fLinkDown;
    87     /** Set if data transmission should start immediately. */
    88     bool                    fActivateEarly;
     87    /** Set if data transmission should start immediately and deactivate
     88     * as late as possible. */
     89    bool                    fActivateEarlyDeactivateLate;
    8990
    9091#ifdef VBOX_WITH_STATISTICS
     
    533534    LogFlow(("drvIntNetPowerOff\n"));
    534535    PDRVINTNET pThis = PDMINS2DATA(pDrvIns, PDRVINTNET);
    535     ASMAtomicXchgSize(&pThis->enmState, ASYNCSTATE_SUSPENDED);
     536    if (!pThis->fActivateEarlyDeactivateLate)
     537        ASMAtomicXchgSize(&pThis->enmState, ASYNCSTATE_SUSPENDED);
    536538}
    537539
     
    546548    LogFlow(("drvIntNetPowerResume\n"));
    547549    PDRVINTNET pThis = PDMINS2DATA(pDrvIns, PDRVINTNET);
    548     ASMAtomicXchgSize(&pThis->enmState, ASYNCSTATE_RUNNING);
    549     RTSemEventSignal(pThis->EventSuspended);
     550    if (!pThis->fActivateEarlyDeactivateLate)
     551    {
     552        ASMAtomicXchgSize(&pThis->enmState, ASYNCSTATE_RUNNING);
     553        RTSemEventSignal(pThis->EventSuspended);
     554    }
    550555}
    551556
     
    560565    LogFlow(("drvIntNetPowerSuspend\n"));
    561566    PDRVINTNET pThis = PDMINS2DATA(pDrvIns, PDRVINTNET);
    562     ASMAtomicXchgSize(&pThis->enmState, ASYNCSTATE_SUSPENDED);
     567    if (!pThis->fActivateEarlyDeactivateLate)
     568        ASMAtomicXchgSize(&pThis->enmState, ASYNCSTATE_SUSPENDED);
    563569}
    564570
     
    573579    LogFlow(("drvIntNetPowerOn\n"));
    574580    PDRVINTNET pThis = PDMINS2DATA(pDrvIns, PDRVINTNET);
    575     if (!pThis->fActivateEarly)
     581    if (!pThis->fActivateEarlyDeactivateLate)
    576582    {
    577583        ASMAtomicXchgSize(&pThis->enmState, ASYNCSTATE_RUNNING);
     
    658664    pThis->EventSuspended               = NIL_RTSEMEVENT;
    659665    pThis->enmState                     = ASYNCSTATE_SUSPENDED;
    660     pThis->fActivateEarly              = false;
     666    pThis->fActivateEarlyDeactivateLate = false;
    661667    /* IBase */
    662668    pDrvIns->IBase.pfnQueryInterface    = drvIntNetQueryInterface;
     
    732738                                N_("Configuration error: Failed to get the \"RestrictAccess\" value"));
    733739
    734     rc = CFGMR3QueryBool(pCfgHandle, "IsService", &pThis->fActivateEarly);
     740    rc = CFGMR3QueryBool(pCfgHandle, "IsService", &pThis->fActivateEarlyDeactivateLate);
    735741    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    736         pThis->fActivateEarly = false;
     742        pThis->fActivateEarlyDeactivateLate = false;
    737743    else if (VBOX_FAILURE(rc))
    738744        return PDMDRV_SET_ERROR(pDrvIns, rc,
     
    809815     * Activate data transmission as early as possible
    810816     */
    811     if (pThis->fActivateEarly)
     817    if (pThis->fActivateEarlyDeactivateLate)
    812818    {
    813819        ASMAtomicXchgSize(&pThis->enmState, ASYNCSTATE_RUNNING);
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