All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tariq Toukan" <tariqt@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next V2 4/5] net/mlx5e: Register eswitch-manager VF/SF self-port with switch-id
Date: Sat, 21 Nov 2026 08:02:30 +0000	[thread overview]
Message-ID: <sashiko-outbox-226815@kernel.org> (raw)
In-Reply-To: <20261120075959.2533702-5-tariqt@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] net/mlx5e: duplicated switch_id setup in
  mlx5e_devlink_port_register()
--

commit a4fbc34804738e4b1300b56b57462bb3c5135774
Author: Shay Drory <shayd@nvidia.com>

net/mlx5e: Register eswitch-manager VF/SF self-port with switch-id

This commit populates attrs.switch_id from the system image GUID when
registering the self-port of a non-PF eswitch manager function.

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c
> index 8818f65d1fbc4..79adb1ecc4506 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c
> @@ -63,6 +63,11 @@ int mlx5e_devlink_port_register(struct mlx5e_dev *mlx5e_dev,
>  		dl_port_index = mlx5_esw_vport_to_devlink_port_index(mdev,
>  								     MLX5_VPORT_UPLINK);
>  	} else {
> +		if (MLX5_ESWITCH_MANAGER(mdev)) {
> +			mlx5e_devlink_get_port_parent_id(mdev, &ppid);
> +			memcpy(attrs.switch_id.id, ppid.id, ppid.id_len);
> +			attrs.switch_id.id_len = ppid.id_len;
> +		}
>  		attrs.flavour = DEVLINK_PORT_FLAVOUR_VIRTUAL;
>  		dl_port_index = mlx5_esw_vport_to_devlink_port_index(mdev, 0);
>  	}

[Severity: Low]
This isn't a bug, but the mlx5_core_is_pf(mdev) branch right above already
contains this exact if (MLX5_ESWITCH_MANAGER(mdev)) block to populate
attrs.switch_id.  Could it be moved outside the if/else to avoid duplicating
it in both branches?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120075959.2533702-1-tariqt@nvidia.com?part=4

  reply	other threads:[~2026-11-21  8:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  7:59 [PATCH net-next V2 0/5] net/mlx5: LAG over VFs/SFs (virtual LAG) Tariq Toukan
2026-11-20  7:59 ` [PATCH net-next V2 1/5] net/mlx5: E-switch, add match-metadata allocator for nested VF/SF eswitches Tariq Toukan
2026-11-21  8:02   ` sashiko-bot
2026-11-20  7:59 ` [PATCH net-next V2 2/5] net/mlx5: E-switch, match master egress rule by vport metadata Tariq Toukan
2026-11-20  7:59 ` [PATCH net-next V2 3/5] net/mlx5: E-switch, drop master egress rule under a SW vport LAG Tariq Toukan
2026-11-20  7:59 ` [PATCH net-next V2 4/5] net/mlx5e: Register eswitch-manager VF/SF self-port with switch-id Tariq Toukan
2026-11-21  8:02   ` sashiko-bot [this message]
2026-11-20  7:59 ` [PATCH net-next V2 5/5] net/mlx5: LAG, enable LAG over functions that do not represent a physical port Tariq Toukan
2026-11-21  8:02   ` sashiko-bot
2026-11-21  8:02 ` [PATCH net-next V2 0/5] net/mlx5: LAG over VFs/SFs (virtual LAG) sashiko-bot

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=sashiko-outbox-226815@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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.