VirtualBox

Changeset 44355 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jan 24, 2013 1:27:28 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83319
Message:

PDMNetShaper: Cleanups & fixes (untested). PVM -> PUVM. Note: cs is a register within the VMM, not critical section. :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmnetshaper.h

    r42064 r44355  
    3434
    3535
    36 #define PDM_NETSHAPER_MIN_BUCKET_SIZE 65536 /* bytes */
    37 #define PDM_NETSHAPER_MAX_LATENCY     100   /* milliseconds */
     36/** @defgroup grp_pdm_net_shaper  The PDM Network Shaper API
     37 * @ingroup grp_pdm
     38 * @{
     39 */
     40
     41
     42#define PDM_NETSHAPER_MIN_BUCKET_SIZE UINT32_C(65536) /**< bytes */
     43#define PDM_NETSHAPER_MAX_LATENCY     UINT32_C(100)   /**< milliseconds */
    3844
    3945RT_C_DECLS_BEGIN
     
    4147typedef struct PDMNSFILTER
    4248{
    43     /** [R3] Pointer to the next group in the list. */
    44     struct PDMNSFILTER              *pNext;
    45     /** [R3] Pointer to the bandwidth group. */
    46     struct PDMNSBWGROUP             *pBwGroupR3;
    47     /** [R0] Pointer to the bandwidth group. */
    48     R0PTRTYPE(struct PDMNSBWGROUP *) pBwGroupR0;
    49     /** Becomes true when filter fails to obtain bandwidth. */
    50     bool                             fChoked;
    51     /** [R3] The driver this filter is aggregated into. */
    52     PPDMINETWORKDOWN                 pIDrvNet;
     49    /** Pointer to the next group in the list (ring-3). */
     50    R3PTRTYPE(struct PDMNSFILTER *)     pNextR3;
     51    /** Pointer to the bandwidth group (ring-3). */
     52    R3PTRTYPE(struct PDMNSBWGROUP *)    pBwGroupR3;
     53    /** Pointer to the bandwidth group (ring-0). */
     54    R0PTRTYPE(struct PDMNSBWGROUP *)    pBwGroupR0;
     55    /** Set when the filter fails to obtain bandwidth. */
     56    bool                                fChoked;
     57    /** Aligment padding. */
     58    bool                                afPadding[HC_ARCH_BITS == 32 ? 3 : 7];
     59    /** The driver this filter is aggregated into (ring-3). */
     60    R3PTRTYPE(PPDMINETWORKDOWN)         pIDrvNetR3;
    5361} PDMNSFILTER;
    54 
    55 /** @defgroup grp_pdm_net_shaper  The PDM Network Shaper API
    56  * @ingroup grp_pdm
    57  * @{
    58  */
    5962
    6063/** Pointer to a PDM filter handle. */
     
    6467
    6568
    66 /**
    67  * Obtain bandwidth in a bandwidth group (R0 version).
    68  *
    69  * @returns VBox status code.
    70  * @param   pFilter         Pointer to the filter that allocates bandwidth.
    71  * @param   cbTransfer      Number of bytes to allocate.
    72  */
    73 VMMR0DECL(bool) PDMR0NsAllocateBandwidth(PPDMNSFILTER pFilter, size_t cbTransfer);
    74 
    75 /**
    76  * Obtain bandwidth in a bandwidth group.
    77  *
    78  * @returns VBox status code.
    79  * @param   pFilter         Pointer to the filter that allocates bandwidth.
    80  * @param   cbTransfer      Number of bytes to allocate.
    81  */
    82 VMMR3DECL(bool) PDMR3NsAllocateBandwidth(PPDMNSFILTER pFilter, size_t cbTransfer);
    83 
    84 /**
    85  * Attach network filter driver from bandwidth group.
    86  *
    87  * @returns VBox status code.
    88  * @param   pVM             Handle of VM.
    89  * @param   pDrvIns         The driver instance.
    90  * @param   pcszBwGroup     Name of the bandwidth group to attach to.
    91  * @param   pFilter         Pointer to the filter we attach.
    92  */
    93 VMMR3DECL(int) PDMR3NsAttach(PVM pVM, PPDMDRVINS pDrvIns, const char *pcszBwGroup, PPDMNSFILTER pFilter);
    94 
    95 /**
    96  * Detach network filter driver from bandwidth group.
    97  *
    98  * @returns VBox status code.
    99  * @param   pVM             Handle of VM.
    100  * @param   pDrvIns         The driver instance.
    101  * @param   pFilter         Pointer to the filter we detach.
    102  */
    103 VMMR3DECL(int) PDMR3NsDetach(PVM pVM, PPDMDRVINS pDrvIns, PPDMNSFILTER pFilter);
    104 
    105 /**
    106  * Adjusts the maximum rate for the bandwidth group.
    107  *
    108  * @returns VBox status code.
    109  * @param   pVM                   Handle of VM.
    110  * @param   pcszBwGroup           Name of the bandwidth group to attach to.
    111  * @param   cbTransferPerSecMax   Maximum number of bytes per second to be transmitted.
    112  */
    113 VMMR3DECL(int) PDMR3NsBwGroupSetLimit(PVM pVM, const char *pcszBwGroup, uint64_t cbTransferPerSecMax);
     69VMMDECL(bool)       PDMNsAllocateBandwidth(PPDMNSFILTER pFilter, size_t cbTransfer);
     70VMMR3_INT_DECL(int) PDMR3NsAttach(PUVM pUVM, PPDMDRVINS pDrvIns, const char *pcszBwGroup, PPDMNSFILTER pFilter);
     71VMMR3_INT_DECL(int) PDMR3NsDetach(PUVM pUVM, PPDMDRVINS pDrvIns, PPDMNSFILTER pFilter);
     72VMMR3DECL(int)      PDMR3NsBwGroupSetLimit(PUVM pUVM, const char *pszBwGroup, uint64_t cbPerSecMax);
    11473
    11574/** @} */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette