VirtualBox

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


Ignore:
Timestamp:
Apr 1, 2020 7:18:42 AM (5 years ago)
Author:
vboxsync
Message:

Network/DevVirtioNet_1_0.cpp: Round trip traffic happening continuously with network activity, but pings are not resolving yet. Need to dig into higher level packet traces, and validate thing like checksumming, etc...

File:
1 edited

Legend:

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

    r83187 r83499  
    766766    uint16_t uAvailRingIdx = virtioReadAvailRingIdx(pDevIns, pVirtio, idxQueue);
    767767    uint16_t uNextAvailIdx = pVirtio->virtqState[idxQueue].uAvailIdx;
    768     int16_t  iDelta = uAvailRingIdx - uNextAvailIdx;
    769768    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;
    771772}
    772773/**
     
    906907              VIRTQNAME(pVirtio, idxQueue), virtioReadUsedRingIdx(pDevIns, pVirtio, idxQueue)));
    907908
    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). */
    913910
    914911    size_t cbCopy = 0, cbTotal = 0, cbRemain = 0;
     
    937934    }
    938935
    939 
    940936    /* If this write-ahead crosses threshold where the driver wants to get an event flag it */
    941937    if (pVirtio->uDriverFeatures & VIRTIO_F_EVENT_IDX)
     
    946942     * Place used buffer's descriptor in used ring but don't update used ring's slot index.
    947943     * 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));
    952949
    953950    Log6Func(("Write ahead used_idx=%u, %s used_idx=%u\n",
     
    10691066            return;
    10701067        }
    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"));
    10741070    }
    10751071}
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