Changeset 90447 in vbox for trunk/src/VBox/Devices/Network/DevVirtioNet.cpp
- Timestamp:
- Jul 31, 2021 12:44:13 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevVirtioNet.cpp
r90156 r90447 328 328 return !!(pThis->VPCI.uGuestFeatures & VNET_F_MRG_RXBUF); 329 329 } 330 331 #define VNET_R3_CS_ENTER_RETURN_VOID(a_pDevIns, a_pThis) VPCI_R3_CS_ENTER_RETURN_VOID(a_pDevIns, &(a_pThis)->VPCI) 330 332 331 333 DECLINLINE(int) vnetR3CsEnter(PPDMDEVINS pDevIns, PVNETSTATE pThis, int rcBusy) … … 648 650 RT_NOREF(hTimer, pvUser); 649 651 650 int rc = vnetR3CsEnter(pDevIns, pThis, VERR_SEM_BUSY); 651 AssertRCReturnVoid(rc); 652 VNET_R3_CS_ENTER_RETURN_VOID(pDevIns, pThis); 652 653 653 654 pThis->config.uStatus |= VNET_S_LINK_UP; … … 1509 1510 Log3(("%s vnetR3QueueTransmit: Got kicked with notification disabled, re-enable notification and flush TX queue\n", INSTANCE(pThis))); 1510 1511 vnetR3TransmitPendingPackets(pDevIns, pThis, pThisCC, pQueue, false /*fOnWorkerThread*/); 1511 if (RT_FAILURE(vnetR3CsEnter(pDevIns, pThis, VERR_SEM_BUSY))) 1512 LogRel(("vnetR3QueueTransmit: Failed to enter critical section!/n")); 1513 else 1514 { 1515 vringSetNotification(pDevIns, &pThisCC->pTxQueue->VRing, true); 1516 vnetR3CsLeave(pDevIns, pThis); 1517 } 1512 1513 VNET_R3_CS_ENTER_RETURN_VOID(pDevIns, pThis); 1514 1515 vringSetNotification(pDevIns, &pThisCC->pTxQueue->VRing, true); 1516 1517 vnetR3CsLeave(pDevIns, pThis); 1518 1518 } 1519 1519 else 1520 1520 { 1521 if (RT_FAILURE(vnetR3CsEnter(pDevIns, pThis, VERR_SEM_BUSY))) 1522 LogRel(("vnetR3QueueTransmit: Failed to enter critical section!/n")); 1523 else 1524 { 1525 vringSetNotification(pDevIns, &pThisCC->pTxQueue->VRing, false); 1526 PDMDevHlpTimerSetMicro(pDevIns, pThis->hTxTimer, VNET_TX_DELAY); 1527 pThis->u64NanoTS = RTTimeNanoTS(); 1528 vnetR3CsLeave(pDevIns, pThis); 1529 } 1521 VNET_R3_CS_ENTER_RETURN_VOID(pDevIns, pThis); 1522 1523 vringSetNotification(pDevIns, &pThisCC->pTxQueue->VRing, false); 1524 PDMDevHlpTimerSetMicro(pDevIns, pThis->hTxTimer, VNET_TX_DELAY); 1525 pThis->u64NanoTS = RTTimeNanoTS(); 1526 1527 vnetR3CsLeave(pDevIns, pThis); 1530 1528 } 1531 1529 } … … 1552 1550 // Log3(("%s vnetR3TxTimer: Expired\n", INSTANCE(pThis))); 1553 1551 vnetR3TransmitPendingPackets(pDevIns, pThis, pThisCC, pThisCC->pTxQueue, false /*fOnWorkerThread*/); 1554 int rc = vnetR3CsEnter(pDevIns, pThis, VERR_SEM_BUSY) 1555 AssertLogRelRCReturnVoid(rc);1552 1553 VNET_R3_CS_ENTER_RETURN_VOID(pDevIns, pThis); 1556 1554 vringSetNotification(pDevIns, &pThisCC->pTxQueue->VRing, true); 1557 1555 vnetR3CsLeave(pDevIns, pThis); … … 2043 2041 AssertLogRelReturnVoid(iLUN == 0); 2044 2042 2045 int rc = vnetR3CsEnter(pDevIns, pThis, VERR_SEM_BUSY); 2046 if (RT_FAILURE(rc)) 2047 { 2048 LogRel(("vnetR3Detach failed to enter critical section!\n")); 2049 return; 2050 } 2043 VNET_R3_CS_ENTER_RETURN_VOID(pDevIns, pThis); 2051 2044 2052 2045 vnetR3DestroyTxThreadAndEvent(pDevIns, pThis, pThisCC); … … 2075 2068 2076 2069 int rc = vnetR3CsEnter(pDevIns, pThis, VERR_SEM_BUSY); 2077 if (RT_FAILURE(rc)) 2078 { 2079 LogRel(("vnetR3Attach failed to enter critical section!\n")); 2080 return rc; 2081 } 2070 AssertRCReturn(rc, rc); 2082 2071 2083 2072 /*
Note:
See TracChangeset
for help on using the changeset viewer.