@@ -406,7 +406,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM
406406 auto &productHelper = pLinuxSysmanImp->getDeviceHandle ()->getNEODevice ()->getProductHelper ();
407407 hwInfo->platform .usRevId = productHelper.getHwRevIdFromStepping (REVISION_B, *hwInfo);
408408 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (properties.subdeviceId ));
409-
409+ pPmt-> setGuid (guid64BitMemoryCounters);
410410 pPmt->mockVfid0Status = true ;
411411 pSysfsAccess->mockReadUInt64Value .push_back (hbmRP0Frequency);
412412 pSysfsAccess->mockReadReturnStatus .push_back (ZE_RESULT_SUCCESS);
@@ -440,7 +440,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM
440440 auto &productHelper = pLinuxSysmanImp->getDeviceHandle ()->getNEODevice ()->getProductHelper ();
441441 hwInfo->platform .usRevId = productHelper.getHwRevIdFromStepping (REVISION_B, *hwInfo);
442442 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (properties.subdeviceId ));
443-
443+ pPmt-> setGuid (guid64BitMemoryCounters);
444444 pPmt->mockVfid1Status = true ;
445445 pSysfsAccess->mockReadUInt64Value .push_back (hbmRP0Frequency);
446446 pSysfsAccess->mockReadReturnStatus .push_back (ZE_RESULT_SUCCESS);
@@ -470,6 +470,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM
470470 zes_mem_bandwidth_t bandwidth;
471471
472472 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (properties.subdeviceId ));
473+ pPmt->setGuid (guid64BitMemoryCounters);
473474 pPmt->mockReadArgumentValue .push_back (1 );
474475 pPmt->mockReadValueReturnStatus .push_back (ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID
475476 pPmt->mockReadArgumentValue .push_back (0 );
@@ -480,6 +481,24 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM
480481 }
481482}
482483
484+ HWTEST2_F (SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthAndVF0_VFIDFailsForOldGuidThenFailureIsReturned, IsPVC) {
485+ setLocalSupportedAndReinit (true );
486+ auto handles = getMemoryHandles (memoryHandleComponentCount);
487+
488+ for (auto &handle : handles) {
489+ zes_mem_properties_t properties = {};
490+ zesMemoryGetProperties (handle, &properties);
491+
492+ zes_mem_bandwidth_t bandwidth;
493+
494+ auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (properties.subdeviceId ));
495+ pPmt->setGuid (" 0xb15a0edd" );
496+ pPmt->mockReadArgumentValue .push_back (1 );
497+ pPmt->mockReadValueReturnStatus .push_back (ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
498+ EXPECT_EQ (zesMemoryGetBandwidth (handle, &bandwidth), ZE_RESULT_ERROR_UNSUPPORTED_FEATURE);
499+ }
500+ }
501+
483502HWTEST2_F (SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthAndVF0_HBM_READ_HFailsThenFailureIsReturned, IsPVC) {
484503 setLocalSupportedAndReinit (true );
485504 auto handles = getMemoryHandles (memoryHandleComponentCount);
@@ -491,6 +510,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM
491510 zes_mem_bandwidth_t bandwidth;
492511
493512 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (properties.subdeviceId ));
513+ pPmt->setGuid (guid64BitMemoryCounters);
494514 pPmt->mockReadArgumentValue .push_back (1 );
495515 pPmt->mockReadValueReturnStatus .push_back (ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID
496516 pPmt->mockReadArgumentValue .push_back (0 );
@@ -514,6 +534,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM
514534 zes_mem_bandwidth_t bandwidth;
515535
516536 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (properties.subdeviceId ));
537+ pPmt->setGuid (guid64BitMemoryCounters);
517538 pPmt->mockReadArgumentValue .push_back (1 );
518539 pPmt->mockReadValueReturnStatus .push_back (ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID
519540 pPmt->mockReadArgumentValue .push_back (0 );
@@ -539,6 +560,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM
539560 zes_mem_bandwidth_t bandwidth;
540561
541562 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (properties.subdeviceId ));
563+ pPmt->setGuid (guid64BitMemoryCounters);
542564 pPmt->mockReadArgumentValue .push_back (1 );
543565 pPmt->mockReadValueReturnStatus .push_back (ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID
544566 pPmt->mockReadArgumentValue .push_back (0 );
@@ -732,7 +754,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingGetBandwid
732754 auto &productHelper = pLinuxSysmanImp->getDeviceHandle ()->getNEODevice ()->getProductHelper ();
733755 hwInfo->platform .usRevId = productHelper.getHwRevIdFromStepping (REVISION_B, *hwInfo);
734756 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (0 ));
735-
757+ pPmt-> setGuid (guid64BitMemoryCounters);
736758 pPmt->mockVfid1Status = true ;
737759 pSysfsAccess->mockReadUInt64Value .push_back (hbmRP0Frequency);
738760 pSysfsAccess->mockReadReturnStatus .push_back (ZE_RESULT_SUCCESS);
@@ -754,7 +776,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingGetBandwid
754776 auto &productHelper = pLinuxSysmanImp->getDeviceHandle ()->getNEODevice ()->getProductHelper ();
755777 hwInfo->platform .usRevId = productHelper.getHwRevIdFromStepping (REVISION_B, *hwInfo);
756778 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (0 ));
757-
779+ pPmt-> setGuid (guid64BitMemoryCounters);
758780 pPmt->mockVfid0Status = true ;
759781 pSysfsAccess->mockReadUInt64Value .push_back (hbmRP0Frequency);
760782 pSysfsAccess->mockReadReturnStatus .push_back (ZE_RESULT_SUCCESS);
@@ -813,6 +835,7 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidUsRevIdForRevisionBWhenCallingzes
813835 hwInfo->platform .usRevId = productHelper.getHwRevIdFromStepping (REVISION_B, *hwInfo);
814836 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (properties.subdeviceId ));
815837 pPmt->mockVfid1Status = true ;
838+ pPmt->setGuid (guid64BitMemoryCounters);
816839 pSysfsAccess->mockReadUInt64Value .push_back (hbmRP0Frequency);
817840 pSysfsAccess->mockReadReturnStatus .push_back (ZE_RESULT_SUCCESS);
818841
@@ -1027,6 +1050,7 @@ TEST_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenBothVfid0AndVfid1Are
10271050 zes_mem_bandwidth_t bandwidth;
10281051
10291052 auto pPmt = static_cast <MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess (properties.subdeviceId ));
1053+ pPmt->setGuid (guid64BitMemoryCounters);
10301054 pPmt->mockReadArgumentValue .push_back (0 );
10311055 pPmt->mockReadValueReturnStatus .push_back (ZE_RESULT_SUCCESS); // Return success after reading VF0_VFID
10321056 pPmt->mockReadArgumentValue .push_back (0 );
0 commit comments