VirtualBox

Changeset 90156 in vbox for trunk/src


Ignore:
Timestamp:
Jul 12, 2021 8:36:16 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145659
Message:

Dev/VirtioNet: (bugref:8651) Fixed connectivity loss due to stuck TX thread on cable disconnection.

File:
1 edited

Legend:

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

    r88491 r90156  
    13521352{
    13531353    /*
     1354     * Let's deal with the cases we are not going to transmit anything,
     1355     * to avoid setting 'uIsTransmitting' on and off.
     1356     */
     1357    if ((pThis->VPCI.uStatus & VPCI_STATUS_DRV_OK) == 0)
     1358    {
     1359        Log(("%s Ignoring transmit requests from non-existent driver (status=0x%x).\n", INSTANCE(pThis), pThis->VPCI.uStatus));
     1360        return;
     1361    }
     1362
     1363    if (!vnetR3IsConnected(pDevIns))
     1364    {
     1365        Log(("%s Ignoring transmit requests while cable is disconnected.\n", INSTANCE(pThis)));
     1366        return;
     1367    }
     1368
     1369    /*
    13541370     * Only one thread is allowed to transmit at a time, others should skip
    13551371     * transmission as the packets will be picked up by the transmitting
     
    13581374    if (!ASMAtomicCmpXchgU32(&pThis->uIsTransmitting, 1, 0))
    13591375        return;
    1360 
    1361     if ((pThis->VPCI.uStatus & VPCI_STATUS_DRV_OK) == 0)
    1362     {
    1363         Log(("%s Ignoring transmit requests from non-existent driver (status=0x%x).\n", INSTANCE(pThis), pThis->VPCI.uStatus));
    1364         return;
    1365     }
    1366 
    1367     if (!vnetR3IsConnected(pDevIns))
    1368     {
    1369         Log(("%s Ignoring transmit requests while cable is disconnected.\n", INSTANCE(pThis)));
    1370         return;
    1371     }
    13721376
    13731377    PPDMINETWORKUP pDrv = pThisCC->pDrv;
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