From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Gal Pressman <gal@nvidia.com>, Mark Bloch <mbloch@nvidia.com>,
Moshe Shemesh <moshe@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org,
Carolina Jubran <cjubran@nvidia.com>
Subject: Re: [PATCH net 6/6] net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices
Date: Tue, 11 Mar 2025 09:08:03 +0100 [thread overview]
Message-ID: <Z8/vY+fEb/CeDwtw@mev-dev.igk.intel.com> (raw)
In-Reply-To: <1741644104-97767-7-git-send-email-tariqt@nvidia.com>
On Tue, Mar 11, 2025 at 12:01:44AM +0200, Tariq Toukan wrote:
> From: Carolina Jubran <cjubran@nvidia.com>
>
> mlx5_eswitch_get_vepa returns -EPERM if the device lacks
> eswitch_manager capability, blocking mlx5e_bridge_getlink from
> retrieving VEPA mode. Since mlx5e_bridge_getlink implements
> ndo_bridge_getlink, returning -EPERM causes bridge link show to fail
> instead of skipping devices without this capability.
>
> To avoid this, return -EOPNOTSUPP from mlx5e_bridge_getlink when
> mlx5_eswitch_get_vepa fails, ensuring the command continues processing
> other devices while ignoring those without the necessary capability.
>
> Fixes: 4b89251de024 ("net/mlx5: Support ndo bridge_setlink and getlink")
> Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
> Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index a814b63ed97e..8fcaee381b0e 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -5132,11 +5132,9 @@ static int mlx5e_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
> struct mlx5e_priv *priv = netdev_priv(dev);
> struct mlx5_core_dev *mdev = priv->mdev;
> u8 mode, setting;
> - int err;
>
> - err = mlx5_eswitch_get_vepa(mdev->priv.eswitch, &setting);
> - if (err)
> - return err;
> + if (mlx5_eswitch_get_vepa(mdev->priv.eswitch, &setting))
> + return -EOPNOTSUPP;
> mode = setting ? BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB;
> return ndo_dflt_bridge_getlink(skb, pid, seq, dev,
> mode,
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> --
> 2.31.1
next prev parent reply other threads:[~2025-03-11 8:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 22:01 [PATCH net 0/6] mlx5 misc fixes 2025-03-10 Tariq Toukan
2025-03-10 22:01 ` [PATCH net 1/6] net/mlx5: DR, use the right action structs for STEv3 Tariq Toukan
2025-03-10 22:01 ` [PATCH net 2/6] net/mlx5: HWS, Rightsize bwc matcher priority Tariq Toukan
2025-03-10 22:01 ` [PATCH net 3/6] net/mlx5: Fix incorrect IRQ pool usage when releasing IRQs Tariq Toukan
2025-03-11 7:38 ` Michal Swiatkowski
2025-03-10 22:01 ` [PATCH net 4/6] net/mlx5: Lag, Check shared fdb before creating MultiPort E-Switch Tariq Toukan
2025-03-11 7:41 ` Michal Swiatkowski
2025-03-10 22:01 ` [PATCH net 5/6] net/mlx5: Bridge, fix the crash caused by LAG state check Tariq Toukan
2025-03-11 8:02 ` Michal Swiatkowski
2025-03-10 22:01 ` [PATCH net 6/6] net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices Tariq Toukan
2025-03-11 8:08 ` Michal Swiatkowski [this message]
2025-03-13 12:20 ` [PATCH net 0/6] mlx5 misc fixes 2025-03-10 patchwork-bot+netdevbpf
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=Z8/vY+fEb/CeDwtw@mev-dev.igk.intel.com \
--to=michal.swiatkowski@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=cjubran@nvidia.com \
--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=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@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).