From: Simon Horman <horms@kernel.org>
To: 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 V2 09/15] net/mlx5: Remove vport QoS enabled flag
Date: Tue, 15 Oct 2024 12:04:07 +0100 [thread overview]
Message-ID: <20241015110407.GD569285@kernel.org> (raw)
In-Reply-To: <20241014205300.193519-10-tariqt@nvidia.com>
On Mon, Oct 14, 2024 at 11:52:54PM +0300, Tariq Toukan wrote:
> From: Carolina Jubran <cjubran@nvidia.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@nvidia.com>
> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.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 {
...
next prev parent reply other threads:[~2024-10-15 11:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 20:52 [PATCH net-next V2 00/15] net/mlx5: Refactor esw QoS to support generalized operations Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 01/15] net/mlx5: Refactor QoS group scheduling element creation Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 02/15] net/mlx5: Introduce node type to rate group structure Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 03/15] net/mlx5: Add parent group support in " Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 04/15] net/mlx5: Restrict domain list insertion to root TSAR ancestors Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 05/15] net/mlx5: Rename vport QoS group reference to parent Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 06/15] net/mlx5: Introduce node struct and rename group terminology to node Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 07/15] net/mlx5: Refactor vport scheduling element creation function Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 08/15] net/mlx5: Refactor vport QoS to use scheduling node structure Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 09/15] net/mlx5: Remove vport QoS enabled flag Tariq Toukan
2024-10-15 11:04 ` Simon Horman [this message]
2024-10-15 11:26 ` Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 10/15] net/mlx5: Simplify QoS scheduling element configuration Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 11/15] net/mlx5: Generalize QoS operations for nodes and vports Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 12/15] net/mlx5: Add sync reset drop mode support Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 13/15] net/mlx5: Only create VEPA flow table when in VEPA mode Tariq Toukan
2024-10-14 20:52 ` [PATCH net-next V2 14/15] net/mlx5: fs, rename packet reformat struct member action Tariq Toukan
2024-10-14 20:53 ` [PATCH net-next V2 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=20241015110407.GD569285@kernel.org \
--to=horms@kernel.org \
--cc=cjubran@nvidia.com \
--cc=cratiu@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.