From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Daniel Machon <daniel.machon@microchip.com>,
Tariq Toukan <tariqt@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
netdev@vger.kernel.org, Saeed Mahameed <saeedm@nvidia.com>,
Gal Pressman <gal@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>,
cjubran@nvidia.com, cratiu@nvidia.com
Subject: Re: [PATCH net-next 01/15] net/mlx5: Refactor QoS group scheduling element creation
Date: Mon, 14 Oct 2024 23:34:59 +0300 [thread overview]
Message-ID: <eb8df6f1-7b16-4682-b6ef-06a5df133eb0@gmail.com> (raw)
In-Reply-To: <20241014085446.gjlhbj377nadis55@DEN-DL-M70577>
On 14/10/2024 11:54, Daniel Machon wrote:
> Hi,
>
>> From: Carolina Jubran <cjubran@nvidia.com>
>>
>> Introduce `esw_qos_create_group_sched_elem` to handle the creation of
>> group scheduling elements for E-Switch QoS, Transmit Scheduling
>> Arbiter (TSAR).
>>
>> This reduces duplication and simplifies code for TSAR setup.
>>
>> Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
>> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
>> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
>> ---
...
>> @@ -496,21 +523,10 @@ static void __esw_qos_free_rate_group(struct mlx5_esw_rate_group *group)
>> static struct mlx5_esw_rate_group *
>> __esw_qos_create_rate_group(struct mlx5_eswitch *esw, struct netlink_ext_ack *extack)
>> {
>> - u32 tsar_ctx[MLX5_ST_SZ_DW(scheduling_context)] = {};
>> struct mlx5_esw_rate_group *group;
>> - int tsar_ix, err;
>> - void *attr;
>> + u32 tsar_ix, err;
>>
>> - MLX5_SET(scheduling_context, tsar_ctx, element_type,
>> - SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR);
>> - MLX5_SET(scheduling_context, tsar_ctx, parent_element_id,
>> - esw->qos.root_tsar_ix);
>> - attr = MLX5_ADDR_OF(scheduling_context, tsar_ctx, element_attributes);
>> - MLX5_SET(tsar_element, attr, tsar_type, TSAR_ELEMENT_TSAR_TYPE_DWRR);
>> - err = mlx5_create_scheduling_element_cmd(esw->dev,
>> - SCHEDULING_HIERARCHY_E_SWITCH,
>> - tsar_ctx,
>> - &tsar_ix);
>> + err = esw_qos_create_group_sched_elem(esw->dev, esw->qos.root_tsar_ix, &tsar_ix);
>
> 'err' is now u32 and esw_qos_create_group_sched_elem returns an int -
> is this intentional? the error check should still work though.
>
will fix.
>
>> if (err) {
>> NL_SET_ERR_MSG_MOD(extack, "E-Switch create TSAR for group failed");
>> return ERR_PTR(err);
>> @@ -591,32 +607,13 @@ static int __esw_qos_destroy_rate_group(struct mlx5_esw_rate_group *group,
>>
>> static int esw_qos_create(struct mlx5_eswitch *esw, struct netlink_ext_ack *extack)
>> {
>> - u32 tsar_ctx[MLX5_ST_SZ_DW(scheduling_context)] = {};
>> struct mlx5_core_dev *dev = esw->dev;
>> - void *attr;
>> int err;
>>
>> if (!MLX5_CAP_GEN(dev, qos) || !MLX5_CAP_QOS(dev, esw_scheduling))
>> return -EOPNOTSUPP;
>>
>> - if (!mlx5_qos_element_type_supported(dev,
>> - SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR,
>> - SCHEDULING_HIERARCHY_E_SWITCH) ||
>> - !mlx5_qos_tsar_type_supported(dev,
>> - TSAR_ELEMENT_TSAR_TYPE_DWRR,
>> - SCHEDULING_HIERARCHY_E_SWITCH))
>> - return -EOPNOTSUPP;
>> -
>> - MLX5_SET(scheduling_context, tsar_ctx, element_type,
>> - SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR);
>> -
>> - attr = MLX5_ADDR_OF(scheduling_context, tsar_ctx, element_attributes);
>> - MLX5_SET(tsar_element, attr, tsar_type, TSAR_ELEMENT_TSAR_TYPE_DWRR);
>> -
>> - err = mlx5_create_scheduling_element_cmd(dev,
>> - SCHEDULING_HIERARCHY_E_SWITCH,
>> - tsar_ctx,
>> - &esw->qos.root_tsar_ix);
>> + err = esw_qos_create_group_sched_elem(esw->dev, 0, &esw->qos.root_tsar_ix);
>
> Same here.
err is int here.
>
>> if (err) {
>> esw_warn(dev, "E-Switch create root TSAR failed (%d)\n", err);
>> return err;
>> --
>> 2.44.0
>>
>>
>
Thanks for your comments.
next prev parent reply other threads:[~2024-10-14 20:35 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-13 6:45 [PATCH net-next 00/15] net/mlx5: Refactor esw QoS to support generalized operations Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 01/15] net/mlx5: Refactor QoS group scheduling element creation Tariq Toukan
2024-10-14 8:54 ` Daniel Machon
2024-10-14 20:34 ` Tariq Toukan [this message]
2024-10-13 6:45 ` [PATCH net-next 02/15] net/mlx5: Introduce node type to rate group structure Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 03/15] net/mlx5: Add parent group support in " Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 04/15] net/mlx5: Restrict domain list insertion to root TSAR ancestors Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 05/15] net/mlx5: Rename vport QoS group reference to parent Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 06/15] net/mlx5: Introduce node struct and rename group terminology to node Tariq Toukan
2024-10-14 9:17 ` Simon Horman
2024-10-14 20:44 ` Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 07/15] net/mlx5: Refactor vport scheduling element creation function Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 08/15] net/mlx5: Refactor vport QoS to use scheduling node structure Tariq Toukan
2024-10-14 9:33 ` Simon Horman
2024-10-14 20:47 ` Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 09/15] net/mlx5: Remove vport QoS enabled flag Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 10/15] net/mlx5: Simplify QoS scheduling element configuration Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 11/15] net/mlx5: Generalize QoS operations for nodes and vports Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 12/15] net/mlx5: Add sync reset drop mode support Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 13/15] net/mlx5: Only create VEPA flow table when in VEPA mode Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 14/15] net/mlx5: fs, rename packet reformat struct member action Tariq Toukan
2024-10-13 6:45 ` [PATCH net-next 15/15] net/mlx5: fs, rename modify header " Tariq Toukan
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=eb8df6f1-7b16-4682-b6ef-06a5df133eb0@gmail.com \
--to=ttoukan.linux@gmail.com \
--cc=cjubran@nvidia.com \
--cc=cratiu@nvidia.com \
--cc=daniel.machon@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=leonro@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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).