lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241015110407.GD569285@kernel.org>
Date: Tue, 15 Oct 2024 12:04:07 +0100
From: Simon Horman <horms@...nel.org>
To: Tariq Toukan <tariqt@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
	Saeed Mahameed <saeedm@...dia.com>, Gal Pressman <gal@...dia.com>,
	Leon Romanovsky <leonro@...dia.com>, cjubran@...dia.com,
	cratiu@...dia.com
Subject: Re: [PATCH net-next V2 09/15] net/mlx5: Remove vport QoS enabled flag

On Mon, Oct 14, 2024 at 11:52:54PM +0300, Tariq Toukan wrote:
> From: Carolina Jubran <cjubran@...dia.com>
> 
> Remove the `enabled` flag from the `vport->qos` struct, as QoS now
> relies solely on the `sched_node` pointer to determine whether QoS
> features are in use.
> 
> Currently, the vport `qos` struct consists only of the `sched_node`,
> introducing an unnecessary two-level reference. However, the qos struct
> is retained as it will be extended in future patches to support new QoS
> features.
> 
> Signed-off-by: Carolina Jubran <cjubran@...dia.com>
> Reviewed-by: Cosmin Ratiu <cratiu@...dia.com>
> Signed-off-by: Tariq Toukan <tariqt@...dia.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c | 13 ++++++-------
>  drivers/net/ethernet/mellanox/mlx5/core/eswitch.h |  2 --
>  2 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c

...

> @@ -933,7 +932,7 @@ int mlx5_esw_qos_modify_vport_rate(struct mlx5_eswitch *esw, u16 vport_num, u32
>  	}
>  
>  	esw_qos_lock(esw);
> -	if (!vport->qos.enabled) {
> +	if (!vport->qos.sched_node) {
>  		/* Eswitch QoS wasn't enabled yet. Enable it and vport QoS. */
>  		err = esw_qos_vport_enable(vport, rate_mbps, vport->qos.sched_node->bw_share, NULL);

Sorry, another nit from my side:

If we get here then vport->qos.sched_node is NULL,
but it is dereferenced on the line above.

Flagged by Smatch.

>  	} else {

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ