Skip to content

Commit 06035f0

Browse files
ij-intelshuahkh
authored andcommitted
selftests/resctrl: Fix feature checks
The MBA and CMT tests expect support of other features to be able to run. When platform only supports MBA but not MBM, MBA test will fail with: Failed to open total bw file: No such file or directory When platform only supports CMT but not CAT, CMT test will fail with: Failed to open bit mask file '/sys/fs/resctrl/info/L3/cbm_mask': No such file or directory It leads to the test reporting test fail (even if no test was run at all). Extend feature checks to cover these two conditions to show these tests were skipped rather than failed. Fixes: ee04156 ("selftests/resctrl: Use resctrl/info for feature detection") Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Cc: <stable@vger.kernel.org> # selftests/resctrl: Refactor feature check to use resource and feature name Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent d56e5da commit 06035f0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/testing/selftests/resctrl/resctrl_tests.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ static void run_mba_test(const char * const *benchmark_cmd, int cpu_no)
130130
return;
131131
}
132132

133-
if (!validate_resctrl_feature_request("MB", NULL) || (get_vendor() != ARCH_INTEL)) {
133+
if (!validate_resctrl_feature_request("MB", NULL) ||
134+
!validate_resctrl_feature_request("L3_MON", "mbm_local_bytes") ||
135+
(get_vendor() != ARCH_INTEL)) {
134136
ksft_test_result_skip("Hardware does not support MBA or MBA is disabled\n");
135137
goto cleanup;
136138
}
@@ -153,7 +155,8 @@ static void run_cmt_test(const char * const *benchmark_cmd, int cpu_no)
153155
return;
154156
}
155157

156-
if (!validate_resctrl_feature_request("L3_MON", "llc_occupancy")) {
158+
if (!validate_resctrl_feature_request("L3_MON", "llc_occupancy") ||
159+
!validate_resctrl_feature_request("L3", NULL)) {
157160
ksft_test_result_skip("Hardware does not support CMT or CMT is disabled\n");
158161
goto cleanup;
159162
}

0 commit comments

Comments
 (0)