netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>, Mark Bloch <mbloch@nvidia.com>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, Gal Pressman <gal@nvidia.com>,
	Parav Pandit <parav@nvidia.com>, Shay Drory <shayd@nvidia.com>
Subject: Re: [PATCH net-next 4/4] net/mlx5: Lag, add net namespace support
Date: Fri, 12 Sep 2025 15:09:02 +0100	[thread overview]
Message-ID: <20250912140902.GC30363@horms.kernel.org> (raw)
In-Reply-To: <1757572267-601785-5-git-send-email-tariqt@nvidia.com>

On Thu, Sep 11, 2025 at 09:31:07AM +0300, Tariq Toukan wrote:
> From: Shay Drory <shayd@nvidia.com>
> 
> Update the LAG implementation to support net namespace isolation.
> 
> With recent changes to the devcom framework allowing namespace-aware
> matching, the LAG layer is updated to register devcom clients with the
> associated net namespace. This ensures that LAG formation only occurs
> between mlx5 interfaces that reside in the same namespace.
> 
> This change ensures that devices in different namespaces do not interfere
> with each other's LAG setup and behavior. For example, if two PCI PFs are
> in the same namespace, they are eligible to form a hardware LAG.
> 
> In addition, reload behavior for LAG is adjusted to handle namespace
> contexts appropriately.
> 
> Signed-off-by: Shay Drory <shayd@nvidia.com>
> Reviewed-by: Mark Bloch <mbloch@nvidia.com>
> Reviewed-by: Parav Pandit <parav@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/devlink.c |  5 -----
>  drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 14 +++++++++++---
>  drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h |  1 +
>  3 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> index a0b68321355a..bfa44414be82 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> @@ -204,11 +204,6 @@ static int mlx5_devlink_reload_down(struct devlink *devlink, bool netns_change,
>  		return 0;
>  	}
>  
> -	if (mlx5_lag_is_active(dev)) {
> -		NL_SET_ERR_MSG_MOD(extack, "reload is unsupported in Lag mode");
> -		return -EOPNOTSUPP;
> -	}
> -

Maybe I'm missing something obvious. But I think this could do with
some further commentary in the commit message. Or perhaps being a separate
patch.

>  	if (mlx5_core_is_mp_slave(dev)) {
>  		NL_SET_ERR_MSG_MOD(extack, "reload is unsupported for multi port slave");
>  		return -EOPNOTSUPP;

...

> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h
> index c2f256bb2bc2..4918eee2b3da 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h
> @@ -67,6 +67,7 @@ struct mlx5_lag {
>  	struct workqueue_struct   *wq;
>  	struct delayed_work       bond_work;
>  	struct notifier_block     nb;
> +	possible_net_t net;

nit: inconsistent indentation.

>  	struct lag_mp             lag_mp;
>  	struct mlx5_lag_port_sel  port_sel;
>  	/* Protect lag fields/state changes */
> -- 
> 2.31.1
> 
> 

  reply	other threads:[~2025-09-12 14:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-11  6:31 [PATCH net-next 0/4] net/mlx5: Refactor devcom and add net namespace support Tariq Toukan
2025-09-11  6:31 ` [PATCH net-next 1/4] net/mlx5: Refactor devcom to use match attributes Tariq Toukan
2025-09-12 14:11   ` Simon Horman
2025-09-15  9:08   ` Leon Romanovsky
2025-09-11  6:31 ` [PATCH net-next 2/4] net/mlx5: Lag, move devcom registration to LAG layer Tariq Toukan
2025-09-12 14:11   ` Simon Horman
2025-09-11  6:31 ` [PATCH net-next 3/4] net/mlx5: Add net namespace support to devcom Tariq Toukan
2025-09-12 14:11   ` Simon Horman
2025-09-11  6:31 ` [PATCH net-next 4/4] net/mlx5: Lag, add net namespace support Tariq Toukan
2025-09-12 14:09   ` Simon Horman [this message]
2025-09-13  1:52     ` Mark Bloch
2025-09-15  8:51       ` Simon Horman

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=20250912140902.GC30363@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parav@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=shayd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).