netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Tariq Toukan <tariqt@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>
Cc: Gal Pressman <gal@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
	Moshe Shemesh <moshe@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Carolina Jubran <cjubran@nvidia.com>,
	Cosmin Ratiu <cratiu@nvidia.com>,
	Dragos Tatulea <dtatulea@nvidia.com>
Subject: Re: [PATCH net-next 4/4] net/mlx5: Add support for setting parent of nodes
Date: Tue, 18 Mar 2025 10:36:32 +0100	[thread overview]
Message-ID: <65bfbea3-8007-43ec-af58-2d61f5488a88@redhat.com> (raw)
In-Reply-To: <1741642016-44918-5-git-send-email-tariqt@nvidia.com>

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


  reply	other threads:[~2025-03-18  9:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 21:26 [PATCH net-next 0/4] mlx5: Support setting a parent for a devlink rate node Tariq Toukan
2025-03-10 21:26 ` [PATCH net-next 1/4] net/mlx5: Rename devlink rate parent set function for leaf nodes Tariq Toukan
2025-03-10 21:26 ` [PATCH net-next 2/4] net/mlx5: Introduce hierarchy level tracking on scheduling nodes Tariq Toukan
2025-03-10 21:26 ` [PATCH net-next 3/4] net/mlx5: Preserve rate settings when creating a rate node Tariq Toukan
2025-03-10 21:26 ` [PATCH net-next 4/4] net/mlx5: Add support for setting parent of nodes Tariq Toukan
2025-03-18  9:36   ` Paolo Abeni [this message]
2025-03-13 22:27 ` [PATCH net-next 0/4] mlx5: Support setting a parent for a devlink rate node Jacob Keller
2025-03-18 10:00 ` patchwork-bot+netdevbpf

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=65bfbea3-8007-43ec-af58-2d61f5488a88@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=cjubran@nvidia.com \
    --cc=cratiu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.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).