mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 16:48:45 +08:00
Added boilerplate implementation of Sysman FabricPort
Change-Id: Icb8db2b1bac7858fd07470506c17f5cc38f34581 Signed-off-by: Bill Jordan <bill.jordan@intel.com>
This commit is contained in:
@@ -406,7 +406,7 @@ __zedllexport ze_result_t __zecall
|
||||
zetSysmanFabricPortGetProperties(
|
||||
zet_sysman_fabric_port_handle_t hPort,
|
||||
zet_fabric_port_properties_t *pProperties) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetProperties(pProperties);
|
||||
}
|
||||
|
||||
__zedllexport ze_result_t __zecall
|
||||
@@ -414,35 +414,35 @@ zetSysmanFabricPortGetLinkType(
|
||||
zet_sysman_fabric_port_handle_t hPort,
|
||||
ze_bool_t verbose,
|
||||
zet_fabric_link_type_t *pLinkType) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetLinkType(verbose, pLinkType);
|
||||
}
|
||||
|
||||
__zedllexport ze_result_t __zecall
|
||||
zetSysmanFabricPortGetConfig(
|
||||
zet_sysman_fabric_port_handle_t hPort,
|
||||
zet_fabric_port_config_t *pConfig) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetConfig(pConfig);
|
||||
}
|
||||
|
||||
__zedllexport ze_result_t __zecall
|
||||
zetSysmanFabricPortSetConfig(
|
||||
zet_sysman_fabric_port_handle_t hPort,
|
||||
const zet_fabric_port_config_t *pConfig) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
return L0::FabricPort::fromHandle(hPort)->fabricPortSetConfig(pConfig);
|
||||
}
|
||||
|
||||
__zedllexport ze_result_t __zecall
|
||||
zetSysmanFabricPortGetState(
|
||||
zet_sysman_fabric_port_handle_t hPort,
|
||||
zet_fabric_port_state_t *pState) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetState(pState);
|
||||
}
|
||||
|
||||
__zedllexport ze_result_t __zecall
|
||||
zetSysmanFabricPortGetThroughput(
|
||||
zet_sysman_fabric_port_handle_t hPort,
|
||||
zet_fabric_port_throughput_t *pThroughput) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetThroughput(pThroughput);
|
||||
}
|
||||
|
||||
__zedllexport ze_result_t __zecall
|
||||
|
||||
24
level_zero/tools/source/sysman/fabric_port/CMakeLists.txt
Normal file
24
level_zero/tools/source/sysman/fabric_port/CMakeLists.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(L0_SRCS_TOOLS_SYSMAN_FABRICPORT
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/fabric_port.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/fabric_port.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/fabric_port_imp.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/fabric_port_imp.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_fabric_port.h
|
||||
)
|
||||
|
||||
target_sources(${L0_STATIC_LIB_NAME}
|
||||
PRIVATE
|
||||
${L0_SRCS_TOOLS_SYSMAN_FABRICPORT}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
)
|
||||
|
||||
add_subdirectories()
|
||||
|
||||
# Make our source files visible to parent
|
||||
set_property(GLOBAL PROPERTY L0_SRCS_TOOLS_SYSMAN_FABRICPORT ${L0_SRCS_TOOLS_SYSMAN_FABRICPORT})
|
||||
46
level_zero/tools/source/sysman/fabric_port/fabric_port.cpp
Normal file
46
level_zero/tools/source/sysman/fabric_port/fabric_port.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "level_zero/tools/source/sysman/fabric_port/fabric_port.h"
|
||||
|
||||
#include "level_zero/tools/source/sysman/fabric_port/fabric_port_imp.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
FabricPortHandleContext::~FabricPortHandleContext() {
|
||||
for (FabricPort *pFabricPort : handleList) {
|
||||
delete pFabricPort;
|
||||
}
|
||||
handleList.clear();
|
||||
}
|
||||
|
||||
ze_result_t FabricPortHandleContext::init() {
|
||||
uint32_t numPorts = FabricPortImp::numPorts(pOsSysman);
|
||||
|
||||
for (uint32_t portNum = 0; portNum < numPorts; portNum++) {
|
||||
FabricPort *pFabricPort = new FabricPortImp(pOsSysman, portNum);
|
||||
handleList.push_back(pFabricPort);
|
||||
}
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ze_result_t FabricPortHandleContext::fabricPortGet(uint32_t *pCount, zet_sysman_fabric_port_handle_t *phPort) {
|
||||
if (nullptr == phPort) {
|
||||
*pCount = static_cast<uint32_t>(handleList.size());
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
uint32_t i = 0;
|
||||
for (FabricPort *pFabricPort : handleList) {
|
||||
if (i >= *pCount)
|
||||
break;
|
||||
phPort[i++] = pFabricPort->toHandle();
|
||||
}
|
||||
*pCount = i;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
47
level_zero/tools/source/sysman/fabric_port/fabric_port.h
Normal file
47
level_zero/tools/source/sysman/fabric_port/fabric_port.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <level_zero/zet_api.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
struct _zet_sysman_fabric_port_handle_t {};
|
||||
|
||||
namespace L0 {
|
||||
|
||||
struct OsSysman;
|
||||
|
||||
class FabricPort : _zet_sysman_fabric_port_handle_t {
|
||||
public:
|
||||
virtual ~FabricPort() = default;
|
||||
virtual ze_result_t fabricPortGetProperties(zet_fabric_port_properties_t *pProperties) = 0;
|
||||
virtual ze_result_t fabricPortGetLinkType(ze_bool_t verbose, zet_fabric_link_type_t *pLinkType) = 0;
|
||||
virtual ze_result_t fabricPortGetConfig(zet_fabric_port_config_t *pConfig) = 0;
|
||||
virtual ze_result_t fabricPortSetConfig(const zet_fabric_port_config_t *pConfig) = 0;
|
||||
virtual ze_result_t fabricPortGetState(zet_fabric_port_state_t *pState) = 0;
|
||||
virtual ze_result_t fabricPortGetThroughput(zet_fabric_port_throughput_t *pThroughput) = 0;
|
||||
|
||||
static FabricPort *fromHandle(zet_sysman_fabric_port_handle_t handle) {
|
||||
return static_cast<FabricPort *>(handle);
|
||||
}
|
||||
inline zet_sysman_fabric_port_handle_t toHandle() { return this; }
|
||||
};
|
||||
|
||||
struct FabricPortHandleContext {
|
||||
FabricPortHandleContext(OsSysman *pOsSysman) : pOsSysman(pOsSysman){};
|
||||
~FabricPortHandleContext();
|
||||
|
||||
ze_result_t init();
|
||||
|
||||
ze_result_t fabricPortGet(uint32_t *pCount, zet_sysman_fabric_port_handle_t *phPort);
|
||||
|
||||
OsSysman *pOsSysman = nullptr;
|
||||
std::vector<FabricPort *> handleList;
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "level_zero/tools/source/sysman/fabric_port/fabric_port_imp.h"
|
||||
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace L0 {
|
||||
|
||||
void fabricPortGetTimestamp(uint64_t ×tamp) {
|
||||
std::chrono::time_point<std::chrono::steady_clock> ts = std::chrono::steady_clock::now();
|
||||
timestamp = std::chrono::duration_cast<std::chrono::microseconds>(ts.time_since_epoch()).count();
|
||||
}
|
||||
|
||||
ze_result_t FabricPortImp::fabricPortGetProperties(zet_fabric_port_properties_t *pProperties) {
|
||||
*pProperties = fabricPortProperties;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ze_result_t FabricPortImp::fabricPortGetLinkType(ze_bool_t verbose, zet_fabric_link_type_t *pLinkType) {
|
||||
return pOsFabricPort->getLinkType(verbose, pLinkType);
|
||||
}
|
||||
|
||||
ze_result_t FabricPortImp::fabricPortGetConfig(zet_fabric_port_config_t *pConfig) {
|
||||
return pOsFabricPort->getConfig(pConfig);
|
||||
}
|
||||
|
||||
ze_result_t FabricPortImp::fabricPortSetConfig(const zet_fabric_port_config_t *pConfig) {
|
||||
return pOsFabricPort->setConfig(pConfig);
|
||||
}
|
||||
|
||||
ze_result_t FabricPortImp::fabricPortGetState(zet_fabric_port_state_t *pState) {
|
||||
return pOsFabricPort->getState(pState);
|
||||
}
|
||||
|
||||
ze_result_t FabricPortImp::fabricPortGetThroughput(zet_fabric_port_throughput_t *pThroughput) {
|
||||
fabricPortGetTimestamp(pThroughput->timestamp);
|
||||
ze_result_t result = pOsFabricPort->getThroughput(pThroughput);
|
||||
return result;
|
||||
}
|
||||
|
||||
void FabricPortImp::init() {
|
||||
fabricPortProperties.onSubdevice = false;
|
||||
fabricPortProperties.subdeviceId = 0L;
|
||||
pOsFabricPort->getModel(fabricPortProperties.model);
|
||||
pOsFabricPort->getPortUuid(fabricPortProperties.portUuid);
|
||||
pOsFabricPort->getMaxRxSpeed(fabricPortProperties.maxRxSpeed);
|
||||
pOsFabricPort->getMaxTxSpeed(fabricPortProperties.maxTxSpeed);
|
||||
}
|
||||
|
||||
FabricPortImp::FabricPortImp(OsSysman *pOsSysman, uint32_t portNum) {
|
||||
pOsFabricPort = OsFabricPort::create(pOsSysman, portNum);
|
||||
UNRECOVERABLE_IF(nullptr == pOsFabricPort);
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
FabricPortImp::~FabricPortImp() {
|
||||
delete pOsFabricPort;
|
||||
pOsFabricPort = nullptr;
|
||||
}
|
||||
|
||||
uint32_t FabricPortImp::numPorts(OsSysman *pOsSysman) {
|
||||
return OsFabricPort::numPorts(pOsSysman);
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
41
level_zero/tools/source/sysman/fabric_port/fabric_port_imp.h
Normal file
41
level_zero/tools/source/sysman/fabric_port/fabric_port_imp.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
|
||||
#include "level_zero/tools/source/sysman/fabric_port/fabric_port.h"
|
||||
#include "level_zero/tools/source/sysman/fabric_port/os_fabric_port.h"
|
||||
#include <level_zero/zet_api.h>
|
||||
|
||||
namespace L0 {
|
||||
|
||||
class FabricPortImp : public FabricPort, public NEO::NonCopyableClass {
|
||||
public:
|
||||
ze_result_t fabricPortGetProperties(zet_fabric_port_properties_t *pProperties) override;
|
||||
ze_result_t fabricPortGetLinkType(ze_bool_t verbose, zet_fabric_link_type_t *pLinkType) override;
|
||||
ze_result_t fabricPortGetConfig(zet_fabric_port_config_t *pConfig) override;
|
||||
ze_result_t fabricPortSetConfig(const zet_fabric_port_config_t *pConfig) override;
|
||||
ze_result_t fabricPortGetState(zet_fabric_port_state_t *pState) override;
|
||||
ze_result_t fabricPortGetThroughput(zet_fabric_port_throughput_t *pThroughput) override;
|
||||
|
||||
FabricPortImp() = default;
|
||||
FabricPortImp(OsSysman *pOsSysman, uint32_t portNum);
|
||||
~FabricPortImp() override;
|
||||
void init();
|
||||
|
||||
static uint32_t numPorts(OsSysman *pOsSysman);
|
||||
|
||||
protected:
|
||||
OsFabricPort *pOsFabricPort = nullptr;
|
||||
|
||||
private:
|
||||
zet_fabric_port_properties_t fabricPortProperties = {};
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(L0_SRCS_TOOLS_SYSMAN_FABRICPORT_LINUX
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_fabric_port_imp.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_fabric_port_imp.h
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
target_sources(${L0_STATIC_LIB_NAME}
|
||||
PRIVATE
|
||||
${L0_SRCS_TOOLS_SYSMAN_FABRICPORT_LINUX}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Make our source files visible to parent
|
||||
set_property(GLOBAL PROPERTY L0_SRCS_TOOLS_SYSMAN_FABRICPORT_LINUX ${L0_SRCS_TOOLS_SYSMAN_FABRICPORT_LINUX})
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "level_zero/tools/source/sysman/fabric_port/linux/os_fabric_port_imp.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
namespace L0 {
|
||||
|
||||
ze_result_t LinuxFabricPortImp::getLinkType(ze_bool_t verbose, zet_fabric_link_type_t *pLinkType) {
|
||||
if (verbose) {
|
||||
::snprintf(reinterpret_cast<char *>(pLinkType->desc), ZET_MAX_FABRIC_LINK_TYPE_SIZE, "%s", "SAMPLE LINK, VERBOSE");
|
||||
} else {
|
||||
::snprintf(reinterpret_cast<char *>(pLinkType->desc), ZET_MAX_FABRIC_LINK_TYPE_SIZE, "%s", "SAMPLE LINK");
|
||||
}
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ze_result_t LinuxFabricPortImp::getConfig(zet_fabric_port_config_t *pConfig) {
|
||||
*pConfig = config;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ze_result_t LinuxFabricPortImp::setConfig(const zet_fabric_port_config_t *pConfig) {
|
||||
config = *pConfig;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ze_result_t LinuxFabricPortImp::getState(zet_fabric_port_state_t *pState) {
|
||||
pState->status = ZET_FABRIC_PORT_STATUS_BLACK;
|
||||
pState->qualityIssues = ZET_FABRIC_PORT_QUAL_ISSUES_NONE;
|
||||
pState->stabilityIssues = ZET_FABRIC_PORT_STAB_ISSUES_NONE;
|
||||
pState->rxSpeed.bitRate = 0LU;
|
||||
pState->rxSpeed.width = 0U;
|
||||
pState->rxSpeed.maxBandwidth = 0LU;
|
||||
pState->txSpeed.bitRate = 0LU;
|
||||
pState->txSpeed.width = 0U;
|
||||
pState->txSpeed.maxBandwidth = 0LU;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
ze_result_t LinuxFabricPortImp::getThroughput(zet_fabric_port_throughput_t *pThroughput) {
|
||||
pThroughput->rxCounter = 0LU;
|
||||
pThroughput->txCounter = 0LU;
|
||||
pThroughput->rxMaxBandwidth = 0LU;
|
||||
pThroughput->txMaxBandwidth = 0LU;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
void LinuxFabricPortImp::getModel(int8_t *model) {
|
||||
::snprintf(reinterpret_cast<char *>(model), ZET_MAX_FABRIC_PORT_MODEL_SIZE, "%s", this->model.c_str());
|
||||
}
|
||||
|
||||
void LinuxFabricPortImp::getPortUuid(zet_fabric_port_uuid_t &portUuid) {
|
||||
portUuid = this->portUuid;
|
||||
}
|
||||
|
||||
void LinuxFabricPortImp::getMaxRxSpeed(zet_fabric_port_speed_t &maxRxSpeed) {
|
||||
maxRxSpeed = this->maxRxSpeed;
|
||||
}
|
||||
|
||||
void LinuxFabricPortImp::getMaxTxSpeed(zet_fabric_port_speed_t &maxTxSpeed) {
|
||||
maxTxSpeed = this->maxTxSpeed;
|
||||
}
|
||||
|
||||
LinuxFabricPortImp::LinuxFabricPortImp(OsSysman *pOsSysman, uint32_t portNum) {
|
||||
this->portNum = portNum;
|
||||
model = std::string("EXAMPLE");
|
||||
}
|
||||
|
||||
LinuxFabricPortImp::~LinuxFabricPortImp() {
|
||||
}
|
||||
|
||||
OsFabricPort *OsFabricPort::create(OsSysman *pOsSysman, uint32_t portNum) {
|
||||
LinuxFabricPortImp *pLinuxFabricPortImp = new LinuxFabricPortImp(pOsSysman, portNum);
|
||||
return static_cast<OsFabricPort *>(pLinuxFabricPortImp);
|
||||
}
|
||||
|
||||
uint32_t OsFabricPort::numPorts(OsSysman *pOsSysman) {
|
||||
return 0U;
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
|
||||
#include "sysman/fabric_port/fabric_port_imp.h"
|
||||
#include "sysman/fabric_port/os_fabric_port.h"
|
||||
#include "sysman/linux/fs_access.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
class LinuxFabricPortImp : public NEO::NonCopyableClass, public OsFabricPort {
|
||||
public:
|
||||
ze_result_t getLinkType(ze_bool_t verbose, zet_fabric_link_type_t *pLinkType) override;
|
||||
ze_result_t getConfig(zet_fabric_port_config_t *pConfig) override;
|
||||
ze_result_t setConfig(const zet_fabric_port_config_t *pConfig) override;
|
||||
ze_result_t getState(zet_fabric_port_state_t *pState) override;
|
||||
ze_result_t getThroughput(zet_fabric_port_throughput_t *pThroughput) override;
|
||||
void getModel(int8_t *model) override;
|
||||
void getPortUuid(zet_fabric_port_uuid_t &portUuid) override;
|
||||
void getMaxRxSpeed(zet_fabric_port_speed_t &maxRxSpeed) override;
|
||||
void getMaxTxSpeed(zet_fabric_port_speed_t &maxTxSpeed) override;
|
||||
|
||||
LinuxFabricPortImp(OsSysman *pOsSysman, uint32_t portNum);
|
||||
~LinuxFabricPortImp() override;
|
||||
|
||||
private:
|
||||
uint32_t portNum = 0;
|
||||
std::string model = "";
|
||||
zet_fabric_port_uuid_t portUuid = {};
|
||||
zet_fabric_port_speed_t maxRxSpeed = {};
|
||||
zet_fabric_port_speed_t maxTxSpeed = {};
|
||||
zet_fabric_port_config_t config = {};
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
33
level_zero/tools/source/sysman/fabric_port/os_fabric_port.h
Normal file
33
level_zero/tools/source/sysman/fabric_port/os_fabric_port.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "level_zero/tools/source/sysman/os_sysman.h"
|
||||
#include <level_zero/zet_api.h>
|
||||
|
||||
namespace L0 {
|
||||
|
||||
class OsFabricPort {
|
||||
public:
|
||||
virtual ze_result_t getLinkType(ze_bool_t verbose, zet_fabric_link_type_t *pLinkType) = 0;
|
||||
virtual ze_result_t getConfig(zet_fabric_port_config_t *pConfig) = 0;
|
||||
virtual ze_result_t setConfig(const zet_fabric_port_config_t *pConfig) = 0;
|
||||
virtual ze_result_t getState(zet_fabric_port_state_t *pState) = 0;
|
||||
virtual ze_result_t getThroughput(zet_fabric_port_throughput_t *pThroughput) = 0;
|
||||
virtual void getModel(int8_t *model) = 0;
|
||||
virtual void getPortUuid(zet_fabric_port_uuid_t &portUuid) = 0;
|
||||
virtual void getMaxRxSpeed(zet_fabric_port_speed_t &maxRxSpeed) = 0;
|
||||
virtual void getMaxTxSpeed(zet_fabric_port_speed_t &maxTxSpeed) = 0;
|
||||
|
||||
static uint32_t numPorts(OsSysman *pOsSysman);
|
||||
static OsFabricPort *create(OsSysman *pOsSysman, uint32_t portNum);
|
||||
|
||||
virtual ~OsFabricPort() = default;
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
@@ -0,0 +1,21 @@
|
||||
#
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(L0_SRCS_TOOLS_SYSMAN_FABRICPORT_WINDOWS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_fabric_port_imp.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_fabric_port_imp.h
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_sources(${L0_STATIC_LIB_NAME}
|
||||
PRIVATE
|
||||
${L0_SRCS_TOOLS_SYSMAN_FABRICPORT_WINDOWS}
|
||||
)
|
||||
endif()
|
||||
|
||||
# Make our source files visible to parent
|
||||
set_property(GLOBAL PROPERTY L0_SRCS_TOOLS_SYSMAN_FABRICPORT_WINDOWS ${L0_SRCS_TOOLS_SYSMAN_FABRICPORT_WINDOWS})
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "level_zero/tools/source/sysman/fabric_port/windows/os_fabric_port_imp.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
namespace L0 {
|
||||
|
||||
ze_result_t WddmFabricPortImp::getLinkType(ze_bool_t verbose, zet_fabric_link_type_t *pLinkType) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
ze_result_t WddmFabricPortImp::getConfig(zet_fabric_port_config_t *pConfig) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
ze_result_t WddmFabricPortImp::setConfig(const zet_fabric_port_config_t *pConfig) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
ze_result_t WddmFabricPortImp::getState(zet_fabric_port_state_t *pState) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
ze_result_t WddmFabricPortImp::getThroughput(zet_fabric_port_throughput_t *pThroughput) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
void WddmFabricPortImp::getModel(int8_t *model) {
|
||||
::memset(model, '\0', ZET_MAX_FABRIC_PORT_MODEL_SIZE);
|
||||
}
|
||||
|
||||
void WddmFabricPortImp::getPortUuid(zet_fabric_port_uuid_t &portUuid) {
|
||||
::memset(&portUuid, '\0', sizeof(portUuid));
|
||||
}
|
||||
|
||||
void WddmFabricPortImp::getMaxRxSpeed(zet_fabric_port_speed_t &maxRxSpeed) {
|
||||
::memset(&maxRxSpeed, '\0', sizeof(maxRxSpeed));
|
||||
}
|
||||
|
||||
void WddmFabricPortImp::getMaxTxSpeed(zet_fabric_port_speed_t &maxTxSpeed) {
|
||||
::memset(&maxTxSpeed, '\0', sizeof(maxTxSpeed));
|
||||
}
|
||||
|
||||
WddmFabricPortImp::WddmFabricPortImp(OsSysman *pOsSysman, uint32_t portNum) {
|
||||
}
|
||||
|
||||
WddmFabricPortImp::~WddmFabricPortImp() {
|
||||
}
|
||||
|
||||
OsFabricPort *OsFabricPort::create(OsSysman *pOsSysman, uint32_t portNum) {
|
||||
WddmFabricPortImp *pWddmFabricPortImp = new WddmFabricPortImp(pOsSysman, portNum);
|
||||
return static_cast<OsFabricPort *>(pWddmFabricPortImp);
|
||||
}
|
||||
|
||||
uint32_t OsFabricPort::numPorts(OsSysman *pOsSysman) {
|
||||
return 0U;
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
|
||||
#include "sysman/fabric_port/fabric_port_imp.h"
|
||||
#include "sysman/fabric_port/os_fabric_port.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace L0 {
|
||||
|
||||
class WddmFabricPortImp : public NEO::NonCopyableClass, public OsFabricPort {
|
||||
public:
|
||||
ze_result_t getLinkType(ze_bool_t verbose, zet_fabric_link_type_t *pLinkType) override;
|
||||
ze_result_t getConfig(zet_fabric_port_config_t *pConfig) override;
|
||||
ze_result_t setConfig(const zet_fabric_port_config_t *pConfig) override;
|
||||
ze_result_t getState(zet_fabric_port_state_t *pState) override;
|
||||
ze_result_t getThroughput(zet_fabric_port_throughput_t *pThroughput) override;
|
||||
void getModel(int8_t *model) override;
|
||||
void getPortUuid(zet_fabric_port_uuid_t &portUuid) override;
|
||||
void getMaxRxSpeed(zet_fabric_port_speed_t &maxRxSpeed) override;
|
||||
void getMaxTxSpeed(zet_fabric_port_speed_t &maxTxSpeed) override;
|
||||
|
||||
WddmFabricPortImp(OsSysman *pOsSysman, uint32_t portNum);
|
||||
~WddmFabricPortImp() override;
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "level_zero/tools/source/sysman/engine/engine.h"
|
||||
#include "level_zero/tools/source/sysman/fabric_port/fabric_port.h"
|
||||
#include "level_zero/tools/source/sysman/frequency/frequency.h"
|
||||
#include "level_zero/tools/source/sysman/memory/memory.h"
|
||||
#include "level_zero/tools/source/sysman/pci/pci.h"
|
||||
|
||||
@@ -32,9 +32,11 @@ SysmanImp::SysmanImp(ze_device_handle_t hDevice) {
|
||||
pRasHandleContext = new RasHandleContext(pOsSysman);
|
||||
pTempHandleContext = new TemperatureHandleContext(pOsSysman);
|
||||
pPowerHandleContext = new PowerHandleContext(pOsSysman);
|
||||
pFabricPortHandleContext = new FabricPortHandleContext(pOsSysman);
|
||||
}
|
||||
|
||||
SysmanImp::~SysmanImp() {
|
||||
freeResource(pFabricPortHandleContext);
|
||||
freeResource(pPowerHandleContext);
|
||||
freeResource(pTempHandleContext);
|
||||
freeResource(pRasHandleContext);
|
||||
@@ -71,6 +73,9 @@ void SysmanImp::init() {
|
||||
if (pPowerHandleContext) {
|
||||
pPowerHandleContext->init();
|
||||
}
|
||||
if (pFabricPortHandleContext) {
|
||||
pFabricPortHandleContext->init();
|
||||
}
|
||||
if (pPci) {
|
||||
pPci->init();
|
||||
}
|
||||
@@ -188,7 +193,7 @@ ze_result_t SysmanImp::memoryGet(uint32_t *pCount, zet_sysman_mem_handle_t *phMe
|
||||
}
|
||||
|
||||
ze_result_t SysmanImp::fabricPortGet(uint32_t *pCount, zet_sysman_fabric_port_handle_t *phPort) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
return pFabricPortHandleContext->fabricPortGet(pCount, phPort);
|
||||
}
|
||||
|
||||
ze_result_t SysmanImp::temperatureGet(uint32_t *pCount, zet_sysman_temp_handle_t *phTemperature) {
|
||||
|
||||
@@ -39,6 +39,7 @@ struct SysmanImp : Sysman {
|
||||
RasHandleContext *pRasHandleContext = nullptr;
|
||||
TemperatureHandleContext *pTempHandleContext = nullptr;
|
||||
PowerHandleContext *pPowerHandleContext = nullptr;
|
||||
FabricPortHandleContext *pFabricPortHandleContext = nullptr;
|
||||
|
||||
ze_result_t deviceGetProperties(zet_sysman_properties_t *pProperties) override;
|
||||
ze_result_t schedulerGetCurrentMode(zet_sched_mode_t *pMode) override;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
)
|
||||
|
||||
add_subdirectories()
|
||||
@@ -0,0 +1,13 @@
|
||||
#
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(UNIX)
|
||||
target_sources(${TARGET_NAME}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_sysman_fabric_port.cpp
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
#include "level_zero/core/test/unit_tests/mock.h"
|
||||
#include "level_zero/tools/source/sysman/fabric_port/linux/os_fabric_port_imp.h"
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "sysman/fabric_port/fabric_port_imp.h"
|
||||
#include "sysman/linux/os_sysman_imp.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
using ::testing::_;
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
class SysmanFabricPortFixture : public DeviceFixture, public ::testing::Test {
|
||||
|
||||
protected:
|
||||
std::unique_ptr<SysmanImp> sysmanImp;
|
||||
zet_sysman_handle_t hSysman;
|
||||
|
||||
static uint32_t numPorts;
|
||||
|
||||
void SetUp() override {
|
||||
|
||||
DeviceFixture::SetUp();
|
||||
sysmanImp = std::make_unique<SysmanImp>(device->toHandle());
|
||||
hSysman = sysmanImp->toHandle();
|
||||
sysmanImp->pFabricPortHandleContext->init();
|
||||
|
||||
for (uint32_t portNum = 0U; portNum < numPorts; portNum++) {
|
||||
FabricPort *pFabricPort = new FabricPortImp(sysmanImp->pOsSysman, portNum);
|
||||
EXPECT_NE(nullptr, pFabricPort);
|
||||
sysmanImp->pFabricPortHandleContext->handleList.push_back(pFabricPort);
|
||||
}
|
||||
}
|
||||
void TearDown() override {
|
||||
// Don't free FabricPorts. The FabricPortHandleContext destructor will free them.
|
||||
DeviceFixture::TearDown();
|
||||
}
|
||||
};
|
||||
|
||||
uint32_t SysmanFabricPortFixture::numPorts = 2U;
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenPortCountZeroWhenCallingZetSysmanFabricPortGetThenCountIsReturnedAndVerifySysmanFabricPortGetCallSucceeds) {
|
||||
uint32_t count = 0U;
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, NULL);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, SysmanFabricPortFixture::numPorts);
|
||||
}
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenPortCountCorrectWhenCallingZetSysmanFabricPortGetThenCountHandlesAreReturnedAndAndVerifySysmanFabricPortGetCallSucceeds) {
|
||||
uint32_t count = SysmanFabricPortFixture::numPorts;
|
||||
zet_sysman_fabric_port_handle_t hPorts[SysmanFabricPortFixture::numPorts];
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, hPorts);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, SysmanFabricPortFixture::numPorts);
|
||||
}
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenPortCountGreaterThanPortsWhenCallingZetSysmanFabricPortGetThenCorrectCountisReturnedAndAndVerifySysmanFabricPortGetCallSucceeds) {
|
||||
uint32_t count = SysmanFabricPortFixture::numPorts + 1U;
|
||||
zet_sysman_fabric_port_handle_t hPorts[SysmanFabricPortFixture::numPorts + 1U];
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, hPorts);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, SysmanFabricPortFixture::numPorts);
|
||||
}
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenPortCounLessThanPortsWhenCallingZetSysmanFabricPortGetThenCountLessTanPortsHandlesAreReturned) {
|
||||
uint32_t count = SysmanFabricPortFixture::numPorts - 1U;
|
||||
zet_sysman_fabric_port_handle_t hPorts[SysmanFabricPortFixture::numPorts - 1U];
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, hPorts);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, SysmanFabricPortFixture::numPorts - 1U);
|
||||
}
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenValidFabricPortHandleWhenCallingZetSysmanFabricPortGetPropertiesThenZetSysmanFabricPortGetPropertiesCallSucceeds) {
|
||||
uint32_t count = 1U;
|
||||
zet_sysman_fabric_port_handle_t hPorts[1U];
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, hPorts);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, 1U);
|
||||
|
||||
zet_fabric_port_properties_t properties;
|
||||
// Initialize values
|
||||
properties.onSubdevice = true;
|
||||
properties.subdeviceId = std::numeric_limits<uint32_t>::max();
|
||||
std::memset(properties.model, std::numeric_limits<int8_t>::max(), ZET_MAX_FABRIC_PORT_MODEL_SIZE);
|
||||
std::memset(properties.portUuid.id, std::numeric_limits<uint8_t>::max(), ZET_MAX_FABRIC_PORT_UUID_SIZE);
|
||||
properties.maxRxSpeed.bitRate = std::numeric_limits<uint64_t>::max();
|
||||
properties.maxRxSpeed.width = std::numeric_limits<uint32_t>::max();
|
||||
properties.maxRxSpeed.maxBandwidth = std::numeric_limits<uint64_t>::max();
|
||||
properties.maxTxSpeed.bitRate = std::numeric_limits<uint64_t>::max();
|
||||
properties.maxTxSpeed.width = std::numeric_limits<uint32_t>::max();
|
||||
properties.maxTxSpeed.maxBandwidth = std::numeric_limits<uint64_t>::max();
|
||||
|
||||
result = zetSysmanFabricPortGetProperties(hPorts[0], &properties);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_FALSE(properties.onSubdevice);
|
||||
EXPECT_EQ(0L, properties.subdeviceId);
|
||||
EXPECT_STREQ("EXAMPLE", reinterpret_cast<char *>(properties.model));
|
||||
zet_fabric_port_uuid_t expectedUuid = {};
|
||||
EXPECT_TRUE(0 == std::memcmp(&expectedUuid, properties.portUuid.id, ZET_MAX_FABRIC_PORT_UUID_SIZE));
|
||||
EXPECT_EQ(0LU, properties.maxRxSpeed.bitRate);
|
||||
EXPECT_EQ(0U, properties.maxRxSpeed.width);
|
||||
EXPECT_EQ(0LU, properties.maxRxSpeed.maxBandwidth);
|
||||
EXPECT_EQ(0LU, properties.maxTxSpeed.bitRate);
|
||||
EXPECT_EQ(0U, properties.maxTxSpeed.width);
|
||||
EXPECT_EQ(0LU, properties.maxTxSpeed.maxBandwidth);
|
||||
}
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenValidFabricPortHandleWhenCallingZetSysmanFabricPortGetLinkTypeThenZetSysmanFabricPortGetLinkTypeCallSucceeds) {
|
||||
uint32_t count = 1U;
|
||||
zet_sysman_fabric_port_handle_t hPorts[1U];
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, hPorts);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, 1U);
|
||||
|
||||
zet_fabric_link_type_t linkType;
|
||||
bool verbose = true;
|
||||
result = zetSysmanFabricPortGetLinkType(hPorts[0U], verbose, &linkType);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
verbose = false;
|
||||
result = zetSysmanFabricPortGetLinkType(hPorts[0U], verbose, &linkType);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_STREQ("SAMPLE LINK", reinterpret_cast<char *>(linkType.desc));
|
||||
}
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenValidFabricPortHandleWhenCallingZetSysmanFabricPortGetConfigThenZetSysmanFabricPortGetConfigCallSucceeds) {
|
||||
uint32_t count = 1U;
|
||||
zet_sysman_fabric_port_handle_t hPorts[1U];
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, hPorts);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, 1U);
|
||||
|
||||
zet_fabric_port_config_t getConfig = {.enabled = true, .beaconing = true};
|
||||
result = zetSysmanFabricPortGetConfig(hPorts[0U], &getConfig);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_FALSE(getConfig.enabled);
|
||||
EXPECT_FALSE(getConfig.beaconing);
|
||||
}
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenValidFabricPortHandleWhenCallingZetSysmanFabricPortSetConfigThenZetSysmanFabricPortGetConfigCallSucceeds) {
|
||||
uint32_t count = 1U;
|
||||
zet_sysman_fabric_port_handle_t hPorts[1U];
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, hPorts);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, 1U);
|
||||
|
||||
zet_fabric_port_config_t setConfig = {.enabled = true, .beaconing = false};
|
||||
result = zetSysmanFabricPortSetConfig(hPorts[0U], &setConfig);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
zet_fabric_port_config_t getConfig = {.enabled = false, .beaconing = true};
|
||||
result = zetSysmanFabricPortGetConfig(hPorts[0U], &getConfig);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_TRUE(getConfig.enabled);
|
||||
EXPECT_FALSE(getConfig.beaconing);
|
||||
}
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenValidFabricPortHandleWhenCallingZetSysmanFabricPortGetStateThenZetSysmanFabricPortGetStateCallSucceeds) {
|
||||
uint32_t count = 1U;
|
||||
zet_sysman_fabric_port_handle_t hPorts[1U];
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, hPorts);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, 1U);
|
||||
|
||||
zet_fabric_port_state_t state;
|
||||
result = zetSysmanFabricPortGetState(hPorts[0U], &state);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(ZET_FABRIC_PORT_STATUS_BLACK, state.status);
|
||||
EXPECT_EQ(ZET_FABRIC_PORT_QUAL_ISSUES_NONE, state.qualityIssues);
|
||||
EXPECT_EQ(ZET_FABRIC_PORT_STAB_ISSUES_NONE, state.stabilityIssues);
|
||||
EXPECT_EQ(0LU, state.rxSpeed.bitRate);
|
||||
EXPECT_EQ(0U, state.rxSpeed.width);
|
||||
EXPECT_EQ(0LU, state.rxSpeed.maxBandwidth);
|
||||
EXPECT_EQ(0LU, state.txSpeed.bitRate);
|
||||
EXPECT_EQ(0U, state.txSpeed.width);
|
||||
EXPECT_EQ(0LU, state.txSpeed.maxBandwidth);
|
||||
}
|
||||
|
||||
TEST_F(SysmanFabricPortFixture, GivenValidFabricPortHandleWhenCallingZetSysmanFabricPortGetThroughputThenZetSysmanFabricPortGetThroughputCallSucceeds) {
|
||||
uint32_t count = 1U;
|
||||
zet_sysman_fabric_port_handle_t hPorts[1U];
|
||||
ze_result_t result = zetSysmanFabricPortGet(hSysman, &count, hPorts);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(count, 1U);
|
||||
|
||||
zet_fabric_port_throughput_t throughput;
|
||||
// Initialize values
|
||||
throughput.timestamp = 0LU;
|
||||
throughput.rxCounter = std::numeric_limits<uint64_t>::max();
|
||||
throughput.txCounter = std::numeric_limits<uint64_t>::max();
|
||||
throughput.rxMaxBandwidth = std::numeric_limits<uint64_t>::max();
|
||||
throughput.txMaxBandwidth = std::numeric_limits<uint64_t>::max();
|
||||
|
||||
result = zetSysmanFabricPortGetThroughput(hPorts[0U], &throughput);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_NE(0LU, throughput.timestamp);
|
||||
EXPECT_EQ(0LU, throughput.rxCounter);
|
||||
EXPECT_EQ(0LU, throughput.txCounter);
|
||||
EXPECT_EQ(0LU, throughput.rxMaxBandwidth);
|
||||
EXPECT_EQ(0LU, throughput.txMaxBandwidth);
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
||||
Reference in New Issue
Block a user