- Timestamp:
- Apr 7, 2020 9:43:23 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 137006
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevVirtioNet_1_0.cpp
r83593 r83603 1450 1450 AssertMsgReturnStmt(rc == VINF_SUCCESS && pDescChain->cbPhysReturn, 1451 1451 ("Not enough Rx buffers in queue to accomodate ethernet packet\n"), 1452 virtioCoreR3DescChainRelease( pDescChain),1452 virtioCoreR3DescChainRelease(&pThis->Virtio, pDescChain), 1453 1453 VERR_INTERNAL_ERROR); 1454 1454 … … 1458 1458 AssertMsgReturnStmt(pDescChain->pSgPhysReturn->paSegs[0].cbSeg >= sizeof(VIRTIONET_PKT_HDR_T), 1459 1459 ("Desc chain's first seg has insufficient space for pkt header!\n"), 1460 virtioCoreR3DescChainRelease( pDescChain),1460 virtioCoreR3DescChainRelease(&pThis->Virtio, pDescChain), 1461 1461 VERR_INTERNAL_ERROR); 1462 1462 … … 1507 1507 } 1508 1508 1509 virtioCoreR3DescChainRelease( pDescChain);1509 virtioCoreR3DescChainRelease(&pThis->Virtio, pDescChain); 1510 1510 } 1511 1511 … … 2079 2079 { 2080 2080 LogFunc(("%s failed to find expected data on %s, rc = %Rrc\n", INSTANCE(pThis), VIRTQNAME(idxQueue), rc)); 2081 virtioCoreR3DescChainRelease(p DescChain);2081 virtioCoreR3DescChainRelease(pVirtio, pDescChain); 2082 2082 break; 2083 2083 } … … 2151 2151 Log4Func(("Failed to allocate S/G buffer: size=%u rc=%Rrc\n", uSize, rc)); 2152 2152 /* Stop trying to fetch TX descriptors until we get more bandwidth. */ 2153 virtioCoreR3DescChainRelease(p DescChain);2153 virtioCoreR3DescChainRelease(pVirtio, pDescChain); 2154 2154 break; 2155 2155 } … … 2164 2164 } 2165 2165 2166 virtioCoreR3DescChainRelease(p DescChain);2166 virtioCoreR3DescChainRelease(pVirtio, pDescChain); 2167 2167 pDescChain = NULL; 2168 2168 } … … 2288 2288 } 2289 2289 virtioNetR3Ctrl(pDevIns, pThis, pThisCC, pDescChain); 2290 virtioCoreR3DescChainRelease( pDescChain);2290 virtioCoreR3DescChainRelease(&pThis->Virtio, pDescChain); 2291 2291 } 2292 2292 else if (IS_TX_QUEUE(idxQueue)) -
trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp
r83594 r83603 368 368 /** The ring-3 device instance so we can easily get our bearings. */ 369 369 PPDMDEVINSR3 pDevIns; 370 PPDMDEVINSRC pDevInsRC;371 PPDMDEVINSR0 pDevInsR0;372 370 373 371 /** Pointer to attached driver's base interface. */ … … 742 740 virtioCoreR3QueuePut(pDevIns, &pThis->Virtio, EVENTQ_IDX, &ReqSgBuf, pDescChain, true /*fFence*/); 743 741 virtioCoreQueueSync(pDevIns, &pThis->Virtio, EVENTQ_IDX); 744 virtioCoreR3DescChainRelease( pDescChain);742 virtioCoreR3DescChainRelease(&pThis->Virtio, pDescChain); 745 743 746 744 return VINF_SUCCESS; … … 750 748 static void virtioScsiR3FreeReq(PVIRTIOSCSITARGET pTarget, PVIRTIOSCSIREQ pReq) 751 749 { 750 PVIRTIOSCSI pThis = PDMDEVINS_2_DATA(pTarget->pDevIns, PVIRTIOSCSI); 752 751 RTMemFree(pReq->pbSense); 753 752 pReq->pbSense = NULL; 754 virtioCoreR3DescChainRelease( pReq->pDescChain);753 virtioCoreR3DescChainRelease(&pThis->Virtio, pReq->pDescChain); 755 754 pReq->pDescChain = NULL; 756 755 pTarget->pDrvMediaEx->pfnIoReqFree(pTarget->pDrvMediaEx, pReq->hIoReq); … … 1560 1559 LogRel(("Error submitting req packet, resetting %Rrc", rc)); 1561 1560 1562 virtioCoreR3DescChainRelease( pDescChain);1561 virtioCoreR3DescChainRelease(&pThis->Virtio, pDescChain); 1563 1562 } 1564 1563 pWorkerR3->cRedoDescs = 0; … … 1583 1582 } 1584 1583 1585 virtioCoreR3DescChainRelease( pDescChain);1584 virtioCoreR3DescChainRelease(&pThis->Virtio, pDescChain); 1586 1585 } 1587 1586 } -
trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp
r83587 r83603 693 693 pDescChain->pSgPhysReturn = &pDescChain->SgBufIn; 694 694 pDescChain->cbPhysReturn = cbIn; 695 STAM_REL_COUNTER_ADD(&pVirtio->StatDescChainsSegsIn, cSegsIn); 695 696 } 696 697 … … 700 701 pDescChain->pSgPhysSend = &pDescChain->SgBufOut; 701 702 pDescChain->cbPhysSend = cbOut; 702 } 703 703 STAM_REL_COUNTER_ADD(&pVirtio->StatDescChainsSegsOut, cSegsOut); 704 } 705 706 STAM_REL_COUNTER_INC(&pVirtio->StatDescChainsAllocated); 704 707 Log6Func(("%s -- segs OUT: %u (%u bytes) IN: %u (%u bytes) --\n", pVirtq->szVirtqName, cSegsOut, cbOut, cSegsIn, cbIn)); 705 708 … … 731 734 * @returns New reference count. 732 735 * @retval 0 if freed or invalid parameter. 736 * @param pVirtio Pointer to the shared virtio state. 733 737 * @param pDescChain The descriptor chain to reference. NULL is quietly 734 738 * ignored (returns 0). 735 739 */ 736 uint32_t virtioCoreR3DescChainRelease(PVIRTIO _DESC_CHAIN_T pDescChain)740 uint32_t virtioCoreR3DescChainRelease(PVIRTIOCORE pVirtio, PVIRTIO_DESC_CHAIN_T pDescChain) 737 741 { 738 742 if (!pDescChain) … … 746 750 pDescChain->u32Magic = ~VIRTIO_DESC_CHAIN_MAGIC; 747 751 RTMemFree(pDescChain); 752 STAM_REL_COUNTER_INC(&pVirtio->StatDescChainsFreed); 748 753 } 749 754 return cRefs; … … 2103 2108 AssertLogRelRCReturn(rc, PDMDEV_SET_ERROR(pDevIns, rc, N_("virtio: cannot register PCI Capabilities address space"))); 2104 2109 2105 return rc; 2110 /* 2111 * Statistics. 2112 */ 2113 PDMDevHlpSTAMRegisterF(pDevIns, &pVirtio->StatDescChainsAllocated, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 2114 "Total number of allocated descriptor chains", "DescChainsAllocated"); 2115 PDMDevHlpSTAMRegisterF(pDevIns, &pVirtio->StatDescChainsFreed, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 2116 "Total number of freed descriptor chains", "DescChainsFreed"); 2117 PDMDevHlpSTAMRegisterF(pDevIns, &pVirtio->StatDescChainsSegsIn, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 2118 "Total number of inbound segments", "DescChainsSegsIn"); 2119 PDMDevHlpSTAMRegisterF(pDevIns, &pVirtio->StatDescChainsSegsOut, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 2120 "Total number of outbound segments", "DescChainsSegsOut"); 2121 2122 return VINF_SUCCESS; 2106 2123 } 2107 2124 -
trunk/src/VBox/Devices/VirtIO/Virtio_1_0.h
r83587 r83603 288 288 /** The MMIO handle for the PCI capability region (\#2). */ 289 289 IOMMMIOHANDLE hMmioPciCap; 290 291 /** @name Statistics 292 * @{ */ 293 STAMCOUNTER StatDescChainsAllocated; 294 STAMCOUNTER StatDescChainsFreed; 295 STAMCOUNTER StatDescChainsSegsIn; 296 STAMCOUNTER StatDescChainsSegsOut; 297 /** @} */ 290 298 } VIRTIOCORE; 291 299 … … 397 405 uint16_t uHeadIdx, PPVIRTIO_DESC_CHAIN_T ppDescChain); 398 406 uint32_t virtioCoreR3DescChainRetain(PVIRTIO_DESC_CHAIN_T pDescChain); 399 uint32_t virtioCoreR3DescChainRelease(PVIRTIO _DESC_CHAIN_T pDescChain);407 uint32_t virtioCoreR3DescChainRelease(PVIRTIOCORE pVirtio, PVIRTIO_DESC_CHAIN_T pDescChain); 400 408 401 409 int virtioCoreR3QueuePeek(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue,
Note:
See TracChangeset
for help on using the changeset viewer.