VirtualBox

Changeset 84468 in vbox for trunk/src/VBox/Devices/VirtIO


Ignore:
Timestamp:
May 23, 2020 7:17:02 AM (5 years ago)
Author:
vboxsync
Message:

Network/DevVirtioNet_1.0.cpp: Removed force interrupt flag from API and calls since it is no longer a necessary workardound option due to fixing how avail ring flags are read.

Location:
trunk/src/VBox/Devices/VirtIO
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.cpp

    r84430 r84468  
    129129/* Internal Functions */
    130130
    131 static void virtioNotifyGuestDriver(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue, bool fForce);
    132 static int  virtioKick(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint8_t uCause, uint16_t uVec, bool fForce);
     131static void virtioNotifyGuestDriver(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue);
     132static int  virtioKick(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint8_t uCause, uint16_t uVec);
    133133
    134134/** @name Internal queue operations
     
    812812void virtioCoreNotifyConfigChanged(PVIRTIOCORE pVirtio)
    813813{
    814     virtioKick(pVirtio->pDevInsR3, pVirtio, VIRTIO_ISR_DEVICE_CONFIG, pVirtio->uMsixConfig, false);
     814    virtioKick(pVirtio->pDevInsR3, pVirtio, VIRTIO_ISR_DEVICE_CONFIG, pVirtio->uMsixConfig);
    815815}
    816816
     
    850850    {
    851851        pVirtio->fGenUpdatePending = true;
    852         virtioKick(pVirtio->pDevInsR3, pVirtio, VIRTIO_ISR_DEVICE_CONFIG, pVirtio->uMsixConfig, false /* fForce */);
     852        virtioKick(pVirtio->pDevInsR3, pVirtio, VIRTIO_ISR_DEVICE_CONFIG, pVirtio->uMsixConfig);
    853853    }
    854854}
     
    10781078 * @param   pVirtio     Pointer to the shared virtio state.
    10791079 * @param   idxQueue    Queue number
    1080  * @param   fForce      Force guest notification even if VIRTQ_USED_F_NO_NOTIFY is set
    10811080 *
    10821081 * @returns VBox status code.
     
    10841083 * @retval  VERR_INVALID_STATE VirtIO not in ready state
    10851084 */
    1086 int virtioCoreQueueSync(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue, bool fForce)
     1085int virtioCoreQueueSync(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue)
    10871086{
    10881087    Assert(idxQueue        < RT_ELEMENTS(pVirtio->virtqState));
     
    10961095
    10971096    virtioWriteUsedRingIdx(pDevIns, pVirtio, idxQueue, pVirtq->uUsedIdx);
    1098     virtioNotifyGuestDriver(pDevIns, pVirtio, idxQueue, fForce);
     1097    virtioNotifyGuestDriver(pDevIns, pVirtio, idxQueue);
    10991098
    11001099    return VINF_SUCCESS;
     
    11341133 * @param   pVirtio     Pointer to the shared virtio state.
    11351134 * @param   idxQueue    Queue to check for guest interrupt handling preference
    1136  * @param   fForce      Overrides idxQueue, forcing notification regardless of driver's
    1137  *                      notification preferences. This is a safeguard to prevent
    1138  *                      stalls upon resuming the VM. VirtIO 1.0 specification Section 4.1.5.5
    1139  *                      indicates spurious interrupts are harmless to guest driver's state,
    1140  *                      as they only cause the guest driver to [re]scan queues for work to do.
    1141  */
    1142 static void virtioNotifyGuestDriver(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue, bool fForce)
     1135 */
     1136static void virtioNotifyGuestDriver(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue)
    11431137{
    11441138
     
    11601154                   VIRTQNAME(pVirtio, idxQueue), (uint16_t)virtioReadAvailUsedEvent(pDevIns, pVirtio, idxQueue)));
    11611155#endif
    1162             virtioKick(pDevIns, pVirtio, VIRTIO_ISR_VIRTQ_INTERRUPT, pVirtio->uQueueMsixVector[idxQueue], fForce);
     1156            virtioKick(pDevIns, pVirtio, VIRTIO_ISR_VIRTQ_INTERRUPT, pVirtio->uQueueMsixVector[idxQueue]);
    11631157            pVirtq->fEventThresholdReached = false;
    11641158            return;
     
    11721166    {
    11731167        /** If guest driver hasn't suppressed interrupts, interrupt  */
    1174         if (fForce || !(virtioReadAvailRingFlags(pDevIns, pVirtio, idxQueue) & VIRTQ_AVAIL_F_NO_INTERRUPT))
    1175         {
    1176             if (fForce)
    1177                 Log6Func(("... kicking guest, queue %s, because force flag set\n", VIRTQNAME(pVirtio, idxQueue)));
    1178             virtioKick(pDevIns, pVirtio, VIRTIO_ISR_VIRTQ_INTERRUPT, pVirtio->uQueueMsixVector[idxQueue], fForce);
     1168        if (!(virtioReadAvailRingFlags(pDevIns, pVirtio, idxQueue) & VIRTQ_AVAIL_F_NO_INTERRUPT))
     1169        {
     1170            virtioKick(pDevIns, pVirtio, VIRTIO_ISR_VIRTQ_INTERRUPT, pVirtio->uQueueMsixVector[idxQueue]);
    11791171            return;
    11801172        }
     
    11911183 * @param   uCause      Interrupt cause bit mask to set in PCI ISR port.
    11921184 * @param   uVec        MSI-X vector, if enabled
    1193  * @param   uForce      True of out-of-band
    1194  */
    1195 static int virtioKick(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint8_t uCause, uint16_t uMsixVector, bool fForce)
    1196 {
    1197     if (fForce)
    1198         Log6Func(("reason: forced\n"));
    1199     else
     1185 */
     1186static int virtioKick(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint8_t uCause, uint16_t uMsixVector)
     1187{
    12001188    if (uCause == VIRTIO_ISR_VIRTQ_INTERRUPT)
    12011189        Log6Func(("reason: buffer added to 'used' ring.\n"));
     
    19081896            break;
    19091897        case kvirtIoVmStateChangedResume:
    1910             virtioNotifyGuestDriver(pVirtio->pDevInsR3, pVirtio, 0 /* idxQueue */, true /* fForce */);
     1898            virtioNotifyGuestDriver(pVirtio->pDevInsR3, pVirtio, 0 /* idxQueue */);
    19111899            break;
    19121900        default:
  • trunk/src/VBox/Devices/VirtIO/Virtio_1_0.h

    r84384 r84468  
    402402
    403403
    404 /** @name virtq related flags
    405  * @{ */
    406 #define VIRTQ_DESC_F_NEXT                               1        /**< Indicates this descriptor chains to next  */
    407 #define VIRTQ_DESC_F_WRITE                              2        /**< Marks buffer as write-only (default ro)   */
    408 #define VIRTQ_DESC_F_INDIRECT                           4        /**< Buffer is list of buffer descriptors      */
    409 
    410 #define VIRTQ_USED_F_NO_NOTIFY                          1        /**< Dev to Drv: Don't notify when buf added   */
    411 #define VIRTQ_AVAIL_F_NO_INTERRUPT                      1        /**< Drv to Dev: Don't notify when buf eaten   */
    412 /** @} */
    413 
    414 
    415404/** @name API for VirtIO parent device
    416405 * @{ */
     
    435424
    436425int  virtioCoreR3QueuePendingCount(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue);
    437 int  virtioCoreQueueSync(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue, bool fForce);
     426int  virtioCoreQueueSync(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue);
    438427bool virtioCoreQueueIsEmpty(PPDMDEVINS pDevIns, PVIRTIOCORE pVirtio, uint16_t idxQueue);
    439428void virtioCoreQueueEnable(PVIRTIOCORE pVirtio, uint16_t idxQueue, bool fEnabled);
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