public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel•org>
To: Tariq Toukan <tariqt@nvidia•com>
Cc: "David S. Miller" <davem@davemloft•net>,
	Paolo Abeni <pabeni@redhat•com>,
	Eric Dumazet <edumazet@google•com>,
	"Andrew Lunn" <andrew+netdev@lunn•ch>,
	Leon Romanovsky <leonro@nvidia•com>, <netdev@vger•kernel.org>,
	Saeed Mahameed <saeedm@nvidia•com>, Gal Pressman <gal@nvidia•com>,
	<linux-rdma@vger•kernel.org>,
	Carolina Jubran <cjubran@nvidia•com>,
	Cosmin Ratiu <cratiu@nvidia•com>, Jiri Pirko <jiri@nvidia•com>
Subject: Re: [PATCH net-next V5 07/11] devlink: Extend devlink rate API with traffic classes bandwidth management
Date: Fri, 6 Dec 2024 18:10:56 -0800	[thread overview]
Message-ID: <20241206181056.3d323c0e@kernel.org> (raw)
In-Reply-To: <20241204220931.254964-8-tariqt@nvidia.com>

On Thu, 5 Dec 2024 00:09:27 +0200 Tariq Toukan wrote:
> +          min: 0
> +          max: 100

Are full percentage points sufficient granularity?

> +	if (!tb[DEVLINK_ATTR_RATE_TC_INDEX]) {

NL_SET_ERR_ATTR_MISS()

Please limit the string messages where error can be expressed in
machine readable form.

> +		NL_SET_ERR_MSG(extack, "Traffic class index is expected");
> +		return -EINVAL;
> +	}
> +
> +	tc_index = nla_get_u8(tb[DEVLINK_ATTR_RATE_TC_INDEX]);
> +
> +	if (tc_index >= IEEE_8021QAZ_MAX_TCS) {

This can't be enforced by the policy?

> +		NL_SET_ERR_MSG_FMT(extack,
> +				   "Provided traffic class index (%u) exceeds the maximum allowed value (%u)",
> +				   tc_index, IEEE_8021QAZ_MAX_TCS - 1);
> +		return -EINVAL;
> +	}
> +
> +	if (!tb[DEVLINK_ATTR_RATE_TC_BW]) {
> +		NL_SET_ERR_MSG(extack, "Traffic class bandwidth is expected");
> +		return -EINVAL;
> +	}
> +
> +	if (test_and_set_bit(tc_index, bitmap)) {
> +		NL_SET_ERR_MSG(extack, "Duplicate traffic class index specified");

always try to point to attr that caused the issue

> +		return -EINVAL;
> +	}
-- 
pw-bot: cr

  reply	other threads:[~2024-12-07  2:10 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 22:09 [PATCH net-next V5 00/11] net/mlx5: ConnectX-8 SW Steering + Rate management on traffic classes Tariq Toukan
2024-12-04 22:09 ` [PATCH mlx5-next V5 01/11] net/mlx5: ifc: Reorganize mlx5_ifc_flow_table_context_bits Tariq Toukan
2024-12-04 22:09 ` [PATCH mlx5-next V5 02/11] net/mlx5: Add ConnectX-8 device to ifc Tariq Toukan
2024-12-04 22:09 ` [PATCH mlx5-next V5 03/11] net/mlx5: Add support for new scheduling elements Tariq Toukan
2024-12-04 22:09 ` [PATCH mlx5-next V5 04/11] net/mlx5: qos: Add ifc support for cross-esw scheduling Tariq Toukan
2024-12-04 22:09 ` [PATCH net-next V5 05/11] net/mlx5: DR, Expand SWS STE callbacks and consolidate common structs Tariq Toukan
2024-12-04 22:09 ` [PATCH net-next V5 06/11] net/mlx5: DR, Add support for ConnectX-8 steering Tariq Toukan
2024-12-04 22:09 ` [PATCH net-next V5 07/11] devlink: Extend devlink rate API with traffic classes bandwidth management Tariq Toukan
2024-12-07  2:10   ` Jakub Kicinski [this message]
2024-12-09 21:03     ` Tariq Toukan
2024-12-09 21:27       ` Jakub Kicinski
2025-01-20 11:55         ` Carolina Jubran
2025-01-20 18:14           ` Jakub Kicinski
2025-01-21 12:36             ` Carolina Jubran
2025-01-22 12:48               ` Carolina Jubran
2025-01-22 14:30                 ` Jakub Kicinski
2025-02-05  6:22                   ` Tariq Toukan
2025-02-05  6:56                     ` Gal Pressman
2025-02-05  8:02                       ` Tariq Toukan
2024-12-04 22:09 ` [PATCH net-next V5 08/11] net/mlx5: Add no-op implementation for setting tc-bw on rate objects Tariq Toukan
2024-12-04 22:09 ` [PATCH net-next V5 09/11] net/mlx5: Add support for setting tc-bw on nodes Tariq Toukan
2024-12-04 22:09 ` [PATCH net-next V5 10/11] net/mlx5: Add traffic class scheduling support for vport QoS Tariq Toukan
2024-12-04 22:09 ` [PATCH net-next V5 11/11] net/mlx5: Manage TC arbiter nodes and implement full support for tc-bw Tariq Toukan
2024-12-05  9:23 ` [PATCH net-next V5 00/11] net/mlx5: ConnectX-8 SW Steering + Rate management on traffic classes Leon Romanovsky
2024-12-07  2:13 ` Jakub Kicinski
2024-12-09 19:32   ` Tariq Toukan
2024-12-09 21:41     ` Jakub Kicinski
2024-12-11  9:49       ` Cosmin Ratiu
2024-12-12  1:49         ` Jakub Kicinski
2024-12-13 13:42           ` Cosmin Ratiu
2024-12-17  5:45             ` Jakub Kicinski
2024-12-17 15:14               ` Cosmin Ratiu

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=20241206181056.3d323c0e@kernel.org \
    --to=kuba@kernel$(echo .)org \
    --cc=andrew+netdev@lunn$(echo .)ch \
    --cc=cjubran@nvidia$(echo .)com \
    --cc=cratiu@nvidia$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=gal@nvidia$(echo .)com \
    --cc=jiri@nvidia$(echo .)com \
    --cc=leonro@nvidia$(echo .)com \
    --cc=linux-rdma@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=saeedm@nvidia$(echo .)com \
    --cc=tariqt@nvidia$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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