Changeset 18834 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Apr 7, 2009 4:12:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r18645 r18834 1890 1890 //desc.status.fIPE = false; 1891 1891 //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 */ 1892 1900 if(cb > pState->u16RxBSize) 1893 1901 { 1894 1902 desc.status.fEOP = false; 1903 e1kCsRxLeave(pState); 1895 1904 e1kStoreRxFragment(pState, &desc, ptr, pState->u16RxBSize); 1905 rc = e1kCsRxEnter(pState, VERR_SEM_BUSY); 1906 if (RT_UNLIKELY(rc != VINF_SUCCESS)) 1907 return rc; 1896 1908 ptr += pState->u16RxBSize; 1897 1909 cb -= pState->u16RxBSize; … … 1900 1912 { 1901 1913 desc.status.fEOP = true; 1914 e1kCsRxLeave(pState); 1902 1915 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; 1904 1926 } 1905 1927 /* Note: RDH is advanced by e1kStoreRxFragment! */ … … 1924 1946 #endif /* E1K_LEDS_WITH_MUTEX */ 1925 1947 1926 #ifndef E1K_GLOBAL_MUTEX 1927 PDMCritSectLeave(&pState->csRx); 1928 #endif 1948 e1kCsRxLeave(pState); 1929 1949 1930 1950 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.