VirtualBox

Changeset 64684 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Nov 16, 2016 3:14:26 PM (8 years ago)
Author:
vboxsync
Message:

Dev/E1000: (bugref:8624) Delay interrupts in IMS handler, enable internal stats.

File:
1 edited

Legend:

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

    r64518 r64684  
    7171 */
    7272#define E1K_INIT_LINKUP_DELAY (500 * 1000)
     73/** @def E1K_IMS_INT_DELAY_NS
     74 * E1K_IMS_INT_DELAY_NS prevents interrupt storms in Windows guests on enabling
     75 * interrupts (see @bugref{8624}).
     76 */
     77#define E1K_IMS_INT_DELAY_NS 100
    7378/** @def E1K_TX_DELAY
    7479 * E1K_TX_DELAY aims to improve guest-host transfer rate for TCP streams by
     
    102107 * debugging of delayed interrupts, etc.
    103108 */
    104 //#define E1K_INT_STATS
     109#define E1K_INT_STATS
    105110/** @def E1K_WITH_MSI
    106111 * E1K_WITH_MSI enables rudimentary MSI support. Not implemented.
     
    12551260    uint32_t    uStatIntTry;
    12561261    uint32_t    uStatIntLower;
    1257     uint32_t    uStatIntDly;
     1262    uint32_t    uStatNoIntICR;
    12581263    int32_t     iStatIntLost;
    12591264    int32_t     iStatIntLostOne;
    1260     uint32_t    uStatDisDly;
     1265    uint32_t    uStatIntIMS;
    12611266    uint32_t    uStatIntSkip;
    12621267    uint32_t    uStatIntLate;
     
    29192924        if (value)
    29202925        {
     2926            if (!pThis->fIntRaised)
     2927                E1K_INC_ISTAT_CNT(pThis->uStatNoIntICR);
    29212928            /*
    29222929             * Not clearing ICR causes QNX to hang as it reads ICR in a loop
     
    29963003    E1kLogRel(("E1000: irq enabled, RDH=%x RDT=%x TDH=%x TDT=%x\n", RDH, RDT, TDH, TDT));
    29973004    E1kLog(("%s e1kRegWriteIMS: IRQ enabled\n", pThis->szPrf));
    2998     e1kRaiseInterrupt(pThis, VINF_IOM_R3_MMIO_WRITE, 0);
     3005    /*
     3006     * We cannot raise an interrupt here as it will occasionally cause an interrupt storm
     3007     * in Windows guests (see @bugref{8624}, @bugref{5023}).
     3008     */
     3009    if ((ICR & IMS) && !pThis->fLocked)
     3010    {
     3011        E1K_INC_ISTAT_CNT(pThis->uStatIntIMS);
     3012        e1kPostponeInterrupt(pThis, E1K_IMS_INT_DELAY_NS);
     3013    }
    29993014
    30003015    return VINF_SUCCESS;
     
    60696084    LogRel(("%s Interrupts raised : %d\n", pThis->szPrf, pThis->uStatInt));
    60706085    LogRel(("%s Interrupts lowered: %d\n", pThis->szPrf, pThis->uStatIntLower));
    6071     LogRel(("%s Interrupts delayed: %d\n", pThis->szPrf, pThis->uStatIntDly));
    6072     LogRel(("%s Disabled delayed:   %d\n", pThis->szPrf, pThis->uStatDisDly));
     6086    LogRel(("%s ICR outside ISR   : %d\n", pThis->szPrf, pThis->uStatNoIntICR));
     6087    LogRel(("%s IMS raised ints   : %d\n", pThis->szPrf, pThis->uStatIntIMS));
    60736088    LogRel(("%s Interrupts skipped: %d\n", pThis->szPrf, pThis->uStatIntSkip));
    60746089    LogRel(("%s Masked interrupts : %d\n", pThis->szPrf, pThis->uStatIntMasked));
     
    71577172    pHlp->pfnPrintf(pHlp, "Interrupts raised : %d\n", pThis->uStatInt);
    71587173    pHlp->pfnPrintf(pHlp, "Interrupts lowered: %d\n", pThis->uStatIntLower);
    7159     pHlp->pfnPrintf(pHlp, "Interrupts delayed: %d\n", pThis->uStatIntDly);
    7160     pHlp->pfnPrintf(pHlp, "Disabled delayed:   %d\n", pThis->uStatDisDly);
     7174    pHlp->pfnPrintf(pHlp, "ICR outside ISR   : %d\n", pThis->uStatNoIntICR);
     7175    pHlp->pfnPrintf(pHlp, "IMS raised ints   : %d\n", pThis->uStatIntIMS);
    71617176    pHlp->pfnPrintf(pHlp, "Interrupts skipped: %d\n", pThis->uStatIntSkip);
    71627177    pHlp->pfnPrintf(pHlp, "Masked interrupts : %d\n", pThis->uStatIntMasked);
     
    78897904    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->uStatIntTry,            STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "uStatIntTry",                        "/Devices/E1k%d/uStatIntTry", iInstance);
    78907905    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->uStatIntLower,          STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "uStatIntLower",                      "/Devices/E1k%d/uStatIntLower", iInstance);
    7891     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->uStatIntDly,            STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "uStatIntDly",                        "/Devices/E1k%d/uStatIntDly", iInstance);
     7906    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->uStatNoIntICR,          STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "uStatNoIntICR",                      "/Devices/E1k%d/uStatNoIntICR", iInstance);
    78927907    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->iStatIntLost,           STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "iStatIntLost",                       "/Devices/E1k%d/iStatIntLost", iInstance);
    78937908    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->iStatIntLostOne,        STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "iStatIntLostOne",                    "/Devices/E1k%d/iStatIntLostOne", iInstance);
    7894     PDMDevHlpSTAMRegisterF(pDevIns, &pThis->uStatDisDly,            STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "uStatDisDly",                        "/Devices/E1k%d/uStatDisDly", iInstance);
     7909    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->uStatIntIMS,            STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "uStatIntIMS",                        "/Devices/E1k%d/uStatIntIMS", iInstance);
    78957910    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->uStatIntSkip,           STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "uStatIntSkip",                       "/Devices/E1k%d/uStatIntSkip", iInstance);
    78967911    PDMDevHlpSTAMRegisterF(pDevIns, &pThis->uStatIntLate,           STAMTYPE_U32,     STAMVISIBILITY_ALWAYS, STAMUNIT_NS,             "uStatIntLate",                       "/Devices/E1k%d/uStatIntLate", iInstance);
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