[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250711163018.335ea0f5@kernel.org>
Date: Fri, 11 Jul 2025 16:30:18 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tariq Toukan <tariqt@...dia.com>
Cc: Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Saeed Mahameed <saeed@...nel.org>, Gal Pressman
<gal@...dia.com>, "Leon Romanovsky" <leon@...nel.org>, Saeed Mahameed
<saeedm@...dia.com>, Mark Bloch <mbloch@...dia.com>, Jonathan Corbet
<corbet@....net>, <netdev@...r.kernel.org>, <linux-rdma@...r.kernel.org>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Dragos Tatulea
<dtatulea@...dia.com>
Subject: Re: [PATCH net-next V2 3/3] net/mlx5e: Make PCIe congestion event
thresholds configurable
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),
> + };
> + }
Powered by blists - more mailing lists