VirtualBox

Changeset 43327 in vbox for trunk/src


Ignore:
Timestamp:
Sep 14, 2012 5:02:41 AM (12 years ago)
Author:
vboxsync
Message:

Network/e1000: Allow forcing GSO fallback segmentation via CFGM

File:
1 edited

Legend:

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

    r43090 r43327  
    11271127    /** TX: Will this frame be sent as GSO. */
    11281128    bool        fGSO;
     1129    /** TX: False will force segmentation in e1000 instead of sending frames as GSO. */
     1130    bool        fGSOEnabled;
    11291131    /** TX: Number of bytes in next packet. */
    11301132    uint32_t    cbTxAlloc;
     
    33423344 * Checks if we can use GSO processing for the current TSE frame.
    33433345 *
     3346 * @param   pState              The device state structure.
    33443347 * @param   pGso                The GSO context.
    33453348 * @param   pData               The first data descriptor of the frame.
    33463349 * @param   pCtx                The TSO context descriptor.
    33473350 */
    3348 DECLINLINE(bool) e1kCanDoGso(PCPDMNETWORKGSO pGso, E1KTXDAT const *pData, E1KTXCTX const *pCtx)
     3351DECLINLINE(bool) e1kCanDoGso(E1KSTATE *pState, PCPDMNETWORKGSO pGso, E1KTXDAT const *pData, E1KTXCTX const *pCtx)
    33493352{
    33503353    if (!pData->cmd.fTSE)
     
    33563359    {
    33573360        E1kLog(("e1kCanDoGso: VLE\n"));
     3361        return false;
     3362    }
     3363    if (RT_UNLIKELY(!pState->fGSOEnabled))
     3364    {
     3365        E1kLog3(("e1kCanDoGso: GSO disabled via CFGM\n"));
    33583366        return false;
    33593367    }
     
    44324440                    cbVTag = 4;
    44334441                E1kLog3(("%s About to allocate TX buffer: cbVTag=%u\n", INSTANCE(pState), cbVTag));
    4434                 if (e1kCanDoGso(&pState->GsoCtx, &pDesc->data, &pState->contextTSE))
     4442                if (e1kCanDoGso(pState, &pState->GsoCtx, &pDesc->data, &pState->contextTSE))
    44354443                    rc = e1kXmitAllocBuf(pState, pState->contextTSE.dw2.u20PAYLEN + pState->contextTSE.dw3.u8HDRLEN + cbVTag,
    44364444                                    true /*fExactSize*/, true /*fGso*/);
     
    48304838                        pState->u16VTagTCI = pDesc->data.dw3.u16Special;
    48314839                    }
    4832                     pState->fGSO = e1kCanDoGso(&pState->GsoCtx, &pDesc->data, &pState->contextTSE);
     4840                    pState->fGSO = e1kCanDoGso(pState, &pState->GsoCtx, &pDesc->data, &pState->contextTSE);
    48334841                }
    48344842                cbPacket += pDesc->data.cmd.u20DTALEN;
     
    72687276    if (!CFGMR3AreValuesValid(pCfg, "MAC\0" "CableConnected\0" "AdapterType\0"
    72697277                                    "LineSpeed\0" "GCEnabled\0" "R0Enabled\0"
    7270                                     "EthernetCRC\0" "LinkUpDelay\0"))
     7278                                    "EthernetCRC\0" "GSOEnabled\0" "LinkUpDelay\0"))
    72717279        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
    72727280                                N_("Invalid configuration for E1000 device"));
     
    72777285    pState->fGCEnabled   = true;
    72787286    pState->fEthernetCRC = true;
     7287    pState->fGSOEnabled  = true;
    72797288
    72807289    /* Get config params */
     
    73077316        return PDMDEV_SET_ERROR(pDevIns, rc,
    73087317                                N_("Configuration error: Failed to get the value of 'EthernetCRC'"));
     7318
     7319    rc = CFGMR3QueryBoolDef(pCfg, "GSOEnabled", &pState->fGSOEnabled, true);
     7320    if (RT_FAILURE(rc))
     7321        return PDMDEV_SET_ERROR(pDevIns, rc,
     7322                                N_("Configuration error: Failed to get the value of 'GSOEnabled'"));
     7323
    73097324    rc = CFGMR3QueryU32Def(pCfg, "LinkUpDelay", (uint32_t*)&pState->cMsLinkUpDelay, 5000); /* ms */
    73107325    if (RT_FAILURE(rc))
     
    73227337    }
    73237338
    7324     E1kLog(("%s Chip=%s LinkUpDelay=%ums EthernetCRC=%s\n", INSTANCE(pState),
     7339    E1kLog(("%s Chip=%s LinkUpDelay=%ums EthernetCRC=%s GSO=%s\n", INSTANCE(pState),
    73257340            g_Chips[pState->eChip].pcszName, pState->cMsLinkUpDelay,
    7326             pState->fEthernetCRC ? "on" : "off"));
     7341            pState->fEthernetCRC ? "on" : "off",
     7342            pState->fGSOEnabled ? "enabled" : "disabled"));
    73277343
    73287344    /* Initialize state structure */
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