VirtualBox

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


Ignore:
Timestamp:
Oct 15, 2007 5:22:37 PM (17 years ago)
Author:
vboxsync
Message:

Fix for Solaris TAP deadlock. Try receiving when there's at least one free
buffer (Solaris pcn driver uses lots of 128-byte buffers).

File:
1 edited

Legend:

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

    r5183 r5298  
    303303                /*
    304304                 * Wait for the device to have space for this frame.
     305                 * Most guests use frame-sized receive buffers, hence non-zero cbMax
     306                 * automatically means there is enough room for entire frame. Some
     307                 * guests (eg. Solaris) use large chains of small receive buffers
     308                 * (each 128 or so bytes large). We will still start receiving as soon
     309                 * as cbMax is non-zero because:
     310                 *  - it would be quite expensive for pfnCanReceive to accurately
     311                 *    determine free receive buffer space
     312                 *  - if we were waiting for enough free buffers, there is a risk
     313                 *    of deadlocking because the guest could be waiting for a receive
     314                 *    overflow error to allocate more receive buffers
    305315                 */
    306316                size_t cbMax = pData->pPort->pfnCanReceive(pData->pPort);
    307                 if (cbMax < cbRead)
     317                if (cbMax == 0)
    308318                {
    309319                    /** @todo receive overflow handling needs serious improving! */
    310320                    STAM_PROFILE_ADV_STOP(&pData->StatReceive, a);
    311321                    STAM_PROFILE_START(&pData->StatRecvOverflows, b);
    312                     while (   cbMax < cbRead
     322                    while (   cbMax == 0
    313323                           && pData->enmState != ASYNCSTATE_TERMINATE)
    314324                    {
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