@@ -40,78 +40,6 @@ ze_result_t LinuxFabricDeviceImp::getThroughput(const zes_fabric_port_id_t portI
4040 return pFabricDeviceAccess->getThroughput (portId, *pThroughput);
4141}
4242
43- ze_result_t LinuxFabricDeviceImp::getErrorCounters (const zes_fabric_port_id_t portId, zes_fabric_port_error_counters_t *pErrors) {
44- FsAccess *pFsAccess = &pLinuxSysmanImp->getFsAccess ();
45- SysfsAccess *pSysfsAccess = &pLinuxSysmanImp->getSysfsAccess ();
46- std::string devicePciPath (" " );
47- ze_result_t result = pSysfsAccess->getRealPath (" device/" , devicePciPath);
48- if (result != ZE_RESULT_SUCCESS) {
49- NEO::printDebugString (NEO::DebugManager.flags .PrintDebugMessages .get (), stderr,
50- " error@<%s> <failed to get device path> <result: 0x%x>\n " , __func__, result);
51- return result;
52- }
53- std::string path (" " );
54- std::vector<std::string> list;
55- result = pFsAccess->listDirectory (devicePciPath, list);
56- if (result != ZE_RESULT_SUCCESS) {
57- NEO::printDebugString (NEO::DebugManager.flags .PrintDebugMessages .get (), stderr,
58- " error@<%s> <failed to get list of files in device directory> <result: 0x%x>\n " , __func__, result);
59- return result;
60- }
61-
62- for (auto entry : list) {
63- if ((entry.find (" i915.iaf." ) != std::string::npos) ||
64- (entry.find (" iaf." ) != std::string::npos)) {
65- path = devicePciPath + " /" + entry;
66- break ;
67- }
68- }
69- if (path.empty ()) {
70- // This device does not have a fabric
71- NEO::printDebugString (NEO::DebugManager.flags .PrintDebugMessages .get (), stderr,
72- " error@<%s> <Device does not have fabric>\n " , __func__);
73- return ZE_RESULT_ERROR_NOT_AVAILABLE;
74- }
75- std::string fabricFwErrorPath = path + " /sd." + std::to_string (portId.attachId );
76- std::string fabricLinkErrorPath = path + " /sd." + std::to_string (portId.attachId ) + " /port." + std::to_string (portId.portNumber );
77- uint64_t linkErrorCount = 0 ;
78- std::string linkFailureFile = fabricLinkErrorPath + " /link_failures" ;
79- result = pFsAccess->read (linkFailureFile, linkErrorCount);
80- if (result != ZE_RESULT_SUCCESS) {
81- NEO::printDebugString (NEO::DebugManager.flags .PrintDebugMessages .get (), stderr,
82- " error@<%s> <failed to read file %s> <result: 0x%x>\n " , __func__, linkFailureFile.c_str (), result);
83- linkErrorCount = 0 ;
84- }
85- uint64_t linkDegradeCount = 0 ;
86- std::string linkDegradeFile = fabricLinkErrorPath + " /link_degrades" ;
87- result = pFsAccess->read (linkDegradeFile, linkDegradeCount);
88- if (result != ZE_RESULT_SUCCESS) {
89- NEO::printDebugString (NEO::DebugManager.flags .PrintDebugMessages .get (), stderr,
90- " error@<%s> <failed to read file %s> <result: 0x%x>\n " , __func__, linkDegradeFile.c_str (), result);
91- linkDegradeCount = 0 ;
92- }
93- uint64_t fwErrorCount = 0 ;
94- std::string fwErrorFile = fabricFwErrorPath + " /fw_error" ;
95- result = pFsAccess->read (fwErrorFile, fwErrorCount);
96- if (result != ZE_RESULT_SUCCESS) {
97- NEO::printDebugString (NEO::DebugManager.flags .PrintDebugMessages .get (), stderr,
98- " error@<%s> <failed to read file %s> <result: 0x%x>\n " , __func__, fwErrorFile.c_str (), result);
99- fwErrorCount = 0 ;
100- }
101- uint64_t fwCommErrorCount = 0 ;
102- std::string fwCommErrorFile = fabricFwErrorPath + " /fw_comm_errors" ;
103- result = pFsAccess->read (fwCommErrorFile, fwCommErrorCount);
104- if (result != ZE_RESULT_SUCCESS) {
105- NEO::printDebugString (NEO::DebugManager.flags .PrintDebugMessages .get (), stderr,
106- " error@<%s> <failed to read file %s> <result: 0x%x>\n " , __func__, fwCommErrorFile.c_str (), result);
107- fwCommErrorCount = 0 ;
108- }
109- pErrors->linkFailureCount = linkErrorCount;
110- pErrors->linkDegradeCount = linkDegradeCount;
111- pErrors->fwErrorCount = fwErrorCount;
112- pErrors->fwCommErrorCount = fwCommErrorCount;
113- return ZE_RESULT_SUCCESS;
114- }
11543ze_result_t LinuxFabricDeviceImp::performSweep () {
11644 uint32_t start = 0U ;
11745 uint32_t end = 0U ;
@@ -283,10 +211,6 @@ ze_result_t LinuxFabricPortImp::getThroughput(zes_fabric_port_throughput_t *pThr
283211 return pLinuxFabricDeviceImp->getThroughput (portId, pThroughput);
284212}
285213
286- ze_result_t LinuxFabricPortImp::getErrorCounters (zes_fabric_port_error_counters_t *pErrors) {
287- return pLinuxFabricDeviceImp->getErrorCounters (portId, pErrors);
288- }
289-
290214ze_result_t LinuxFabricPortImp::getProperties (zes_fabric_port_properties_t *pProperties) {
291215 ::snprintf (pProperties->model, ZES_MAX_FABRIC_PORT_MODEL_SIZE, " %s" , this ->model.c_str());
292216 pProperties->onSubdevice = this ->onSubdevice ;
0 commit comments