VirtualBox

Changeset 71944 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 20, 2018 1:56:33 PM (7 years ago)
Author:
vboxsync
Message:

Applied patch for (bugref:9098) Dev/VirtioNet: no sends on disconnected link; do not raise interrupts until driver ready.

File:
1 edited

Legend:

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

    r71789 r71944  
    528528
    529529/**
     530 * Helper function that raises an interrupt if the guest is ready to receive it.
     531 */
     532int vnetRaiseInterrupt(PVNETSTATE pThis, int rcBusy, uint8_t u8IntCause)
     533{
     534    if (pThis->VPCI.uStatus & VPCI_STATUS_DRV_OK)
     535        return vpciRaiseInterrupt(&pThis->VPCI, rcBusy, u8IntCause);
     536    return rcBusy;
     537}
     538
     539
     540/**
    530541 * Takes down the link temporarily if it's current status is up.
    531542 *
     
    543554    {
    544555        STATUS &= ~VNET_S_LINK_UP;
    545         vpciRaiseInterrupt(&pThis->VPCI, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
     556        vnetRaiseInterrupt(pThis, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
    546557        /* Restore the link back in 5 seconds. */
    547558        int rc = TMTimerSetMillies(pThis->pLinkUpTimer, pThis->cMsLinkUpDelay);
     
    564575        return;
    565576    STATUS |= VNET_S_LINK_UP;
    566     vpciRaiseInterrupt(&pThis->VPCI, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
     577    vnetRaiseInterrupt(pThis, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
    567578    vnetWakeupReceive(pDevIns);
    568579    vnetCsLeave(pThis);
     
    10761087        {
    10771088            Log(("%s Link is up\n", INSTANCE(pThis)));
     1089            pThis->fCableConnected = true;
    10781090            STATUS |= VNET_S_LINK_UP;
    1079             vpciRaiseInterrupt(&pThis->VPCI, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
     1091            vnetRaiseInterrupt(pThis, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
    10801092        }
    10811093        else
     
    10841096            TMTimerStop(pThis->pLinkUpTimer);
    10851097            Log(("%s Link is down\n", INSTANCE(pThis)));
     1098            pThis->fCableConnected = false;
    10861099            STATUS &= ~VNET_S_LINK_UP;
    1087             vpciRaiseInterrupt(&pThis->VPCI, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
     1100            vnetRaiseInterrupt(pThis, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
    10881101        }
    10891102        if (pThis->pDrv)
     
    12761289    {
    12771290        Log(("%s Ignoring transmit requests from non-existent driver (status=0x%x).\n", INSTANCE(pThis), pThis->VPCI.uStatus));
     1291        return;
     1292    }
     1293
     1294    if (!pThis->fCableConnected)
     1295    {
     1296        Log(("%s Ignoring transmit requests while cable is disconnected.\n", INSTANCE(pThis)));
    12781297        return;
    12791298    }
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