diff options
author | Ilpo Järvinen <[email protected]> | 2024-06-10 18:14:52 +0300 |
---|---|---|
committer | Shuah Khan <[email protected]> | 2024-07-11 11:23:54 -0600 |
commit | fa1116d06ebc4673c4e8ca23d8e7ef73db544480 (patch) | |
tree | aed1adf3b064cd056edc773043616603ca968ad4 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | aef5efa64426396cac5b0126cbb6071e92d5da24 (diff) |
selftests/resctrl: Simplify bandwidth report type handling
bw_report is only needed for selecting the correct value from the
values IMC measured. It is a member in the resctrl_val_param struct and
is always set to "reads". The value is then checked in resctrl_val()
using validate_bw_report_request() that besides validating the input,
assumes it can mutate the string which is questionable programming
practice.
Simplify handling bw_report:
- Convert validate_bw_report_request() into get_bw_report_type() that
inputs and returns const char *. Use NULL to indicate error.
- Validate the report types inside measure_mem_bw(), not in
resctrl_val().
- Pass bw_report to measure_mem_bw() from ->measure() hook because
resctrl_val() no longer needs bw_report for anything.
Signed-off-by: Ilpo Järvinen <[email protected]>
Tested-by: Babu Moger <[email protected]>
Reviewed-by: Reinette Chatre <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions