Changeset 40791 in vbox
- Timestamp:
- Apr 6, 2012 1:46:37 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevE1000.cpp
r40652 r40791 979 979 /** EMT: */ 980 980 bool fGCEnabled; 981 /** EMT: Compute Ethernet CRC for RX packets. */ 982 bool fEthernetCRC; 983 #if HC_ARCH_BITS == 64 984 uint32_t Alignment2; 985 #endif 981 986 982 987 /** All: Device register storage. */ … … 1074 1079 STAMCOUNTER StatIntsPrevented; 1075 1080 STAMPROFILEADV StatReceive; 1081 STAMPROFILEADV StatReceiveCRC; 1076 1082 STAMPROFILEADV StatReceiveFilter; 1077 1083 STAMPROFILEADV StatReceiveStore; … … 2039 2045 if (!(RCTL & RCTL_SECRC)) 2040 2046 { 2041 /* Add FCS if CRC stripping is not enabled */ 2042 *(uint32_t*)(rxPacket + cb) = RTCrc32(rxPacket, cb); 2047 STAM_PROFILE_ADV_START(&pState->StatReceiveCRC, a); 2048 /* 2049 * Add FCS if CRC stripping is not enabled. Since the value of CRC 2050 * is ignored by most of drivers we may as well save us the trouble 2051 * of calculating it (see EthernetCRC CFGM parameter). 2052 */ 2053 if (pState->fEthernetCRC) 2054 *(uint32_t*)(rxPacket + cb) = RTCrc32(rxPacket, cb); 2043 2055 cb += sizeof(uint32_t); 2056 STAM_PROFILE_ADV_STOP(&pState->StatReceiveCRC, a); 2044 2057 } 2045 2058 /* Compute checksum of complete packet */ … … 5896 5909 * Validate configuration. 5897 5910 */ 5898 if (!CFGMR3AreValuesValid(pCfg, "MAC\0" "CableConnected\0" "AdapterType\0" "LineSpeed\0" "GCEnabled\0" "R0Enabled\0")) 5911 if (!CFGMR3AreValuesValid(pCfg, "MAC\0" "CableConnected\0" "AdapterType\0" 5912 "LineSpeed\0" "GCEnabled\0" "R0Enabled\0" 5913 "EthernetCRC\0")) 5899 5914 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 5900 5915 N_("Invalid configuration for E1000 device")); … … 5904 5919 pState->fR0Enabled = true; 5905 5920 pState->fGCEnabled = true; 5921 pState->fEthernetCRC = true; 5906 5922 5907 5923 /* Get config params */ … … 5929 5945 return PDMDEV_SET_ERROR(pDevIns, rc, 5930 5946 N_("Configuration error: Failed to get the value of 'R0Enabled'")); 5947 5948 rc = CFGMR3QueryBoolDef(pCfg, "EthernetCRC", &pState->fEthernetCRC, true); 5949 if (RT_FAILURE(rc)) 5950 return PDMDEV_SET_ERROR(pDevIns, rc, 5951 N_("Configuration error: Failed to get the value of 'EthernetCRC'")); 5931 5952 5932 5953 E1kLog(("%s Chip=%s\n", INSTANCE(pState), g_Chips[pState->eChip].pcszName)); … … 6180 6201 PDMDevHlpSTAMRegisterF(pDevIns, &pState->StatIntsPrevented, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_OCCURENCES, "Number of prevented interrupts", "/Devices/E1k%d/Interrupts/Prevented", iInstance); 6181 6202 PDMDevHlpSTAMRegisterF(pDevIns, &pState->StatReceive, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling receive", "/Devices/E1k%d/Receive/Total", iInstance); 6203 PDMDevHlpSTAMRegisterF(pDevIns, &pState->StatReceiveCRC, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling receive checksumming", "/Devices/E1k%d/Receive/CRC", iInstance); 6182 6204 PDMDevHlpSTAMRegisterF(pDevIns, &pState->StatReceiveFilter, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling receive filtering", "/Devices/E1k%d/Receive/Filter", iInstance); 6183 6205 PDMDevHlpSTAMRegisterF(pDevIns, &pState->StatReceiveStore, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, "Profiling receive storing", "/Devices/E1k%d/Receive/Store", iInstance);
Note:
See TracChangeset
for help on using the changeset viewer.