Article View: linux.kernel.netdev
Article #21600Re: [PATCH net-next V2 5/5] net/mlx5: LAG, enable LAG over functions that do not represent a physical port
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 08:32
Date: Tue, 24 Nov 2026 08:32
198 lines
15579 bytes
15579 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 2
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] mlx5_lag_add_mdev() now lets any VF/SF that passes
mlx5_virt_lag_is_supported() into the LAG, and nothing caps how many…
- [Medium] net/mlx5: LAG, empty debugfs member list in members_show() for
virt_lag
- [Low] For a virt LAG, vport speed aggregation does nothing at all.
- [Low] The commit message does not mention that the exported
mlx5_lag_is_mpesw() changes meaning.
--
net/mlx5: LAG, enable LAG over functions that do not represent a physical port
This patch lets VF/SF functions that sit behind a multi_uplink_eswitch
(num_lag_ports < 2) join a LAG, using mlx5_virt_lag_is_supported() to
detect them. Such members are not marked as ports. They do not register
the PORT_CHANGE, netdev or multipath FIB notifiers, and they do not add
netdevs to the LAG.
The patch also widens mlx5_lag_get_filter() and mlx5_lag_is_mpesw() for
virt LAG, makes mlx5_lag_get_num_ports() return at least 1, and stops
RDMA from assigning a TX port affinity for these functions.
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
> index 193fbe47fef15..2cd2319f93189 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
[ ... ]
> @@ -2398,7 +2404,7 @@ int mlx5_ldev_add_mdev(struct mlx5_lag *ldev,
> fn->group_id = group_id;
> dev->priv.lag = ldev;
>
> - if (group_id)
> + if (group_id || ldev->virt_lag)
> return 0;
>
> xa_set_mark(&ldev->fns, idx, MLX5_LAG_XA_MARK_PORT);
[Severity: Medium]
Does this early return also leave the lag/members debugfs file empty
for every virt LAG device?
mlx5_lag_add_mdev() now lets virt-LAG capable functions through. On
success it calls mlx5_ldev_add_debugfs(dev), which creates the lag
directory, including the members file.
members_show() in lag/debugfs.c lists the members with:
mlx5_ldev_for_each(i, 0, ldev)
seq_printf(file, "%s\n",
dev_name(mlx5_lag_fn(ldev, i)->dev->device));
mlx5_ldev_for_each() uses MLX5_LAG_FILTER_PORTS, so
mlx5_get_next_lag_func() only walks entries marked with
MLX5_LAG_XA_MARK_PORT. A virt-LAG member returns here before
xa_set_mark() runs, so no entry in ldev->fns carries the mark.
Reading lag/members on such a device then always prints nothing, even
when the LAG has members.
This patch already switched mlx5_lag_get_filter() to
MLX5_LAG_FILTER_ALL for virt LAG because its members are not marked
as ports. Should members_show() use the same per-device filter, or
MLX5_LAG_FILTER_ALL when ldev->virt_lag is set, so the file reports
the real members? Or is the members file not meant to exist for a
virt LAG?
[Severity: Low]
Because of this early return for virt_lag, no virt-LAG member ever gets
MLX5_LAG_XA_MARK_PORT or the PORT_CHANGE notifier. Does that leave vport
speed aggregation doing nothing for a virt LAG?
mlx5_lag_enable_mpesw() calls mlx5_lag_shared_fdb_create() with
MLX5_LAG_FILTER_ALL, and that function then does:
if (filter == MLX5_LAG_FILTER_PORTS || filter == MLX5_LAG_FILTER_ALL)
mlx5_lag_set_vports_agg_speed(ldev);
mlx5_lag_set_vports_agg_speed(), mlx5_lag_get_devices_oper_speed() and
mlx5_lag_get_devices_max_speed() all iterate with mlx5_ldev_for_each(),
which only visits PORT-marked entries. For a virt LAG the summed speed
is 0, and the loop that calls mlx5_lag_modify_device_vports_speed() runs
zero times.
The skipped notifier, mlx5_lag_mpesw_port_change_event(), is the only
place that queues speed_update_work. So nothing would refresh the speed
later either.
Other virt-LAG paths in this series were moved to MLX5_LAG_FILTER_ALL
(for example mlx5_lag_get_devcom_comp()). If speed aggregation is not
meant to apply to virt LAG, should mlx5_lag_shared_fdb_create() skip the
call explicitly? If it is meant to apply, should the speed helpers and
the refresh trigger cover all members?
> @@ -2547,7 +2553,7 @@ void mlx5_lag_add_mdev(struct mlx5_core_dev *dev)
> {
> int err;
>
> - if (!mlx5_lag_is_supported(dev))
> + if (!mlx5_lag_is_supported(dev) && !mlx5_virt_lag_is_supported(dev))
> return;
>
> if (mlx5_lag_register_hca_devcom_comp(dev))
[Severity: Medium]
Can the retry loop below this check spin forever once a virt LAG has 255
members?
mlx5_lag_add_mdev() gives up only on -EOPNOTSUPP:
if (err == -EOPNOTSUPP) {
mlx5_lag_unregister_hca_devcom_comp(dev);
return;
}
if (err) {
msleep(100);
goto recheck;
}
The devcom match key comes from mlx5_query_nic_sw_system_image_guid().
It is the system image GUID plus the load_balance_id and VF/SF flag
bytes. So every virt-LAG capable SF (or VF) of the same NIC in the same
netns would join the same ldev through __mlx5_lag_dev_add_mdev().
mlx5_ldev_add_mdev() allocates the slot with:
err = xa_alloc(&ldev->fns, &idx, fn, XA_LIMIT(0, U8_MAX - 1),
GFP_KERNEL);
After 255 members this returns -EBUSY, and __mlx5_lag_dev_add_mdev()
passes it back unchanged. This happens when MPESW is not yet active;
otherwise the late-joiner -EOPNOTSUPP check returns first. The xarray
stays full between iterations, so mlx5_load() for the 256th function
would sleep and retry until some other member unloads.
An earlier patch in this series ("net/mlx5: E-switch, add match-metadata
allocator for nested VF/SF eswitches") already mentions the 0-254 slot
limit from this xa_alloc(). Before this patch, only vport_group_manager
PFs with 2..MLX5_MAX_PORTS lag ports reached this path, so the limit
could not be hit.
Should a permanent capacity error end the LAG join the same way
-EOPNOTSUPP does, instead of being retried like a transient error?
[ ... ]
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
> index 2d3e61541d8a1..0ef2d13d00968 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
> @@ -336,7 +336,7 @@ bool mlx5_lag_is_mpesw(struct mlx5_core_dev *dev)
> struct mlx5_lag *ldev = mlx5_lag_dev(dev);
>
> return ldev && ldev->mode == MLX5_LAG_MODE_MPESW &&
> - __mlx5_lag_dev_is_port(ldev, dev);
> + (ldev->virt_lag || __mlx5_lag_dev_is_port(ldev, dev));
> }
> EXPORT_SYMBOL(mlx5_lag_is_mpesw);
[Severity: Low]
This isn't a bug, but the commit message does not say that the exported
mlx5_lag_is_mpesw() now returns true for every virt-LAG member, not only
for port-marked ones.
It also does not mention the change in mlx5_lag_get_filter():
if (fn && (fn->group_id || ldev->virt_lag))
return MLX5_LAG_FILTER_ALL;
With this change, mlx5_lag_get_dev_seq(), mlx5_lag_get_next_peer_mdev()
and the related helpers walk all members of a virt LAG.
Several places call mlx5_lag_is_mpesw():
- eswitch_offloads.c (uplink destination type)
- en_tc.c
- en/tc_tun.c
- ib_rep.c
- a devlink parameter getter in eswitch.c, which reports the value to
user space
Their behavior for VF/SF functions now changes. Could the commit message
describe these two changes?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120075959.2533702-1-tariqt%40nvidia.com
Technical Details
Message-ID:
<179550917403.3135.6078772385370645877@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370108-linux-kernel-netdev=dewy.ruReferences:
<20261120075959.2533702-6-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!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370108-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next V2 5/5] net/mlx5: LAG, enable LAG over functions that do not represent a physical port Date: Tue, 24 Nov 2026 08:32:54 +0000 Organization: Usenet Network Message-ID: <179550917403.3135.6078772385370645877@kernel.org> References: <20261120075959.2533702-6-tariqt@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="4089182"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Wg3ZBvMKHq89wzH8ev/fAkviO7U= sha256:DK30oDaOYamfhFD4/J4kygJMxVDeNqhi52zD5A+Pkks= sha1:nKKhz66JK6puQBfDb+kvxIEZtv8= sha256:4da/m/sW7UhgqWEqxVCufu9tWrsNbAM6zJbzlZ8hOGo= 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 2202A125DE5; Tue, 24 Nov 2026 11:33:20 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 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, URIBL_BLOCKED=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 eYuHtbvVxcOM; Tue, 24 Nov 2026 11:33:16 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370108-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id ADB9F125DE3; Tue, 24 Nov 2026 11:33:07 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id D07EB365CE; Tue, 24 Nov 2026 08:32:56 +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=1795509176; b=TRGIqd/YMAQLYnby5VZ09syoxJHwVkUrBxKwyNz+k4bTvyebDQIhMKCWb80AVKrx4fUu 6XlLtZFM8hcEPpbcXKBz6O1Ua1bqDzC8Nq9rfgyS6MopbwRx4JE4rBDuqLbsexBXc3p8I IyUGnWyi6Gp9D+jiDwYlW3jPDcD+ugifdaMW7xFzRBNaHLTO17eBibXJeIvI6N2NzZ5Yq 4lDenRhcLGJ+XW7ZaIXlln6SFlsvQ5Yz8nXrBAShF2ykV+bHnJXrVgFmRpbSi9o2cXfMT kFaNVoV7jXSvaC0wmMEqOno/BEK0CP4Sk/+vRAASkv3G68R/Dfx6mv2em3O0uwsjOew== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795509176; 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=HHCOhh1scpjZ1mmCtu+F0vsYxG67SpGIkKK48e5engo=; b=jxyYKqUv92vsrrXHpkS6Lj32eeJp9vhNOLOEl5MSZpR2IBlAPU8cvrpKBrGIs6ktcwVj y3GdCCV8AZ+UdwRES+CoLDdWhnjB7TviJwoi7xLm1u72M733+xblEPtWfW1dqVrSJ8SyF CckfZo7LO+DRJEHX7NwQeb6z+OA/iUC7ywp1wCZlTafLdfz5TDEglq2zewqm/ZoPRGwfK A0BN9HU2kx0Q75nqViMhcUzy9+9paloyenS0FHGLW76IfSdAd9Iw4DBkA/OzKuvcsEv3e KlHaSc3VPomMOV1pYCpGTaeDRXldZNhaZL2/Z4EUqjTUnbVBbxZsfXa7hFyuVk1R6yg== 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=me2h9mcx; 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 A8F02606A686; Tue, 24 Nov 2026 08:32:56 +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=me2h9mcx 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=1795509175; b=0dps5U9IIsmUJpOGSCounQECGaQvRSbj6hkIDlRPjRI5Uf31Ho08J9f7Mr0PJJzBGgF2 aZgXC+93Af+7iuAp0i4Zr/ACKPqFok2BVXC/rlyWxnGqRK9xK121rpI9D1HCGP4Siyj8K sr23VvFHyTwUbhqyLNyprf+HK0UPR1pQgud0Zmefvvoqh9b8iEwB6EU2KoRL7Wnki3kdj ofP64NWlriBD/vic1l9NAd3VMNnIr2ZIXf1ofdprV3JGGOjgB9lQOAEo4xNMXPQhqSzM5 pF1aX6FRRnQKotbMbM3gtV3lKaMjArBa/NTfgpm+Dd9aXc5Mqig5/X2Z5XmqcHqYU9A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795509175; 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=HHCOhh1scpjZ1mmCtu+F0vsYxG67SpGIkKK48e5engo=; b=QN0BOdvBMLrYPht8yGPRAVmTxv6VG+rPlrx4T2t0ZK/n4fZXFpnUOfVb5TknAVrCmsJN vtBkyopidfkSVONtzvwdd8Q3jqPjDJ4Xwzcvrk01c8cWMgf7HEqB1g3v9juKIwIDjawIp QzQ/Igv/ClgyuXtv+UnOUrxJ/2nOslxAtPx5A14iCiPK3N6VDYmCSQy/iX1RYSuHAjSJ2 fhATsLT9mGeC58vvT2lby3U+f+p04XR4bVnmSSYresx9S4WZVn+eZOV03QYDIMqcvLKW2 Xl5Z+otLy4wJdQeGLcxFzHpEkclcADJ4W+brJEPlRlEQlMyYIL0Awqv9hojDXqv7GYA== 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=me2h9mcx; 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 A46DF606A32C; Tue, 24 Nov 2026 08:32:55 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7575F1F000D4; Tue, 24 Nov 2026 08:32:54 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795509175; bh=HHCOhh1scpjZ1mmCtu+F0vsYxG67SpGIkKK48e5engo=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=me2h9mcxlMluavCfFcLHD5egTnJzc96IWSbdZ+m5pxTJ+gSS58RvAC+OjU+99sPmU /VP9LOCEPbKohkBza2HTesoA3lH/HYomhua0E0KlzS7Qz03Iitltwlm65Zzpp4ICH2 DUvXePmh3kTsATBWstTlvo1igCmeCuTlhH2LZGvgRB7/e8owj96o93KiDRn6Yty6nn ao3WvDFVyEAXWwh/oUCdJ9ibF1OJxm9kkAEwcxEvFqRJJIMsBo6p0mJ+lXCMVZlbcK lwgS7C48J1XPTAghOpWNgscRHCVuzpFfVlHPK/bCiqybTtZ0GtCXJg2vRkoTAwxjhj x6NWjhIwPLTDw== 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-6-tariqt@nvidia.com> X-sashiko-severity: Medium 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