VirtualBox

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


Ignore:
Timestamp:
Apr 7, 2009 4:12:49 PM (16 years ago)
Author:
vboxsync
Message:

#3815: Solved the problem for e1k.

File:
1 edited

Legend:

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

    r18645 r18834  
    18901890            //desc.status.fIPE   = false;
    18911891            //desc.status.fTCPE  = false;
     1892            /*
     1893             * We need to leave Rx critical section here, otherwise it will block EMT if
     1894             * it happens to enter e1kRegWriteRDT() while we storing the fragment. This
     1895             * will lead to a deadlock as writing to guest memory waits for EMT to hangle
     1896             * the request.
     1897             * Note that it is safe to leave the critical section here since e1kRegWriteRDT()
     1898             * modifies RDT only.
     1899             */
    18921900            if(cb > pState->u16RxBSize)
    18931901            {
    18941902                desc.status.fEOP = false;
     1903                e1kCsRxLeave(pState);
    18951904                e1kStoreRxFragment(pState, &desc, ptr, pState->u16RxBSize);
     1905                rc = e1kCsRxEnter(pState, VERR_SEM_BUSY);
     1906                if (RT_UNLIKELY(rc != VINF_SUCCESS))
     1907                    return rc;
    18961908                ptr += pState->u16RxBSize;
    18971909                cb -= pState->u16RxBSize;
     
    19001912            {
    19011913                desc.status.fEOP = true;
     1914                e1kCsRxLeave(pState);
    19021915                e1kStoreRxFragment(pState, &desc, ptr, cb);
    1903                 break;
     1916#ifdef E1K_LEDS_WITH_MUTEX
     1917                if (RT_LIKELY(e1kCsEnter(pState, VERR_SEM_BUSY, RT_SRC_POS) == VINF_SUCCESS))
     1918                {
     1919#endif /* E1K_LEDS_WITH_MUTEX */
     1920                    pState->led.Actual.s.fReading = 0;
     1921#ifdef E1K_LEDS_WITH_MUTEX
     1922                    e1kCsLeave(pState);
     1923                }
     1924#endif /* E1K_LEDS_WITH_MUTEX */
     1925                return VINF_SUCCESS;
    19041926            }
    19051927            /* Note: RDH is advanced by e1kStoreRxFragment! */
     
    19241946#endif /* E1K_LEDS_WITH_MUTEX */
    19251947
    1926 #ifndef E1K_GLOBAL_MUTEX
    1927     PDMCritSectLeave(&pState->csRx);
    1928 #endif
     1948    e1kCsRxLeave(pState);
    19291949
    19301950    return VINF_SUCCESS;
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