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: <65bfbea3-8007-43ec-af58-2d61f5488a88@redhat.com>
Date: Tue, 18 Mar 2025 10:36:32 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Tariq Toukan <tariqt@...dia.com>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew+netdev@...n.ch>
Cc: Gal Pressman <gal@...dia.com>, Mark Bloch <mbloch@...dia.com>,
 Moshe Shemesh <moshe@...dia.com>, Saeed Mahameed <saeedm@...dia.com>,
 Leon Romanovsky <leon@...nel.org>, netdev@...r.kernel.org,
 linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
 Carolina Jubran <cjubran@...dia.com>, Cosmin Ratiu <cratiu@...dia.com>,
 Dragos Tatulea <dtatulea@...dia.com>
Subject: Re: [PATCH net-next 4/4] net/mlx5: Add support for setting parent of
 nodes

On 3/10/25 10:26 PM, Tariq Toukan wrote:
> @@ -1018,3 +1018,105 @@ int mlx5_esw_devlink_rate_leaf_parent_set(struct devlink_rate *devlink_rate,
>  	node = parent_priv;
>  	return mlx5_esw_qos_vport_update_parent(vport, node, extack);
>  }
> +
> +static int
> +mlx5_esw_qos_node_validate_set_parent(struct mlx5_esw_sched_node *node,
> +				      struct mlx5_esw_sched_node *parent,
> +				      struct netlink_ext_ack *extack)
> +{
> +	u8 new_level, max_level;
> +
> +	if (parent && parent->esw != node->esw) {
> +		NL_SET_ERR_MSG_MOD(extack,
> +				   "Cannot assign node to another E-Switch");
> +		return -EOPNOTSUPP;
> +	}
> +
> +	if (!list_empty(&node->children)) {
> +		NL_SET_ERR_MSG_MOD(extack,
> +				   "Cannot reassign a node that contains rate objects");
> +		return -EOPNOTSUPP;
> +	}
> +
> +	new_level = parent ? parent->level + 1 : 2;
> +	max_level = 1 << MLX5_CAP_QOS(node->esw->dev, log_esw_max_sched_depth);
> +	if (new_level > max_level) {
> +		NL_SET_ERR_MSG_MOD(extack,
> +				   "Node hierarchy depth exceeds the maximum supported level");

Minor nit for a possible small follow-up: it could be possibly useful to
add to the extact the current and max level.

/P


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ