]> git.ipfire.org Git - thirdparty/linux.git/commit
net/mlx5: Add net namespace support to devcom
authorShay Drory <shayd@nvidia.com>
Mon, 15 Sep 2025 12:41:09 +0000 (15:41 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Sep 2025 00:25:54 +0000 (17:25 -0700)
commit95f73447c269e196dc149bece65b2d83cdb42b08
tree052ae65f1362935c7393e0bb8f861d48930f31a3
parent5a977b5833b7a261bfa6094595ffa73c1071588c
net/mlx5: Add net namespace support to devcom

Extend the devcom framework to support namespace-aware components.

The existing devcom matching logic was based solely on numeric keys,
limiting its use to the global (init_net) scope or requiring clients to
ignore namespaces altogether, both of which are incorrect in
multi-namespace environments.

This patch introduces namespace support by allowing devcom clients to
provide a namespace match attribute. The devcom pairing mechanism is
updated to compare the namespace, enabling proper isolation and
interaction of components across different net namespaces.

With this change, components that require namespace aware pairing, such
as SD groups or LAG, can now work correctly in multi-namespace
scenarios. In particular, this opens the way to support hardware LAG
within a net namespace.

Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1757940070-618661-4-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c
drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.h
drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c