Re: [PATCH v4 11/16] selftests/resctrl: Simplify bandwidth report type handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ilpo,

On 5/20/24 5:30 AM, Ilpo Järvinen wrote:
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().

- As resctrl_val() no longer needs bw_report for anything, it can just
   be passed to measure_mem_bw() by the ->measure() hooks.

Needs imperative tone


Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
---

Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux