[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cbb5488b-4923-4032-a037-7ff851772a64@nvidia.com>
Date: Mon, 24 Nov 2025 20:37:37 +0200
From: Gal Pressman <gal@...dia.com>
To: Danielle Costantino <dcostantino@...a.com>, netdev@...r.kernel.org
Cc: kuba@...nel.org, tariqt@...dia.com, pabeni@...hat.com, saeedm@...dia.com,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net/mlx5e: Fix validation logic in rate limiting
On 24/11/2025 20:00, Danielle Costantino wrote:
> The rate limiting validation condition currently checks the output
> variable max_bw_value[i] instead of the input value
> maxrate->tc_maxrate[i]. This causes the validation to compare an
> uninitialized or stale value rather than the actual requested rate.
>
> The condition should check the input rate to properly validate against
> the upper limit:
>
> } else if (maxrate->tc_maxrate[i] <= upper_limit_gbps) {
>
> This aligns with the pattern used in the first branch, which correctly
> checks maxrate->tc_maxrate[i] against upper_limit_mbps.
>
> The current implementation can lead to unreliable validation behavior:
>
> - For rates between 25.5 Gbps and 255 Gbps, if max_bw_value[i] is 0
> from initialization, the GBPS path may be taken regardless of whether
> the actual rate is within bounds
>
> - When processing multiple TCs (i > 0), max_bw_value[i] contains the
> value computed for the previous TC, affecting the validation logic
>
> - The overflow check for rates exceeding 255 Gbps may not trigger
> consistently depending on previous array values
>
> This patch ensures the validation correctly examines the requested rate
> value for proper bounds checking.
>
> Fixes: 43b27d1bd88a ("net/mlx5e: Fix wraparound in rate limiting for values above 255 Gbps")
> Signed-off-by: Danielle Costantino <dcostantino@...a.com>
Thanks Danielle!
Reviewed-by: Gal Pressman <gal@...dia.com>
Powered by blists - more mailing lists