Changeset 88529 in vbox
- Timestamp:
- Apr 15, 2021 12:01:54 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Devices/Network/DevE1000.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r88490 r88529 1123 1123 /** TX: Fetched TX descriptors. */ 1124 1124 E1KTXDESC aTxDescriptors[E1K_TXD_CACHE_SIZE]; 1125 /** TX: Validity of TX descriptors. Set by e1kLocateTxPacket, used by e1kXmitPacket. */ 1126 bool afTxDValid[E1K_TXD_CACHE_SIZE]; 1125 1127 /** TX: Actual number of fetched TX descriptors. */ 1126 1128 uint8_t nTxDFetched; … … 5148 5150 e1kPrintTDesc(pThis, pDesc, "vvv"); 5149 5151 5150 if (pDesc->legacy.dw3.fDD)5151 {5152 E1kLog(("%s e1kXmitDesc: skipping bad descriptor ^^^\n", pThis->szPrf));5153 e1kDescReport(pDevIns, pThis, pDesc, addr);5154 return VINF_SUCCESS;5155 }5156 5157 5152 //#ifdef E1K_USE_TX_TIMERS 5158 5153 if (pThis->fTidEnabled) … … 5177 5172 if (pDesc->data.cmd.u20DTALEN == 0 || pDesc->data.u64BufAddr == 0) 5178 5173 { 5179 E1kLog2(("% Empty data descriptor, skipped.\n", pThis->szPrf));5174 E1kLog2(("%s Empty data descriptor, skipped.\n", pThis->szPrf)); 5180 5175 if (pDesc->data.cmd.fEOP) 5181 5176 { … … 5303 5298 } 5304 5299 5305 DECLINLINE( void) e1kUpdateTxContext(PE1KSTATE pThis, E1KTXDESC *pDesc)5300 DECLINLINE(bool) e1kUpdateTxContext(PE1KSTATE pThis, E1KTXDESC *pDesc) 5306 5301 { 5307 5302 if (pDesc->context.dw2.fTSE) … … 5334 5329 pDesc->context.tu.u8CSO, 5335 5330 pDesc->context.tu.u16CSE)); 5331 return true; /* TODO: Consider returning false for invalid descriptors */ 5336 5332 } 5337 5333 … … 5351 5347 uint32_t cbPacket = 0; 5352 5348 5349 /* Since we process one packet at a time we will only mark current packet's descriptors as valid */ 5350 memset(pThis->afTxDValid, 0, sizeof(pThis->afTxDValid)); 5353 5351 for (int i = pThis->iTxDCurrent; i < pThis->nTxDFetched; ++i) 5354 5352 { 5355 5353 E1KTXDESC *pDesc = &pThis->aTxDescriptors[i]; 5354 /* Assume the descriptor valid until proven otherwise. */ 5355 pThis->afTxDValid[i] = true; 5356 5356 switch (e1kGetDescType(pDesc)) 5357 5357 { 5358 5358 case E1K_DTYP_CONTEXT: 5359 5359 if (cbPacket == 0) 5360 e1kUpdateTxContext(pThis, pDesc);5360 pThis->afTxDValid[i] = e1kUpdateTxContext(pThis, pDesc); 5361 5361 else 5362 5362 E1kLog(("%s e1kLocateTxPacket: ignoring a context descriptor in the middle of a packet, cbPacket=%d\n", … … 5369 5369 E1kLog(("%s e1kLocateTxPacket: ignoring a legacy descriptor in the segmentation context, cbPacket=%d\n", 5370 5370 pThis->szPrf, cbPacket)); 5371 p Desc->legacy.dw3.fDD = true; /* Make sure it is skipped by processing */5371 pThis->afTxDValid[i] = false; /* Make sure it is skipped by processing */ 5372 5372 continue; 5373 5373 } … … 5384 5384 E1kLog(("%s e1kLocateTxPacket: ignoring %sTSE descriptor in the %ssegmentation context, cbPacket=%d\n", 5385 5385 pThis->szPrf, pDesc->data.cmd.fTSE ? "" : "non-", fTSE ? "" : "non-", cbPacket)); 5386 p Desc->data.dw3.fDD = true; /* Make sure it is skipped by processing */5386 pThis->afTxDValid[i] = false; /* Make sure it is skipped by processing */ 5387 5387 continue; 5388 5388 } … … 5469 5469 E1kLog3(("%s About to process new TX descriptor at %08x%08x, TDLEN=%08x, TDH=%08x, TDT=%08x\n", 5470 5470 pThis->szPrf, TDBAH, TDBAL + pTxdc->tdh * sizeof(E1KTXDESC), pTxdc->tdlen, pTxdc->tdh, pTxdc->tdt)); 5471 rc = e1kXmitDesc(pDevIns, pThis, pThisCC, pDesc, e1kDescAddr(TDBAH, TDBAL, pTxdc->tdh), fOnWorkerThread); 5471 if (!pThis->afTxDValid[pThis->iTxDCurrent]) 5472 { 5473 e1kPrintTDesc(pThis, pDesc, "vvv"); 5474 E1kLog(("%s e1kXmitDesc: skipping bad descriptor ^^^\n", pThis->szPrf)); 5475 e1kDescReport(pDevIns, pThis, pDesc, e1kDescAddr(TDBAH, TDBAL, pTxdc->tdh)); 5476 rc = VINF_SUCCESS; 5477 } 5478 else 5479 rc = e1kXmitDesc(pDevIns, pThis, pThisCC, pDesc, e1kDescAddr(TDBAH, TDBAL, pTxdc->tdh), fOnWorkerThread); 5472 5480 if (RT_FAILURE(rc)) 5473 5481 break;
Note:
See TracChangeset
for help on using the changeset viewer.

