Re: [PATCH net-next V2 3/3] net/mlx5e: Make PCIe congestion event thresholds configurable

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

 



On Thu, 10 Jul 2025 09:51:32 +0300 Tariq Toukan wrote:
> Add a new sysfs entry for reading and configuring the PCIe congestion
> event thresholds. The format is the following:
> <inbound_low> <inbound_high> <outbound_low> <outbound_high>
> 
> Units are 0.01 %. Accepted values are in range (0, 10000].
> 
> When new thresholds are configured, a object modify operation will
> happen. The set function is updated accordingly to act as a modify
> as well.
> 
> The threshold configuration is stored and queried directly
> in the firmware.
> 
> To prevent fat fingering the numbers, read them initially as u64.

no sysfs, please :S Could you add these knobs to devlink?

> +	if (config) {
> +		*config = (struct mlx5e_pcie_cong_thresh) {
> +			.inbound_low = MLX5_GET(pcie_cong_event_obj, obj,
> +						inbound_cong_low_threshold),

Why are you overwriting the whole struct. It'd literally save you 
1 char of line length and 2 lines of LoC to pop a config-> in front
of each of these assignments...

The "whole struct assignment" really only makes sense when you
intentionally want to set the remaining members to 0 which is likely
very much _not_ what you want here, was the config struct ever to be
extended..

I know the cool new language features are cool but..

> +			.inbound_high = MLX5_GET(pcie_cong_event_obj, obj,
> +						inbound_cong_high_threshold),
> +			.outbound_low = MLX5_GET(pcie_cong_event_obj, obj,
> +						 outbound_cong_low_threshold),
> +			.outbound_high = MLX5_GET(pcie_cong_event_obj, obj,
> +						  outbound_cong_high_threshold),
> +		};
> +	}




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux