VirtualBox

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


Ignore:
Timestamp:
Jun 19, 2020 6:51:21 AM (5 years ago)
Author:
vboxsync
Message:

Network/DevVirtioNet_1_0.cpp: Fixes and edits to comments in r138708

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VirtIO/VirtioCore.h

    r84876 r84877  
    214214    uint8_t   uConfigGeneration;                                 /**< RO (device changes when changing configs) */
    215215
    216     /* Virtq-specific fields (values reflect (via MMIO0 the queue indicated with uVirtqSelect) */
     216    /* Virtq-specific fields (values reflect (via MMIO) info related to queue indicated by uVirtqSelect. */
    217217    uint16_t  uVirtqSelect;                                      /**< RW (selects queue focus for these fields) */
    218218    uint16_t  uVirtqSize;                                        /**< RW (queue size, 0 - 2^n)                  */
     
    492492
    493493/**
    494  * Fetches descriptor chain using avail ring of indicated queue and converts the descriptor
    495  * chain into its OUT (to device) and IN to guest components, but does NOT remove it from
    496  * the 'avail' queue. I.e. doesn't advance the ring's slot index.  This can be used with
    497  * virtioCoreVirtqSkip(), which *does* advance the avail index. Together they facilitate
    498  * mechanism that allows work with a queue'd buffer (descriptor chain). be aborted if
    499  * necessary, by not advancing the pointer, or, upon success calling the skip function
    500  * (above) to move to the next element.
    501  *
    502  * Additionally it converts the OUT desc chain data to a contiguous virtual
    503  * memory buffer for easy consumption by the caller. The caller must return the
    504  * descriptor chain pointer via virtioCoreR3VirtqUsedBufPut() and then call virtioCoreVirtqSyncUsedRing()
    505  * at some point to return the data to the guest and complete the transaction.
     494 * This function is identical to virtioCoreR3VirtqAvailBufGet(), except it doesn't 'consume'
     495 * the buffer from the avail ring of the virtq. The peek operation becomes identical to a get
     496 * operation if virtioCoreR3VirtqAvailRingNext() is called to consume the buffer from the avail ring,
     497 * at which point virtioCoreR3VirtqUsedBufPut() must be called to complete the roundtrip
     498 * transaction putting the descriptor on the used ring.
     499 *
    506500 *
    507501 * @param   pDevIns     The device instance.
     
    520514
    521515/**
    522  * This function Fetches next buffer (descriptor chain) from the VirtIO "avail" ring of
    523  * indicated queue and converts the buffer's s/g vectors into OUT (e.g. to host device)
    524  * and IN (e.g. to guest driver) components.
    525  *
    526  * The caller is responsible for GCPhys to HC Virtual Memory conversions and *must*
    527  * return the virtq buffer using virtioCoreR3VirtqUsedBufPut() to complete the roundtrip
    528  * virtq transaction if the caller has subsequently called virtioCoreR3VirtqSkip()
    529  * to advance the pointer in the virtq's avail ring to the next descriptor chain
    530  * (at which point the peek becomes indistinguishable from a get operation)
     516 * This functionf fetches the next buffer (descriptor chain) from the VirtIO "avail" ring of
     517 * indicated queue, and converts the buf's s/g vectors into OUT (e.g. guest-to-host)
     518 * components and and IN (host-to-guest) components.
     519 *
     520 * The caller is responsible for GCPhys to host virtual memory conversions. If the
     521 * virtq buffer being peeked at is "consumed", virtioCoreR3VirtqAvailRingNext() must
     522 * be called and in that case virtioCoreR3VirtqUsedBufPut() must be called to
     523 * complete the roundtrip virtq transaction.
    531524 *
    532525 * @param   pDevIns     The device instance.
     
    551544 * chain into its OUT (to device) and IN to guest components.
    552545 *
    553  * The caller is responsible for GCPhys to HC Virtual Memory conversions and *must*
     546 * The caller is responsible for GCPhys to host virtual memory conversions and *must*
    554547 * return the virtq buffer using virtioCoreR3VirtqUsedBufPut() to complete the roundtrip
    555548 * virtq transaction.
    556  *
    557  * At some some point virtioCoreR3VirtqSync() must be called to return data to the guest,
    558  * completing all the virtioCoreR3VirtqAvailBufGet() and virtioCoreR3VirtqAvailBufPeek()
    559  * transactions that have accumulated since the last call to virtioCoreR3VirtqSync()
    560  *
     549 * *
    561550 * @param   pDevIns     The device instance.
    562551 * @param   pVirtio     Pointer to the shared virtio state.
     
    583572 * guest, the guest must provide buffers for the host to fill to the avail ring of the
    584573 * virtq.
    585  * *
     574 *
     575 * At some some point virtioCoreR3VirtqUsedRingSync() must be called to return data to the guest,
     576 * completing all pending virtioCoreR3VirtqAvailBufPut() transactions that have accumulated since
     577 * the last call to virtioCoreR3VirtqUsedRingSync()
     578
    586579 * @note This does a write-ahead to the used ring of the guest's queue. The data
    587580 *       written won't be seen by the guest until the next call to virtioCoreVirtqSyncUsedRing()
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