Article View: linux.kernel.netdev
Article #21598Re: [PATCH net-next V2 4/5] net/mlx5e: Register eswitch-manager VF/SF self-port with switch-id
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 08:32
Date: Tue, 24 Nov 2026 08:32
137 lines
13338 bytes
13338 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In mlx5e_devlink_port_register()
(drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c, new lines…
- [Low] The commit message says the self-port 'was always registered with
DEVLINK_PORT_FLAVOUR_VIRTUAL, which doesn't carries switch_id' (also a…
--
net/mlx5e: Register eswitch-manager VF/SF self-port with switch-id
This patch makes a non-PF function (VF or SF) that is an eswitch manager
register its self-port with a switch_id. The switch_id comes from the SW
system image GUID. As a result, the uplink netdev reports a
phys_switch_id and can be grouped with the representors it manages.
> A non-PF function's self-port (its own uplink netdev) was always
> registered with DEVLINK_PORT_FLAVOUR_VIRTUAL, which doesn't carries
> switch_id.
[Severity: Low]
Is this description accurate? In net/devlink/port.c, switch_port depends
only on whether a switch_id was supplied. The port flavour plays no part:
net/devlink/port.c:__devlink_port_attrs_set() {
...
if (attrs->switch_id.id_len) {
devlink_port->switch_port = true;
...
} else {
devlink_port->switch_port = false;
}
}
devlink_compat_switch_id_get() checks only switch_port. A VIRTUAL port
can carry a switch_id, and this patch relies on that: it keeps
DEVLINK_PORT_FLAVOUR_VIRTUAL and only fills attrs.switch_id.
The phys_switch_id was missing because mlx5e_devlink_port_register()
never filled attrs.switch_id for non-PF functions. The flavour was not
the cause.
The message also mentions only grouping with representors. Could it say
that the uplink netdev now passes netdev_port_same_parent_id() checks it
used to fail? Examples are tc_act_can_offload_mirred(),
tc_act_parse_mirred() and the check in en/tc_tun.c.
There is also a grammar slip: "doesn't carries" should be
"doesn't carry".
> 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;
> + }
[Severity: Low]
Is this switch_id unique to the nested eswitch? The value comes from
mlx5_query_nic_sw_system_image_guid(). That is the device-wide FW GUID
followed by capability-only bytes, with trailing zero bytes trimmed:
drivers/net/ethernet/mellanox/mlx5/core/vport.c:
static u8 mlx5_sw_guid_sf(const struct mlx5_core_dev *mdev)
{
return mlx5_core_is_sf(mdev) && mlx5_virt_lag_is_supported(mdev);
}
static u8 mlx5_sw_guid_vf(const struct mlx5_core_dev *mdev)
{
return mlx5_core_is_vf(mdev) && mlx5_virt_lag_is_supported(mdev);
}
mlx5_query_nic_sw_system_image_guid() {
...
for (i = 0; i < ARRAY_SIZE(mlx5_sw_guid_fields); i++) {
u8 val = mlx5_sw_guid_fields[i](mdev);
buf[(*len)++] = val;
if (val)
trim_len = *len;
}
*len = trim_len;
}
Commit c25049685e16 ("Distinguish VFs/SFs in the SW system image
GUID...") says a PF and its VFs/SFs share the same FW system image GUID.
It also says a VF/SF that cannot join a virt LAG "keeps its current key
and is still identified as the same HW as its PF". This leads to two
cases.
In the first case, a VF/SF eswitch manager lacks the virt-LAG caps
(multi_uplink_eswitch, lag_master, num_lag_ports < 2). It then gets
exactly the PF's switch_id. The PF uplink carries that same ID, and so
do the PF-eswitch PCI_VF/PCI_SF representors set up by
mlx5_esw_offloads_pf_vf_devlink_port_attrs_set(), including the
representor of this VF/SF itself.
In the second case, every virt-LAG-capable VF (or SF) eswitch manager on
one HCA gets the same ID, whether or not they share an FDB. That
includes a standalone late joiner that mlx5_esw_offloads_devcom_init()
refuses to pair.
After this patch, devlink_compat_switch_id_get() reports this ID as the
phys_switch_id of the VF/SF uplink netdev.
Documentation/networking/switchdev.rst says the switch ID must be unique
between switches on the same system.
The nested-eswitch representors already used this ID before the patch,
and the PF uplinks of one HCA already share a switch_id. The in-kernel
mlx5 TC forwarding path re-checks the real eswitch/LAG relationship in
mlx5e_is_valid_eswitch_fwd_dev(). What changes is that the uplink netdev
itself now reports the colliding ID.
Should this check also require mlx5_virt_lag_is_supported(), or the
nested-eswitch condition used elsewhere in the series, rather than only
MLX5_ESWITCH_MANAGER(mdev)? If not, should the limitation be documented?
> attrs.flavour = DEVLINK_PORT_FLAVOUR_VIRTUAL;
> dl_port_index = mlx5_esw_vport_to_devlink_port_index(mdev, 0);
> }
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120075959.2533702-1-tariqt%40nvidia.com
Technical Details
Message-ID:
<179550917191.3135.3268324102399128656@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370107-linux-kernel-netdev=dewy.ruReferences:
<20261120075959.2533702-5-tariqt@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370107-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next V2 4/5] net/mlx5e: Register eswitch-manager VF/SF self-port with switch-id Date: Tue, 24 Nov 2026 08:32:51 +0000 Organization: Usenet Network Message-ID: <179550917191.3135.3268324102399128656@kernel.org> References: <20261120075959.2533702-5-tariqt@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="4089086"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:cZx0EUYkDN5dMzO5CdbfcgcYeDk= sha256:gsamZghXssu7CDn3sXIj6HarVTI3jWzVjuql5N48VDI= sha1:CjY5d38O+yJpZb5OvNk1b5XaRSc= sha256:khXzsWMRx8ciV8ujTwX1xSkBDjFsk56VPT6TbTPrCC0= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 9D718125DD7; Tue, 24 Nov 2026 11:33:09 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VSZw0yg7MlKX; Tue, 24 Nov 2026 11:33:05 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-370107-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 0BA5B125DE3; Tue, 24 Nov 2026 11:32:56 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 05FE634CDA; Tue, 24 Nov 2026 08:32:55 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795509174; b=qZ6ka90/LzaBnaL2irg1kaBNbcmGFiY03oz55zT1Y5WvQT//WuoF14WyZXY91uDtGBkP Fq2gdLxgd6pLF8Y5jCKuds9qNT0dl3kTqwQdFLTiHFs71BGFyTRbo1NNyo8BCUw1IJlgj 6xdpRiT6ggrCSDbYYHntsZ41tmUMiyMGmGEBHjlOcjntTFf3K66Tcc42yZr3E85ho6XpE j5cV3ShqLAjcWahL49yE+FnEsIlQ8SKk1SQZkzIJ3wpM/yLTK+1hiFIsn+lUT7yVU/LV0 E9fGduN733rgCEV8AnKFpHxMyk6z2upiNAKC0DwMhuRBgI1GkLm+V4Ob7wQSPseNJ/Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795509174; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=/ItIR3u3IAZKinHI/Kt2n31M5TXyRHqKKC1RLcMClSA=; b=goWz3nGZBWOCv2O7Dm5teXxtb6NUbhtlTMsX2hru2wAo5zRaECTOXcdbDYWKdX9rLAf8 hNFWjrn8S2A3SdBdoIAyKt8dB13110EN2BwCjio7sYsklQF9lSIGcDfxcN+XcKgb8T/uH cKRbtGexZJvTmU4bZ8lDG0ZwPs7PPcHLbiDVDTgUI/BsTvna34RIjkub+FjOrOP0+ha2j jBJj6p9DPeLHVE9dolRmnT7Hmvo/odcpjDfdJTN4pjS+DJ1Ar0Gg4J1LaGYmTDfhFhAa8 57EERwmwz0zUoezGL8jiQDvYYJWMW24M+HVpdqVT5gA5pUUuPmjq6gUg5xrBCZMJxmQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="c4h94k0/"; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC3F2606A6A1; Tue, 24 Nov 2026 08:32:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=c4h94k0/ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795509173; b=gBT9XlqeXkl1A0WqwJXQn1rzunB79qn6CJBh4mgvEjUL76gYoMLw1upfoUpIKTfgOyML aKhB7aDxMNtjObHoqBBYrTWo1hR7iunIA+Pmp5jabv7DoMCBFdpve05XSsBQhzWSDtvvh tZ7jlglqicE1+bVrCy5G4u9fwg7lNZOcViGzSrmjfgreOC5UKQD9uN2q9r4ksNwVF95UY RT5nB5MissF82EVxdz9p+41fyKfPpVrqGXOhPVQfJj7Gy9tu3n93YHPB8FnnehfJgfMKz V165BhFoMutJC+kHpch1NSncPmzE8SHM9T4lx+PrmrtPHUKxN0V/bbr9rWN4l/hIRZw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795509173; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=/ItIR3u3IAZKinHI/Kt2n31M5TXyRHqKKC1RLcMClSA=; b=Nu+ti3ABpSoSycZGEcVqy4xJ9HMGZZzWUC9nGMUqIiudj0QOP4nE/E1J+edpl+q48Pr8 DagpjyJ7hjnKCeIHxXLecgKoqja7I+rhOjkvhdHtNf7vaolDEGkenwexVaksKDCfdSpOF OBB9KzEVtp7nNMDkNiS5swfrZscjJUNLfmErib0uo3prCRpJBDCrhQ3m7Dqnbqk358QZg dgcw1+N2jfibxfMb4lCKnTuoIOHGcHx9EjFR/rpDdw3HtahIVUqG3azeh/132M75bQAzv lkbaL2EVTMggulbhIW8eQjShsS/bC24UTRHns98dkUNmLc1Gp1fUvA+e34lB+jdDM+g== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="c4h94k0/"; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB387606A32C; Tue, 24 Nov 2026 08:32:53 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59C571F000EC; Tue, 24 Nov 2026 08:32:52 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795509173; bh=/ItIR3u3IAZKinHI/Kt2n31M5TXyRHqKKC1RLcMClSA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=c4h94k0/VEqZ/yHQFGSXTeM0S+IS7lYAX9Vot+uQdwyzFkPhpmLIKLkqCKO5ULBt9 8CwCBXJS2UfcYjylaPYW/9ayBp0GYH6IRiKkkM10z/eBnZ6OfQ66WupUaO7eQobc2L 32Rrdy+BThZmlkqMs8Cr4RBviDvICxEdbKo2AkkQLEY/yhFBssbVRTcEXOCD4zZU8b Jn/YiavN9jLZk+nCO/xK4K+7szupIi+ZzfiwdEpWX5Rnj8xvbBmOv8lNJD74VF+Yld RjGmyXTP4XFjH2hNdibo5kZhuFI0rY6lnlABJkAnHPCoBHPacMsR5Ddjm1QBq4+Mqt rwCH/d2hR17ZA== X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, agoldberger@nvidia.com, gal@nvidia.com, jgg@ziepe.ca, leon@kernel.org, linux-rdma@vger.kernel.org, mbloch@nvidia.com, moshe@nvidia.com, ohartoov@nvidia.com, saeedm@nvidia.com, shayd@nvidia.com X-In-Reply-To: <20261120075959.2533702-5-tariqt@nvidia.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list