Update Fabric Latency to Edge Properties (2)

- Only initialize vertexes when queried.
- Return also bandwidth when calling PRELIM_DRM_I915_QUERY_FABRIC_INFO.

Related-To: LOCI-3464

Signed-off-by: Jaime A Arteaga Molina <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime A Arteaga Molina
2022-10-25 07:21:48 +00:00
committed by Compute-Runtime-Automation
parent 638aba45a0
commit 5446b9ca0d
16 changed files with 251 additions and 48 deletions

View File

@@ -134,7 +134,7 @@ class IoctlHelper {
virtual std::string getFileForMaxGpuFrequency() const;
virtual std::string getFileForMaxGpuFrequencyOfSubDevice(int subDeviceId) const;
virtual std::string getFileForMaxMemoryFrequencyOfSubDevice(int subDeviceId) const;
virtual bool getFabricLatency(uint32_t fabricId, uint32_t &latency) = 0;
virtual bool getFabricLatency(uint32_t fabricId, uint32_t &latency, uint32_t &bandwidth) = 0;
uint32_t getFlagsForPrimeHandleToFd() const;
@@ -191,7 +191,7 @@ class IoctlHelperUpstream : public IoctlHelper {
int getDrmParamValue(DrmParam drmParam) const override;
std::string getDrmParamString(DrmParam param) const override;
std::string getIoctlString(DrmIoctl ioctlRequest) const override;
bool getFabricLatency(uint32_t fabricId, uint32_t &latency) override;
bool getFabricLatency(uint32_t fabricId, uint32_t &latency, uint32_t &bandwidth) override;
};
template <PRODUCT_FAMILY gfxProduct>
@@ -258,7 +258,7 @@ class IoctlHelperPrelim20 : public IoctlHelper {
std::string getDrmParamString(DrmParam param) const override;
std::string getIoctlString(DrmIoctl ioctlRequest) const override;
bool checkIfIoctlReinvokeRequired(int error, DrmIoctl ioctlRequest) const override;
bool getFabricLatency(uint32_t fabricId, uint32_t &latency) override;
bool getFabricLatency(uint32_t fabricId, uint32_t &latency, uint32_t &bandwidth) override;
};
} // namespace NEO

View File

@@ -655,7 +655,7 @@ bool IoctlHelperPrelim20::checkIfIoctlReinvokeRequired(int error, DrmIoctl ioctl
return IoctlHelper::checkIfIoctlReinvokeRequired(error, ioctlRequest);
}
bool IoctlHelperPrelim20::getFabricLatency(uint32_t fabricId, uint32_t &latency) {
bool IoctlHelperPrelim20::getFabricLatency(uint32_t fabricId, uint32_t &latency, uint32_t &bandwidth) {
Query query = {};
QueryItem queryItem = {};
PrelimI915::prelim_drm_i915_query_fabric_info info = {};
@@ -673,13 +673,14 @@ bool IoctlHelperPrelim20::getFabricLatency(uint32_t fabricId, uint32_t &latency)
return false;
}
if (info.latency < 10) {
if (info.latency < 10 || info.bandwidth == 0) {
return false;
}
// Latency is in tenths of path length. 10 == 1 fabric link between src and dst
// 1 link = zero hops
latency = (info.latency / 10) - 1;
bandwidth = info.bandwidth;
return true;
}

View File

@@ -236,7 +236,7 @@ std::string IoctlHelperUpstream::getIoctlString(DrmIoctl ioctlRequest) const {
}
}
bool IoctlHelperUpstream::getFabricLatency(uint32_t fabricId, uint32_t &latency) {
bool IoctlHelperUpstream::getFabricLatency(uint32_t fabricId, uint32_t &latency, uint32_t &bandwidth) {
return false;
}
} // namespace NEO