- Timestamp:
- Sep 14, 2012 5:02:41 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r43090 r43327 1127 1127 /** TX: Will this frame be sent as GSO. */ 1128 1128 bool fGSO; 1129 /** TX: False will force segmentation in e1000 instead of sending frames as GSO. */ 1130 bool fGSOEnabled; 1129 1131 /** TX: Number of bytes in next packet. */ 1130 1132 uint32_t cbTxAlloc; … … 3342 3344 * Checks if we can use GSO processing for the current TSE frame. 3343 3345 * 3346 * @param pState The device state structure. 3344 3347 * @param pGso The GSO context. 3345 3348 * @param pData The first data descriptor of the frame. 3346 3349 * @param pCtx The TSO context descriptor. 3347 3350 */ 3348 DECLINLINE(bool) e1kCanDoGso( PCPDMNETWORKGSO pGso, E1KTXDAT const *pData, E1KTXCTX const *pCtx)3351 DECLINLINE(bool) e1kCanDoGso(E1KSTATE *pState, PCPDMNETWORKGSO pGso, E1KTXDAT const *pData, E1KTXCTX const *pCtx) 3349 3352 { 3350 3353 if (!pData->cmd.fTSE) … … 3356 3359 { 3357 3360 E1kLog(("e1kCanDoGso: VLE\n")); 3361 return false; 3362 } 3363 if (RT_UNLIKELY(!pState->fGSOEnabled)) 3364 { 3365 E1kLog3(("e1kCanDoGso: GSO disabled via CFGM\n")); 3358 3366 return false; 3359 3367 } … … 4432 4440 cbVTag = 4; 4433 4441 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)) 4435 4443 rc = e1kXmitAllocBuf(pState, pState->contextTSE.dw2.u20PAYLEN + pState->contextTSE.dw3.u8HDRLEN + cbVTag, 4436 4444 true /*fExactSize*/, true /*fGso*/); … … 4830 4838 pState->u16VTagTCI = pDesc->data.dw3.u16Special; 4831 4839 } 4832 pState->fGSO = e1kCanDoGso( &pState->GsoCtx, &pDesc->data, &pState->contextTSE);4840 pState->fGSO = e1kCanDoGso(pState, &pState->GsoCtx, &pDesc->data, &pState->contextTSE); 4833 4841 } 4834 4842 cbPacket += pDesc->data.cmd.u20DTALEN; … … 7268 7276 if (!CFGMR3AreValuesValid(pCfg, "MAC\0" "CableConnected\0" "AdapterType\0" 7269 7277 "LineSpeed\0" "GCEnabled\0" "R0Enabled\0" 7270 "EthernetCRC\0" " LinkUpDelay\0"))7278 "EthernetCRC\0" "GSOEnabled\0" "LinkUpDelay\0")) 7271 7279 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 7272 7280 N_("Invalid configuration for E1000 device")); … … 7277 7285 pState->fGCEnabled = true; 7278 7286 pState->fEthernetCRC = true; 7287 pState->fGSOEnabled = true; 7279 7288 7280 7289 /* Get config params */ … … 7307 7316 return PDMDEV_SET_ERROR(pDevIns, rc, 7308 7317 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 7309 7324 rc = CFGMR3QueryU32Def(pCfg, "LinkUpDelay", (uint32_t*)&pState->cMsLinkUpDelay, 5000); /* ms */ 7310 7325 if (RT_FAILURE(rc)) … … 7322 7337 } 7323 7338 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), 7325 7340 g_Chips[pState->eChip].pcszName, pState->cMsLinkUpDelay, 7326 pState->fEthernetCRC ? "on" : "off")); 7341 pState->fEthernetCRC ? "on" : "off", 7342 pState->fGSOEnabled ? "enabled" : "disabled")); 7327 7343 7328 7344 /* Initialize state structure */
Note:
See TracChangeset
for help on using the changeset viewer.