Changeset 64280 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Oct 14, 2016 7:49:26 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r64115 r64280 1096 1096 /** All: throttle RX interrupts. */ 1097 1097 bool fItrRxEnabled; 1098 1099 bool Alignment2;1098 /** All: Delay TX interrupts using TIDV/TADV. */ 1099 bool fTidEnabled; 1100 1100 /** Link up delay (in milliseconds). */ 1101 1101 uint32_t cMsLinkUpDelay; … … 3245 3245 # endif /* E1K_TX_DELAY */ 3246 3246 3247 # ifdef E1K_USE_TX_TIMERS3247 //# ifdef E1K_USE_TX_TIMERS 3248 3248 3249 3249 /** … … 3259 3259 static DECLCALLBACK(void) e1kTxIntDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 3260 3260 { 3261 RT_NOREF(pDevIns); 3262 RT_NOREF(pTimer); 3261 3263 PE1KSTATE pThis = (PE1KSTATE )pvUser; 3262 3264 … … 3281 3283 static DECLCALLBACK(void) e1kTxAbsDelayTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser) 3282 3284 { 3285 RT_NOREF(pDevIns); 3286 RT_NOREF(pTimer); 3283 3287 PE1KSTATE pThis = (PE1KSTATE )pvUser; 3284 3288 … … 3289 3293 } 3290 3294 3291 # endif /* E1K_USE_TX_TIMERS */3295 //# endif /* E1K_USE_TX_TIMERS */ 3292 3296 # ifdef E1K_USE_RX_TIMERS 3293 3297 … … 4445 4449 if (pDesc->legacy.cmd.fEOP) 4446 4450 { 4447 #ifdef E1K_USE_TX_TIMERS4448 if (p Desc->legacy.cmd.fIDE)4451 //#ifdef E1K_USE_TX_TIMERS 4452 if (pThis->fTidEnabled && pDesc->legacy.cmd.fIDE) 4449 4453 { 4450 4454 E1K_INC_ISTAT_CNT(pThis->uStatTxIDE); … … 4467 4471 else 4468 4472 { 4469 E1kLog2(("%s No IDE set, cancel TAD timer and raise interrupt\n", 4470 pThis->szPrf)); 4473 if (pThis->fTidEnabled) 4474 { 4475 E1kLog2(("%s No IDE set, cancel TAD timer and raise interrupt\n", 4476 pThis->szPrf)); 4477 /* Cancel both timers if armed and fire immediately. */ 4471 4478 # ifndef E1K_NO_TAD 4472 /* Cancel both timers if armed and fire immediately. */ 4473 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer)); 4479 TMTimerStop(pThis->CTX_SUFF(pTADTimer)); 4474 4480 # endif 4475 #endif /* E1K_USE_TX_TIMERS */ 4481 TMTimerStop(pThis->CTX_SUFF(pTIDTimer)); 4482 } 4483 //#endif /* E1K_USE_TX_TIMERS */ 4476 4484 E1K_INC_ISTAT_CNT(pThis->uStatIntTx); 4477 4485 e1kRaiseInterrupt(pThis, VERR_SEM_BUSY, ICR_TXDW); 4478 #ifdef E1K_USE_TX_TIMERS4486 //#ifdef E1K_USE_TX_TIMERS 4479 4487 } 4480 #endif /* E1K_USE_TX_TIMERS */4488 //#endif /* E1K_USE_TX_TIMERS */ 4481 4489 } 4482 4490 } … … 4510 4518 e1kPrintTDesc(pThis, pDesc, "vvv"); 4511 4519 4512 #ifdef E1K_USE_TX_TIMERS 4513 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTIDTimer)); 4514 #endif /* E1K_USE_TX_TIMERS */ 4520 //#ifdef E1K_USE_TX_TIMERS 4521 if (pThis->fTidEnabled) 4522 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTIDTimer)); 4523 //#endif /* E1K_USE_TX_TIMERS */ 4515 4524 4516 4525 switch (e1kGetDescType(pDesc)) … … 4770 4779 e1kPrintTDesc(pThis, pDesc, "vvv"); 4771 4780 4772 #ifdef E1K_USE_TX_TIMERS 4773 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTIDTimer)); 4774 #endif /* E1K_USE_TX_TIMERS */ 4781 //#ifdef E1K_USE_TX_TIMERS 4782 if (pThis->fTidEnabled) 4783 TMTimerStop(pThis->CTX_SUFF(pTIDTimer)); 4784 //#endif /* E1K_USE_TX_TIMERS */ 4775 4785 4776 4786 switch (e1kGetDescType(pDesc)) … … 6644 6654 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTXDTimer)); 6645 6655 #endif /* E1K_TX_DELAY */ 6646 #ifdef E1K_USE_TX_TIMERS 6647 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTIDTimer)); 6656 //#ifdef E1K_USE_TX_TIMERS 6657 if (pThis->fTidEnabled) 6658 { 6659 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTIDTimer)); 6648 6660 #ifndef E1K_NO_TAD 6649 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer));6661 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer)); 6650 6662 #endif /* E1K_NO_TAD */ 6651 #endif /* E1K_USE_TX_TIMERS */ 6663 } 6664 //#endif /* E1K_USE_TX_TIMERS */ 6652 6665 #ifdef E1K_USE_RX_TIMERS 6653 6666 e1kCancelTimer(pThis, pThis->CTX_SUFF(pRIDTimer)); … … 7352 7365 pThis->pRADTimerRC = TMTimerRCPtr(pThis->pRADTimerR3); 7353 7366 #endif /* E1K_USE_RX_TIMERS */ 7354 #ifdef E1K_USE_TX_TIMERS 7355 pThis->pTIDTimerRC = TMTimerRCPtr(pThis->pTIDTimerR3); 7367 //#ifdef E1K_USE_TX_TIMERS 7368 if (pThis->fTidEnabled) 7369 { 7370 pThis->pTIDTimerRC = TMTimerRCPtr(pThis->pTIDTimerR3); 7356 7371 # ifndef E1K_NO_TAD 7357 pThis->pTADTimerRC = TMTimerRCPtr(pThis->pTADTimerR3);7372 pThis->pTADTimerRC = TMTimerRCPtr(pThis->pTADTimerR3); 7358 7373 # endif /* E1K_NO_TAD */ 7359 #endif /* E1K_USE_TX_TIMERS */ 7374 } 7375 //#endif /* E1K_USE_TX_TIMERS */ 7360 7376 #ifdef E1K_TX_DELAY 7361 7377 pThis->pTXDTimerRC = TMTimerRCPtr(pThis->pTXDTimerR3); … … 7538 7554 /** @todo LineSpeed unused! */ 7539 7555 7540 pThis->fR0Enabled = true;7541 pThis->fRCEnabled = true;7542 pThis->fEthernetCRC = true;7543 pThis->fGSOEnabled = true;7544 pThis->fItrEnabled = true;7545 pThis->fItrRxEnabled = true;7546 7547 7556 /* Get config params */ 7548 7557 rc = CFGMR3QueryBytes(pCfg, "MAC", pThis->macConfigured.au8, sizeof(pThis->macConfigured.au8)); … … 7579 7588 N_("Configuration error: Failed to get the value of 'GSOEnabled'")); 7580 7589 7581 rc = CFGMR3QueryBoolDef(pCfg, "ItrEnabled", &pThis->fItrEnabled, true);7590 rc = CFGMR3QueryBoolDef(pCfg, "ItrEnabled", &pThis->fItrEnabled, false); 7582 7591 if (RT_FAILURE(rc)) 7583 7592 return PDMDEV_SET_ERROR(pDevIns, rc, … … 7588 7597 return PDMDEV_SET_ERROR(pDevIns, rc, 7589 7598 N_("Configuration error: Failed to get the value of 'ItrRxEnabled'")); 7599 7600 rc = CFGMR3QueryBoolDef(pCfg, "TidEnabled", &pThis->fTidEnabled, false); 7601 if (RT_FAILURE(rc)) 7602 return PDMDEV_SET_ERROR(pDevIns, rc, 7603 N_("Configuration error: Failed to get the value of 'TidEnabled'")); 7590 7604 7591 7605 rc = CFGMR3QueryU32Def(pCfg, "LinkUpDelay", (uint32_t*)&pThis->cMsLinkUpDelay, 5000); /* ms */ … … 7599 7613 LogRel(("%s WARNING! Link up delay is disabled!\n", pThis->szPrf)); 7600 7614 7601 LogRel(("%s Chip=%s LinkUpDelay=%ums EthernetCRC=%s GSO=%s Itr=%s ItrRx=%s R0=%s GC=%s\n", pThis->szPrf,7615 LogRel(("%s Chip=%s LinkUpDelay=%ums EthernetCRC=%s GSO=%s Itr=%s ItrRx=%s TID=%s R0=%s GC=%s\n", pThis->szPrf, 7602 7616 g_aChips[pThis->eChip].pcszName, pThis->cMsLinkUpDelay, 7603 7617 pThis->fEthernetCRC ? "on" : "off", … … 7605 7619 pThis->fItrEnabled ? "enabled" : "disabled", 7606 7620 pThis->fItrRxEnabled ? "enabled" : "disabled", 7621 pThis->fTidEnabled ? "enabled" : "disabled", 7607 7622 pThis->fR0Enabled ? "enabled" : "disabled", 7608 7623 pThis->fRCEnabled ? "enabled" : "disabled")); … … 7703 7718 #endif /* E1K_TX_DELAY */ 7704 7719 7705 #ifdef E1K_USE_TX_TIMERS 7706 /* Create Transmit Interrupt Delay Timer */ 7707 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kTxIntDelayTimer, pThis, 7708 TMTIMER_FLAGS_NO_CRIT_SECT, 7709 "E1000 Transmit Interrupt Delay Timer", &pThis->pTIDTimerR3); 7710 if (RT_FAILURE(rc)) 7711 return rc; 7712 pThis->pTIDTimerR0 = TMTimerR0Ptr(pThis->pTIDTimerR3); 7713 pThis->pTIDTimerRC = TMTimerRCPtr(pThis->pTIDTimerR3); 7720 //#ifdef E1K_USE_TX_TIMERS 7721 if (pThis->fTidEnabled) 7722 { 7723 /* Create Transmit Interrupt Delay Timer */ 7724 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kTxIntDelayTimer, pThis, 7725 TMTIMER_FLAGS_NO_CRIT_SECT, 7726 "E1000 Transmit Interrupt Delay Timer", &pThis->pTIDTimerR3); 7727 if (RT_FAILURE(rc)) 7728 return rc; 7729 pThis->pTIDTimerR0 = TMTimerR0Ptr(pThis->pTIDTimerR3); 7730 pThis->pTIDTimerRC = TMTimerRCPtr(pThis->pTIDTimerR3); 7714 7731 7715 7732 # ifndef E1K_NO_TAD 7716 /* Create Transmit Absolute Delay Timer */7717 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kTxAbsDelayTimer, pThis,7718 TMTIMER_FLAGS_NO_CRIT_SECT,7719 "E1000 Transmit Absolute Delay Timer", &pThis->pTADTimerR3);7720 if (RT_FAILURE(rc))7721 return rc;7722 pThis->pTADTimerR0 = TMTimerR0Ptr(pThis->pTADTimerR3);7723 pThis->pTADTimerRC = TMTimerRCPtr(pThis->pTADTimerR3);7733 /* Create Transmit Absolute Delay Timer */ 7734 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, e1kTxAbsDelayTimer, pThis, 7735 TMTIMER_FLAGS_NO_CRIT_SECT, 7736 "E1000 Transmit Absolute Delay Timer", &pThis->pTADTimerR3); 7737 if (RT_FAILURE(rc)) 7738 return rc; 7739 pThis->pTADTimerR0 = TMTimerR0Ptr(pThis->pTADTimerR3); 7740 pThis->pTADTimerRC = TMTimerRCPtr(pThis->pTADTimerR3); 7724 7741 # endif /* E1K_NO_TAD */ 7725 #endif /* E1K_USE_TX_TIMERS */ 7742 } 7743 //#endif /* E1K_USE_TX_TIMERS */ 7726 7744 7727 7745 #ifdef E1K_USE_RX_TIMERS
Note:
See TracChangeset
for help on using the changeset viewer.