Changeset 8085 in vbox
- Timestamp:
- Apr 17, 2008 9:54:16 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r7960 r8085 88 88 #define PCNET_PNPMMIO_SIZE 0x20 89 89 90 #define PCNET_SAVEDSTATE_VERSION 990 #define PCNET_SAVEDSTATE_VERSION 10 91 91 92 92 #define BCR_MAX_RAP 50 … … 193 193 /** If set the link is temporarily down because of a saved state load. */ 194 194 bool fLinkTempDown; 195 /** True if we signal the guest that RX packets are missing. */ 196 bool fSignalRxMiss; 195 197 196 198 /** Number of times we've reported the link down. */ … … 1518 1520 #undef PCNET_INIT 1519 1521 1522 size_t cbRxBuffers = 0; 1523 for (int i = CSR_RCVRL(pData); i >= 1; i--) 1524 { 1525 RMD rmd; 1526 RTGCPHYS32 addr = pcnetRdraAddr(pData, i); 1527 /* At this time it is not guaranteed that the buffers are already initialized. */ 1528 if (pcnetRmdLoad(pData, &rmd, PHYSADDR(pData, addr), false)) 1529 cbRxBuffers += 4096-rmd.rmd1.bcnt; 1530 } 1531 1532 /* 1533 * Heuristics: The Solaris pcn driver allocates too few RX buffers (128 buffers of a 1534 * size of 128 bytes are 16KB in summary) leading to frequent RX buffer overflows. In 1535 * that case we don't signal RX overflows through the CSR0_MISS flag as the driver 1536 * re-initializes the device on every miss. Other guests use at least 32 buffers of 1537 * usually 1536 bytes and should therefore not run into condition. If they are still 1538 * short in RX buffers we notify this condition. 1539 */ 1540 pData->fSignalRxMiss = (cbRxBuffers == 0 || cbRxBuffers >= 32*_1K); 1541 1520 1542 if (pData->pDrv) 1521 1543 pData->pDrv->pfnSetPromiscuousMode(pData->pDrv, CSR_PROM(pData)); … … 1532 1554 CSR_CXST(pData) = CSR_CXBC(pData) = CSR_NXST(pData) = CSR_NXBC(pData) = 0; 1533 1555 1534 LogRel(("PCNet#%d: Init: ss32=%d GCRDRA=%#010x[%d] GCTDRA=%#010x[%d] \n",1556 LogRel(("PCNet#%d: Init: ss32=%d GCRDRA=%#010x[%d] GCTDRA=%#010x[%d]%s\n", 1535 1557 PCNET_INST_NR, BCR_SSIZE32(pData), 1536 pData->GCRDRA, CSR_RCVRL(pData), pData->GCTDRA, CSR_XMTRL(pData))); 1558 pData->GCRDRA, CSR_RCVRL(pData), pData->GCTDRA, CSR_XMTRL(pData), 1559 !pData->fSignalRxMiss ? " (CSR0_MISS disabled)" : "")); 1537 1560 1538 1561 pData->aCSR[0] |= 0x0101; /* Initialization done */ … … 4080 4103 SSMR3PutS32(pSSMHandle, pData->iISR); 4081 4104 SSMR3PutU32(pSSMHandle, pData->u32Lnkst); 4082 SSMR3PutBool(pSSMHandle, pData->fPrivIfEnabled); 4105 SSMR3PutBool(pSSMHandle, pData->fPrivIfEnabled); /* >= If version 0.9 */ 4106 SSMR3PutBool(pSSMHandle, pData->fSignalRxMiss); /* >= If version 0.10 */ 4083 4107 SSMR3PutGCPhys32(pSSMHandle, pData->GCRDRA); 4084 4108 SSMR3PutGCPhys32(pSSMHandle, pData->GCTDRA); … … 4090 4114 SSMR3PutU64(pSSMHandle, pData->u64LastPoll); 4091 4115 SSMR3PutMem(pSSMHandle, &pData->MacConfigured, sizeof(pData->MacConfigured)); 4092 SSMR3PutBool(pSSMHandle, pData->fAm79C973); 4116 SSMR3PutBool(pSSMHandle, pData->fAm79C973); /* >= If version 0.8 */ 4093 4117 SSMR3PutU32(pSSMHandle, pData->u32LinkSpeed); 4094 4118 #ifdef PCNET_NO_POLLING … … 4150 4174 if (pData->fPrivIfEnabled) 4151 4175 LogRel(("PCNet#%d: Enabling private interface\n", PCNET_INST_NR)); 4176 } 4177 if ( SSM_VERSION_MAJOR(u32Version) > 0 4178 || SSM_VERSION_MINOR(u32Version) >= 10) 4179 { 4180 SSMR3GetBool(pSSMHandle, &pData->fSignalRxMiss); 4152 4181 } 4153 4182 SSMR3GetGCPhys32(pSSMHandle, &pData->GCRDRA); … … 4254 4283 4255 4284 if (RT_UNLIKELY(HOST_IS_OWNER(CSR_CRST(pData)))) 4285 { 4256 4286 /** @todo Notify the guest _now_. Will potentially increase the interrupt load */ 4257 pData->aCSR[0] |= 0x1000; /* Set MISS flag */ 4287 if (pData->fSignalRxMiss) 4288 pData->aCSR[0] |= 0x1000; /* Set MISS flag */ 4289 } 4258 4290 else 4259 4291 rc = VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.