VirtualBox

Changeset 24616 in vbox


Ignore:
Timestamp:
Nov 12, 2009 5:34:59 PM (15 years ago)
Author:
vboxsync
Message:

#3987: Virtio: Applied Frank's GC patch and made debug build work as well.

Location:
trunk/src/VBox/Devices
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevVirtioNet.cpp

    r24611 r24616  
    2323
    2424#define LOG_GROUP LOG_GROUP_DEV_VIRTIO_NET
     25#define VNET_GC_SUPPORT
    2526
    2627#include <iprt/ctype.h>
     
    4142// TODO: move declarations to the header file: #include "DevVirtioNet.h"
    4243
     44#ifndef VBOX_DEVICE_STRUCT_TESTCASE
     45
    4346#define INSTANCE(pState) pState->szInstance
    4447#define IFACE_TO_STATE(pIface, ifaceName) ((VPCISTATE *)((char*)pIface - RT_OFFSETOF(VPCISTATE, ifaceName)))
     
    4750
    4851#ifdef DEBUG
    49 #define QUEUENAME(s, q) g_VPCIDevices[s->enmDevType].pfnGetQueueName(s, q)
     52#define QUEUENAME(s, q) (q->pcszName)
    5053#endif /* DEBUG */
     54
     55#endif /* VBOX_DEVICE_STRUCT_TESTCASE */
    5156
    5257//- TODO: Move to Virtio.h ----------------------------------------------------
     
    102107{
    103108    uint16_t   uSize;
     109    uint16_t   padding[3];
    104110    RTGCPHYS   addrDescriptors;
    105111    RTGCPHYS   addrAvail;
     
    115121    uint16_t uNextUsedIndex;
    116122    uint32_t uPageNumber;
     123#ifdef IN_RING3
    117124    void   (*pfnCallback)(void *pvState, struct VQueue *pQueue);
     125#else
     126    RTR3UINTPTR pfnCallback;
     127#endif
     128    R3PTRTYPE(const char *) pcszName;
    118129};
    119130typedef struct VQueue VQUEUE;
     
    143154{
    144155    VIRTIO_NET_ID = 0,
    145     VIRTIO_BLK_ID = 1
     156    VIRTIO_BLK_ID = 1,
     157    VIRTIO_32BIT_HACK = 0x7fffffff
    146158};
    147159
     160#define VIRTIO_NET_NQUEUES 3
     161#define VIRTIO_MAX_NQUEUES 3
     162
    148163struct VPCIState_st
    149164{
    150     PDMCRITSECT cs;                  /**< Critical section - what is it protecting? */
     165    PDMCRITSECT            cs;      /**< Critical section - what is it protecting? */
    151166    /* Read-only part, never changes after initialization. */
    152     VirtioDeviceType        enmDevType;               /**< Device type: net or blk. */
    153     char                    szInstance[8];         /**< Instance name, e.g. VNet#1. */
    154 
    155     PDMIBASE                IBase;
    156     PDMILEDPORTS            ILeds;                               /**< LED interface */
    157     R3PTRTYPE(PPDMILEDCONNECTORS)    pLedsConnector;
    158 
    159     PPDMDEVINSR3            pDevInsR3;                   /**< Device instance - R3. */
    160     PPDMDEVINSR0            pDevInsR0;                   /**< Device instance - R0. */
    161     PPDMDEVINSRC            pDevInsRC;                   /**< Device instance - RC. */
     167#if HC_ARCH_BITS == 64
     168    uint32_t               padding1;
     169#endif
     170    VirtioDeviceType       enmDevType;               /**< Device type: net or blk. */
     171    char                   szInstance[8];         /**< Instance name, e.g. VNet#1. */
     172
     173    PDMIBASE               IBase;
     174    PDMILEDPORTS           ILeds;                               /**< LED interface */
     175    R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector;
     176
     177    PPDMDEVINSR3           pDevInsR3;                   /**< Device instance - R3. */
     178    PPDMDEVINSR0           pDevInsR0;                   /**< Device instance - R0. */
     179    PPDMDEVINSRC           pDevInsRC;                   /**< Device instance - RC. */
     180
     181#if HC_ARCH_BITS == 64
     182    uint32_t               padding2;
     183#endif
    162184
    163185    /** TODO */
    164     PCIDEVICE   pciDevice;
     186    PCIDEVICE              pciDevice;
    165187    /** Base port of I/O space region. */
    166     RTIOPORT    addrIOPort;
     188    RTIOPORT               addrIOPort;
    167189
    168190    /* Read/write part, protected with critical section. */
    169191    /** Status LED. */
    170     PDMLED      led;
    171 
    172     uint32_t    uGuestFeatures;
    173     uint16_t    uQueueSelector; /**< An index in aQueues array. */
    174     uint8_t     uStatus; /**< Device Status (bits are device-specific). */
    175     uint8_t     uISR; /**< Interrupt Status Register. */
    176     PVQUEUE     pQueues;
     192    PDMLED                 led;
     193
     194    uint32_t               uGuestFeatures;
     195    uint16_t               uQueueSelector;         /**< An index in aQueues array. */
     196    uint8_t                uStatus; /**< Device Status (bits are device-specific). */
     197    uint8_t                uISR;                   /**< Interrupt Status Register. */
     198
     199#if HC_ARCH_BITS == 64
     200    uint32_t               padding3;
     201#endif
     202
     203    VQUEUE                 Queues[VIRTIO_MAX_NQUEUES];
    177204
    178205#if defined(VBOX_WITH_STATISTICS)
    179     STAMPROFILEADV                      StatIOReadGC;
    180     STAMPROFILEADV                      StatIOReadHC;
    181     STAMPROFILEADV                      StatIOWriteGC;
    182     STAMPROFILEADV                      StatIOWriteHC;
    183     STAMCOUNTER                         StatIntsRaised;
     206    STAMPROFILEADV         StatIOReadGC;
     207    STAMPROFILEADV         StatIOReadHC;
     208    STAMPROFILEADV         StatIOWriteGC;
     209    STAMPROFILEADV         StatIOWriteHC;
     210    STAMCOUNTER            StatIntsRaised;
    184211#endif /* VBOX_WITH_STATISTICS */
    185212};
     
    205232/*****************************************************************************/
    206233
    207 struct VirtioPCIDevices
     234#ifndef VBOX_DEVICE_STRUCT_TESTCASE
     235
     236#ifdef IN_RING3
     237const struct VirtioPCIDevices
    208238{
    209239    uint16_t    uPCIVendorId;
     
    222252    void      (*pfnReset)(void *pvState);
    223253    void      (*pfnReady)(void *pvState);
    224 #ifdef DEBUG
    225     const char *(*pfnGetQueueName)(void *pvState, PVQUEUE pQueue);
    226 #endif /* DEBUG */
    227254} g_VPCIDevices[] =
    228255{
    229256    /*  Vendor  Device SSVendor SubSys             Class   NQ Name          Instance */
    230257    { /* Virtio Network Device */
    231         0x1AF4, 0x1000, 0x1AF4, 1 + VIRTIO_NET_ID, 0x0200, 3, "virtio-net", "vnet%d",
     258        0x1AF4, 0x1000, 0x1AF4, 1 + VIRTIO_NET_ID, 0x0200, VIRTIO_NET_NQUEUES,
     259                                                              "virtio-net", "vnet%d",
    232260        vnetGetHostFeatures, vnetGetHostMinimalFeatures, vnetSetHostFeatures,
    233261        vnetGetConfig, vnetSetConfig, vnetReset, vnetReady
    234 #ifdef DEBUG
    235         , vnetGetQueueName
    236 #endif /* DEBUG */
    237262    },
    238263    { /* Virtio Block Device */
    239264        0x1AF4, 0x1001, 0x1AF4, 1 + VIRTIO_BLK_ID, 0x0180, 2, "virtio-blk", "vblk%d",
    240265        NULL, NULL, NULL, NULL, NULL, NULL, NULL
    241 #ifdef DEBUG
    242         , NULL
    243 #endif /* DEBUG */
    244266    },
    245267};
    246 
     268#endif
     269
     270#endif /* VBOX_DEVICE_STRUCT_TESTCASE */
    247271
    248272/*****************************************************************************/
     
    488512}
    489513
     514#ifdef IN_RING3
    490515void vpciReset(PVPCISTATE pState)
    491516{
     
    496521
    497522    for (unsigned i = 0; i < g_VPCIDevices[pState->enmDevType].nQueues; i++)
    498         vqueueReset(&pState->pQueues[i]);
    499 }
     523        vqueueReset(&pState->Queues[i]);
     524}
     525#endif
    500526
    501527
     
    543569}
    544570
     571#ifdef IN_RING3
    545572DECLINLINE(uint32_t) vpciGetHostFeatures(PVPCISTATE pState)
    546573{
     
    548575        | VPCI_F_NOTIFY_ON_EMPTY;
    549576}
     577#endif
    550578
    551579/**
     
    574602        case VPCI_HOST_FEATURES:
    575603            /* Tell the guest what features we support. */
     604#ifdef IN_RING3
    576605            *pu32 = vpciGetHostFeatures(pState) | VPCI_F_BAD_FEATURE;
     606#else
     607            rc = VINF_IOM_HC_IOPORT_READ;
     608#endif
    577609            break;
    578610
     
    582614
    583615        case VPCI_QUEUE_PFN:
    584             *pu32 = pState->pQueues[pState->uQueueSelector].uPageNumber;
     616            *pu32 = pState->Queues[pState->uQueueSelector].uPageNumber;
    585617            break;
    586618
    587619        case VPCI_QUEUE_NUM:
    588620            Assert(cb == 2);
    589             *(uint16_t*)pu32 = pState->pQueues[pState->uQueueSelector].VRing.uSize;
     621            *(uint16_t*)pu32 = pState->Queues[pState->uQueueSelector].VRing.uSize;
    590622            break;
    591623
     
    609641        default:
    610642            if (port >= VPCI_CONFIG)
     643            {
     644#ifdef IN_RING3
    611645                rc = g_VPCIDevices[pState->enmDevType].pfnGetConfig(pState, port - VPCI_CONFIG, cb, pu32);
     646#else
     647                rc = VINF_IOM_HC_IOPORT_READ;
     648#endif
     649            }
    612650            else
    613651            {
     
    651689        case VPCI_GUEST_FEATURES:
    652690            /* Check if the guest negotiates properly, fall back to basics if it does not. */
     691#ifdef IN_RING3
    653692            if (VPCI_F_BAD_FEATURE & u32)
    654693            {
     
    667706                pState->uGuestFeatures = u32;
    668707            g_VPCIDevices[pState->enmDevType].pfnSetHostFeatures(pState, pState->uGuestFeatures);
     708#else
     709            rc = VINF_IOM_HC_IOPORT_WRITE;
     710#endif
    669711            break;
    670712
    671713        case VPCI_QUEUE_PFN:
     714#ifdef IN_RING3
    672715            /*
    673716             * The guest is responsible for allocating the pages for queues,
     
    676719             * VIRTIO_PCI_QUEUE_NUM.
    677720             */
    678             pState->pQueues[pState->uQueueSelector].uPageNumber = u32;
     721            pState->Queues[pState->uQueueSelector].uPageNumber = u32;
    679722            if (u32)
    680                 vqueueInit(&pState->pQueues[pState->uQueueSelector], u32);
     723                vqueueInit(&pState->Queues[pState->uQueueSelector], u32);
    681724            else
    682725                g_VPCIDevices[pState->enmDevType].pfnReset(pState);
     726#else
     727            rc = VINF_IOM_HC_IOPORT_WRITE;
     728#endif
    683729            break;
    684730
    685731        case VPCI_QUEUE_SEL:
     732#ifdef IN_RING3
    686733            Assert(cb == 2);
    687734            u32 &= 0xFFFF;
     
    690737            else
    691738                Log3(("%s virtioIOPortOut: Invalid queue selector %08x\n", szInst, u32));
     739#else
     740            rc = VINF_IOM_HC_IOPORT_WRITE;
     741#endif
    692742            break;
    693743
    694744        case VPCI_QUEUE_NOTIFY:
     745#ifdef IN_RING3
    695746            Assert(cb == 2);
    696747            u32 &= 0xFFFF;
    697748            if (u32 < g_VPCIDevices[pState->enmDevType].nQueues)
    698                 if (pState->pQueues[u32].VRing.addrDescriptors)
    699                     pState->pQueues[u32].pfnCallback(pState, &pState->pQueues[u32]);
     749                if (pState->Queues[u32].VRing.addrDescriptors)
     750                    pState->Queues[u32].pfnCallback(pState, &pState->Queues[u32]);
    700751                else
    701752                    Log(("%s The queue (#%d) being notified has not been initialized.\n",
     
    703754            else
    704755                Log(("%s Invalid queue number (%d)\n", INSTANCE(pState), u32));
     756#else
     757            rc = VINF_IOM_HC_IOPORT_WRITE;
     758#endif
    705759            break;
    706760
    707761        case VPCI_STATUS:
     762#ifdef IN_RING3
    708763            Assert(cb == 1);
    709764            u32 &= 0xFF;
     
    715770            else if (fHasBecomeReady)
    716771                g_VPCIDevices[pState->enmDevType].pfnReady(pState);
     772#else
     773            rc = VINF_IOM_HC_IOPORT_WRITE;
     774#endif
    717775            break;
    718776
    719777        default:
     778#ifdef IN_RING3
    720779            if (port >= VPCI_CONFIG)
    721780                rc = g_VPCIDevices[pState->enmDevType].pfnSetConfig(pState, port - VPCI_CONFIG, cb, &u32);
    722781            else
    723782                rc = PDMDeviceDBGFStop(pDevIns, RT_SRC_POS, "%s virtioIOPortOut: no valid port at offset port=%RTiop cb=%08x\n", szInst, port, cb);
     783#else
     784            rc = VINF_IOM_HC_IOPORT_WRITE;
     785#endif
    724786            break;
    725787    }
     
    912974              "  uNextUsedIndex        = %u\n"
    913975              "  uPageNumber           = %x\n",
    914               g_VPCIDevices[pState->enmDevType].pfnGetQueueName(pState, &pState->pQueues[i]),
    915               pState->pQueues[i].VRing.uSize,
    916               pState->pQueues[i].VRing.addrDescriptors,
    917               pState->pQueues[i].VRing.addrAvail,
    918               pState->pQueues[i].VRing.addrUsed,
    919               pState->pQueues[i].uNextAvailIndex,
    920               pState->pQueues[i].uNextUsedIndex,
    921               pState->pQueues[i].uPageNumber));
     976              pState->Queues[i].pcszName,
     977              pState->Queues[i].VRing.uSize,
     978              pState->Queues[i].VRing.addrDescriptors,
     979              pState->Queues[i].VRing.addrAvail,
     980              pState->Queues[i].VRing.addrUsed,
     981              pState->Queues[i].uNextAvailIndex,
     982              pState->Queues[i].uNextUsedIndex,
     983              pState->Queues[i].uPageNumber));
    922984
    923985}
     
    9511013    for (unsigned i = 0; i < g_VPCIDevices[pState->enmDevType].nQueues; i++)
    9521014    {
    953         rc = SSMR3PutU16(pSSM, pState->pQueues[i].VRing.uSize);
     1015        rc = SSMR3PutU16(pSSM, pState->Queues[i].VRing.uSize);
    9541016        AssertRCReturn(rc, rc);
    955         rc = SSMR3PutU32(pSSM, pState->pQueues[i].uPageNumber);
     1017        rc = SSMR3PutU32(pSSM, pState->Queues[i].uPageNumber);
    9561018        AssertRCReturn(rc, rc);
    957         rc = SSMR3PutU16(pSSM, pState->pQueues[i].uNextAvailIndex);
     1019        rc = SSMR3PutU16(pSSM, pState->Queues[i].uNextAvailIndex);
    9581020        AssertRCReturn(rc, rc);
    959         rc = SSMR3PutU16(pSSM, pState->pQueues[i].uNextUsedIndex);
     1021        rc = SSMR3PutU16(pSSM, pState->Queues[i].uNextUsedIndex);
    9601022        AssertRCReturn(rc, rc);
    9611023    }
     
    9921054        for (unsigned i = 0; i < g_VPCIDevices[pState->enmDevType].nQueues; i++)
    9931055        {
    994             rc = SSMR3GetU16(pSSM, &pState->pQueues[i].VRing.uSize);
     1056            rc = SSMR3GetU16(pSSM, &pState->Queues[i].VRing.uSize);
    9951057            AssertRCReturn(rc, rc);
    996             rc = SSMR3GetU32(pSSM, &pState->pQueues[i].uPageNumber);
     1058            rc = SSMR3GetU32(pSSM, &pState->Queues[i].uPageNumber);
    9971059            AssertRCReturn(rc, rc);
    9981060
    999             if (pState->pQueues[i].uPageNumber)
    1000                 vqueueInit(&pState->pQueues[i], pState->pQueues[i].uPageNumber);
    1001 
    1002             rc = SSMR3GetU16(pSSM, &pState->pQueues[i].uNextAvailIndex);
     1061            if (pState->Queues[i].uPageNumber)
     1062                vqueueInit(&pState->Queues[i], pState->Queues[i].uPageNumber);
     1063
     1064            rc = SSMR3GetU16(pSSM, &pState->Queues[i].uNextAvailIndex);
    10031065            AssertRCReturn(rc, rc);
    1004             rc = SSMR3GetU16(pSSM, &pState->pQueues[i].uNextUsedIndex);
     1066            rc = SSMR3GetU16(pSSM, &pState->Queues[i].uNextUsedIndex);
    10051067            AssertRCReturn(rc, rc);
    10061068        }
     
    10461108    pState->enmDevType   = enmDevType;
    10471109
    1048     /* Allocate queues */
    1049     pState->pQueues      = (VQUEUE*)RTMemAllocZ(sizeof(VQUEUE) * g_VPCIDevices[enmDevType].nQueues);
    1050 
    10511110    pState->pDevInsR3    = pDevIns;
    10521111    pState->pDevInsR0    = PDMDEVINS_2_R0PTR(pDevIns);
     
    10541113    pState->led.u32Magic = PDMLED_MAGIC;
    10551114
    1056     pState->ILeds.pfnQueryStatusLed          = vpciQueryStatusLed;
     1115    pState->ILeds.pfnQueryStatusLed = vpciQueryStatusLed;
    10571116
    10581117    /* Initialize critical section. */
     
    11041163    Log(("%s Destroying PCI instance\n", INSTANCE(pState)));
    11051164
    1106     if (pState->pQueues)
    1107         RTMemFree(pState->pQueues);
    1108 
    11091165    if (PDMCritSectIsInitialized(&pState->cs))
    1110     {
    11111166        PDMR3CritSectDelete(&pState->cs);
    1112     }
     1167   
    11131168    return VINF_SUCCESS;
    11141169}
     
    11381193
    11391194PVQUEUE vpciAddQueue(VPCISTATE* pState, unsigned uSize,
    1140                      void (*pfnCallback)(void *pvState, PVQUEUE pQueue))
     1195                     void (*pfnCallback)(void *pvState, PVQUEUE pQueue),
     1196                     const char *pcszName)
    11411197{
    11421198    PVQUEUE pQueue = NULL;
     
    11441200    for (unsigned i = 0; i < g_VPCIDevices[pState->enmDevType].nQueues; i++)
    11451201    {
    1146         if (pState->pQueues[i].VRing.uSize == 0)
     1202        if (pState->Queues[i].VRing.uSize == 0)
    11471203        {
    1148             pQueue = &pState->pQueues[i];
     1204            pQueue = &pState->Queues[i];
    11491205            break;
    11501206        }
     
    11611217        pQueue->uPageNumber = 0;
    11621218        pQueue->pfnCallback = pfnCallback;
     1219        pQueue->pcszName = pcszName;
    11631220    }
    11641221
     
    11691226#endif /* IN_RING3 */
    11701227
     1228#endif /* VBOX_DEVICE_STRUCT_TESTCASE */
    11711229
    11721230//------------------------- Tear off here: vnet -------------------------------
     
    12291287    RCPTRTYPE(PPDMQUEUE)    pCanRxQueueRC;           /**< Rx wakeup signaller - RC. */
    12301288
     1289#if HC_ARCH_BITS == 64
     1290    uint32_t    padding;
     1291#endif
    12311292    PTMTIMERR3  pLinkUpTimer;                             /**< Link Up(/Restore) Timer. */
    12321293
     
    12441305    bool        fLocked;
    12451306
    1246     PVQUEUE     pRxQueue;
    1247     PVQUEUE     pTxQueue;
    1248     PVQUEUE     pCtlQueue;
    1249     /* Receive-blocking-related fields ***************************************/
    1250 
    12511307    /** N/A: */
    12521308    bool volatile fMaybeOutOfSpace;
     1309
     1310    R3PTRTYPE(PVQUEUE) pRxQueue;
     1311    R3PTRTYPE(PVQUEUE) pTxQueue;
     1312    R3PTRTYPE(PVQUEUE) pCtlQueue;
     1313    /* Receive-blocking-related fields ***************************************/
     1314
    12531315    /** EMT: Gets signalled when more RX descriptors become available. */
    12541316    RTSEMEVENT  hEventMoreRxDescAvail;
     
    12701332typedef VNETSTATE *PVNETSTATE;
    12711333
     1334#ifndef VBOX_DEVICE_STRUCT_TESTCASE
     1335
    12721336#define VNETHDR_GSO_NONE 0
    12731337
     
    12941358#define STATUS pState->config.uStatus
    12951359
    1296 #ifdef DEBUG
    1297 static const char *vnetGetQueueName(void *pvState, PVQUEUE pQueue)
    1298 {
    1299     VNETSTATE *pState = (VNETSTATE *)pvState;
    1300     if (pQueue == pState->pRxQueue)
    1301         return "RX ";
    1302     else if (pQueue == pState->pTxQueue)
    1303         return "TX ";
    1304     else if (pQueue == pState->pCtlQueue)
    1305         return "CTL";
    1306     return "Invalid";
    1307 }
    1308 #endif /* DEBUG */
    1309 
    13101360DECLINLINE(int) vnetCsEnter(PVNETSTATE pState, int rcBusy)
    13111361{
     
    13611411}
    13621412
     1413#ifdef IN_RING3
    13631414/**
    13641415 * Hardware reset. Revert all registers to initial values.
     
    13781429}
    13791430
    1380 #ifdef IN_RING3
    13811431/**
    13821432 * Wakeup the RX thread.
     
    19602010    pState->VPCI.IBase.pfnQueryInterface     = vnetQueryInterface;
    19612011    rc = vpciConstruct(pDevIns, &pState->VPCI, iInstance, VIRTIO_NET_ID, sizeof(VNetPCIConfig));
    1962     pState->pRxQueue  = vpciAddQueue(&pState->VPCI, 256, vnetQueueReceive);
    1963     pState->pTxQueue  = vpciAddQueue(&pState->VPCI, 256, vnetQueueTransmit);
    1964     pState->pCtlQueue = vpciAddQueue(&pState->VPCI, 16,  vnetQueueControl);
     2012    pState->pRxQueue  = vpciAddQueue(&pState->VPCI, 256, vnetQueueReceive,  "RX ");
     2013    pState->pTxQueue  = vpciAddQueue(&pState->VPCI, 256, vnetQueueTransmit, "TX ");
     2014    pState->pCtlQueue = vpciAddQueue(&pState->VPCI, 16,  vnetQueueControl,  "CTL");
    19652015
    19662016    Log(("%s Constructing new instance\n", INSTANCE(pState)));
  • trunk/src/VBox/Devices/testcase/Makefile.kmk

    r23452 r24616  
    6161tstDeviceStructSizeGC_DEFS     += VBOX_WITH_E1000
    6262endif
     63ifdef VBOX_WITH_VIRTIO
     64tstDeviceStructSizeGC_DEFS     += VBOX_WITH_VIRTIO
     65endif
    6366ifdef VBOX_WITH_BUSLOGIC
    6467tstDeviceStructSizeGC_DEFS     += VBOX_WITH_BUSLOGIC
     
    99102ifdef VBOX_WITH_E1000
    100103tstDeviceStructSize_DEFS     += VBOX_WITH_E1000
     104endif
     105ifdef VBOX_WITH_VIRTIO
     106tstDeviceStructSize_DEFS     += VBOX_WITH_VIRTIO
    101107endif
    102108ifdef VBOX_WITH_BUSLOGIC
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSize.cpp

    r23814 r24616  
    4343#ifdef VBOX_WITH_VIRTIO
    4444# undef LOG_GROUP
    45 # include "../Network/DevVirtio.cpp"
     45# include "../Network/DevVirtioNet.cpp"
    4646#endif
    4747#undef LOG_GROUP
     
    308308#ifdef VBOX_WITH_VIRTIO
    309309    CHECK_MEMBER_ALIGNMENT(VPCISTATE, cs, 8);
     310    CHECK_MEMBER_ALIGNMENT(VPCISTATE, led, 4);
     311    CHECK_MEMBER_ALIGNMENT(VPCISTATE, Queues, 8);
    310312#endif
    311313
  • trunk/src/VBox/Devices/testcase/tstDeviceStructSizeGC.cpp

    r24173 r24616  
    7777# undef LOG_GROUP
    7878# include "../Network/DevE1000.cpp"
     79#endif
     80#ifdef VBOX_WITH_VIRTIO
     81# undef LOG_GROUP
     82# include "../Network/DevVirtioNet.cpp"
    7983#endif
    8084#ifdef VBOX_WITH_BUSLOGIC
     
    13311335#endif /* VBOX_WITH_E1000 */
    13321336
     1337#ifdef VBOX_WITH_VIRTIO
     1338    GEN_CHECK_OFF(VPCISTATE, cs);
     1339    GEN_CHECK_OFF(VPCISTATE, enmDevType);
     1340    GEN_CHECK_OFF(VPCISTATE, szInstance);
     1341    GEN_CHECK_OFF(VPCISTATE, IBase);
     1342    GEN_CHECK_OFF(VPCISTATE, ILeds);
     1343    GEN_CHECK_OFF(VPCISTATE, pLedsConnector);
     1344    GEN_CHECK_OFF(VPCISTATE, pDevInsR3);
     1345    GEN_CHECK_OFF(VPCISTATE, pDevInsR0);
     1346    GEN_CHECK_OFF(VPCISTATE, pDevInsRC);
     1347    GEN_CHECK_OFF(VPCISTATE, pciDevice);
     1348    GEN_CHECK_OFF(VPCISTATE, addrIOPort);
     1349    GEN_CHECK_OFF(VPCISTATE, led);
     1350    GEN_CHECK_OFF(VPCISTATE, uGuestFeatures);
     1351    GEN_CHECK_OFF(VPCISTATE, uQueueSelector);
     1352    GEN_CHECK_OFF(VPCISTATE, uStatus);
     1353    GEN_CHECK_OFF(VPCISTATE, uISR);
     1354    GEN_CHECK_OFF(VPCISTATE, Queues);
     1355    GEN_CHECK_OFF(VPCISTATE, Queues[VIRTIO_MAX_NQUEUES]);
     1356    GEN_CHECK_OFF(VNETSTATE, VPCI);
     1357    GEN_CHECK_OFF(VNETSTATE, INetworkPort);
     1358    GEN_CHECK_OFF(VNETSTATE, INetworkConfig);
     1359    GEN_CHECK_OFF(VNETSTATE, pDrvBase);
     1360    GEN_CHECK_OFF(VNETSTATE, pCanRxQueueR3);
     1361    GEN_CHECK_OFF(VNETSTATE, pCanRxQueueR0);
     1362    GEN_CHECK_OFF(VNETSTATE, pCanRxQueueRC);
     1363    GEN_CHECK_OFF(VNETSTATE, pLinkUpTimer);
     1364    GEN_CHECK_OFF(VNETSTATE, config);
     1365    GEN_CHECK_OFF(VNETSTATE, macConfigured);
     1366    GEN_CHECK_OFF(VNETSTATE, fCableConnected);
     1367    GEN_CHECK_OFF(VNETSTATE, u32PktNo);
     1368    GEN_CHECK_OFF(VNETSTATE, fLocked);
     1369    GEN_CHECK_OFF(VNETSTATE, pRxQueue);
     1370    GEN_CHECK_OFF(VNETSTATE, pTxQueue);
     1371    GEN_CHECK_OFF(VNETSTATE, pCtlQueue);
     1372    GEN_CHECK_OFF(VNETSTATE, fMaybeOutOfSpace);
     1373    GEN_CHECK_OFF(VNETSTATE, hEventMoreRxDescAvail);
     1374#endif /* VBOX_WITH_VIRTIO */
     1375
    13331376#ifdef VBOX_WITH_SCSI
    13341377    GEN_CHECK_SIZE(VBOXSCSI);
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