From: Jakub Kicinski <kuba@kernel.org>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Saeed Mahameed <saeed@kernel.org>, Gal Pressman <gal@nvidia.com>,
"Leon Romanovsky" <leon@kernel.org>,
Saeed Mahameed <saeedm@nvidia.com>,
Mark Bloch <mbloch@nvidia.com>, Jonathan Corbet <corbet@lwn.net>,
<netdev@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
<linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Dragos Tatulea <dtatulea@nvidia.com>
Subject: Re: [PATCH net-next V2 3/3] net/mlx5e: Make PCIe congestion event thresholds configurable
Date: Fri, 11 Jul 2025 16:30:18 -0700 [thread overview]
Message-ID: <20250711163018.335ea0f5@kernel.org> (raw)
In-Reply-To: <1752130292-22249-4-git-send-email-tariqt@nvidia.com>
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),
> + };
> + }
prev parent reply other threads:[~2025-07-11 23:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 6:51 [PATCH net-next V2 0/3] net/mlx5e: Add support for PCIe congestion events Tariq Toukan
2025-07-10 6:51 ` [PATCH net-next V2 1/3] net/mlx5e: Create/destroy PCIe Congestion Event object Tariq Toukan
2025-07-10 6:51 ` [PATCH net-next V2 2/3] net/mlx5e: Add device PCIe congestion ethtool stats Tariq Toukan
2025-07-11 2:06 ` kernel test robot
2025-07-11 23:25 ` Jakub Kicinski
2025-07-12 7:55 ` Dragos Tatulea
2025-07-14 15:26 ` Jakub Kicinski
2025-07-15 13:59 ` Tariq Toukan
2025-07-15 14:18 ` Jakub Kicinski
2025-07-10 6:51 ` [PATCH net-next V2 3/3] net/mlx5e: Make PCIe congestion event thresholds configurable Tariq Toukan
2025-07-11 23:30 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250711163018.335ea0f5@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=dtatulea@nvidia.com \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeed@kernel.org \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).