Changeset 83499 in vbox for trunk/src/VBox/Devices/VirtIO
- Timestamp:
- Apr 1, 2020 7:18:42 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp
r83187 r83499 766 766 uint16_t uAvailRingIdx = virtioReadAvailRingIdx(pDevIns, pVirtio, idxQueue); 767 767 uint16_t uNextAvailIdx = pVirtio->virtqState[idxQueue].uAvailIdx; 768 int16_t iDelta = uAvailRingIdx - uNextAvailIdx;769 768 uint16_t uDelta = uAvailRingIdx - uNextAvailIdx; 770 return iDelta >= 0 ? uDelta : VIRTQ_MAX_CNT + uDelta; 769 if (uAvailRingIdx > uNextAvailIdx) 770 return uDelta; 771 return VIRTQ_MAX_CNT + uDelta; 771 772 } 772 773 /** … … 906 907 VIRTQNAME(pVirtio, idxQueue), virtioReadUsedRingIdx(pDevIns, pVirtio, idxQueue))); 907 908 908 /* 909 * Copy s/g buf (virtual memory) to guest phys mem (IN direction). This virtual memory 910 * block will be small (fixed portion of response header + sense buffer area or 911 * control commands or error return values)... The bulk of req data xfers to phys mem 912 * is handled by client */ 909 /* Copy s/g buf (virtual memory) to guest phys mem (IN direction). */ 913 910 914 911 size_t cbCopy = 0, cbTotal = 0, cbRemain = 0; … … 937 934 } 938 935 939 940 936 /* If this write-ahead crosses threshold where the driver wants to get an event flag it */ 941 937 if (pVirtio->uDriverFeatures & VIRTIO_F_EVENT_IDX) … … 946 942 * Place used buffer's descriptor in used ring but don't update used ring's slot index. 947 943 * That will be done with a subsequent client call to virtioCoreQueueSync() */ 948 virtioWriteUsedElem(pDevIns, pVirtio, idxQueue, pVirtq->uUsedIdx++, pDescChain->uHeadIdx, (uint32_t)cbCopy); 949 950 Log6Func((".... Copied %zu bytes in %d segs to %u byte buffer, residual=%zu\n", 951 cbTotal - cbRemain, pSgVirtReturn->cSegs, pDescChain->cbPhysReturn, pDescChain->cbPhysReturn - cbCopy)); 944 virtioWriteUsedElem(pDevIns, pVirtio, idxQueue, pVirtq->uUsedIdx++, pDescChain->uHeadIdx, (uint32_t)cbTotal); 945 946 if (pSgVirtReturn) 947 Log6Func((".... Copied %zu bytes in %d segs to %u byte buffer, residual=%zu\n", 948 cbTotal - cbRemain, pSgVirtReturn->cSegs, pDescChain->cbPhysReturn, pDescChain->cbPhysReturn - cbTotal)); 952 949 953 950 Log6Func(("Write ahead used_idx=%u, %s used_idx=%u\n", … … 1069 1066 return; 1070 1067 } 1071 /* REMOVE THIS!!!!!!! DON'T INTEGRATE! EXPERIMENTAL/DEBUG */ 1072 //virtioKick(pDevIns, pVirtio, VIRTIO_ISR_VIRTQ_INTERRUPT, pVirtio->uQueueMsixVector[idxQueue], fForce); 1073 // Log6Func(("...skipping interrupt. Guest flagged VIRTQ_AVAIL_F_NO_INTERRUPT for queue\n")); 1068 1069 Log6Func(("...skipping interrupt. Guest flagged VIRTQ_AVAIL_F_NO_INTERRUPT for queue\n")); 1074 1070 } 1075 1071 }
Note:
See TracChangeset
for help on using the changeset viewer.