netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Roi Dayan <roid@nvidia.com>, Vlad Buslov <vladbu@nvidia.com>
Subject: [net-next 15/15] net/mlx5: Bridge, Only handle registered netdev bridge events
Date: Mon,  7 Aug 2023 10:56:42 -0700	[thread overview]
Message-ID: <20230807175642.20834-16-saeed@kernel.org> (raw)
In-Reply-To: <20230807175642.20834-1-saeed@kernel.org>

From: Roi Dayan <roid@nvidia.com>

Don't handle bridge events for a netdev that doesn't belong to
an eswitch that registered for bridge events.

Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
index 560800246573..0fef853eab62 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
@@ -77,6 +77,10 @@ mlx5_esw_bridge_rep_vport_num_vhca_id_get(struct net_device *dev, struct mlx5_es
 		return NULL;
 
 	priv = netdev_priv(dev);
+
+	if (!priv->mdev->priv.eswitch->br_offloads)
+		return NULL;
+
 	rpriv = priv->ppriv;
 	*vport_num = rpriv->rep->vport;
 	*esw_owner_vhca_id = MLX5_CAP_GEN(priv->mdev, vhca_id);
-- 
2.41.0


      parent reply	other threads:[~2023-08-07 17:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 17:56 [pull request][net-next 00/15] mlx5 updates 2023-08-07 Saeed Mahameed
2023-08-07 17:56 ` [net-next 01/15] net/mlx5: Track the current number of completion EQs Saeed Mahameed
2023-08-08 23:40   ` patchwork-bot+netdevbpf
2023-08-07 17:56 ` [net-next 02/15] net/mlx5: Refactor completion IRQ request/release API Saeed Mahameed
2023-08-07 17:56 ` [net-next 03/15] net/mlx5: Use xarray to store and manage completion IRQs Saeed Mahameed
2023-08-07 17:56 ` [net-next 04/15] net/mlx5: Refactor completion IRQ request/release handlers in EQ layer Saeed Mahameed
2023-08-07 17:56 ` [net-next 05/15] net/mlx5: Use xarray to store and manage completion EQs Saeed Mahameed
2023-08-07 17:56 ` [net-next 06/15] net/mlx5: Implement single completion EQ create/destroy methods Saeed Mahameed
2023-08-07 17:56 ` [net-next 07/15] net/mlx5: Introduce mlx5_cpumask_default_spread Saeed Mahameed
2023-08-07 17:56 ` [net-next 08/15] net/mlx5: Add IRQ vector to CPU lookup function Saeed Mahameed
2023-08-07 17:56 ` [net-next 09/15] net/mlx5: Rename mlx5_comp_vectors_count() to mlx5_comp_vectors_max() Saeed Mahameed
2023-08-07 17:56 ` [net-next 10/15] net/mlx5: Handle SF IRQ request in the absence of SF IRQ pool Saeed Mahameed
2023-08-07 17:56 ` [net-next 11/15] net/mlx5: Allocate completion EQs dynamically Saeed Mahameed
2023-08-07 17:56 ` [net-next 12/15] net/mlx5: remove many unnecessary NULL values Saeed Mahameed
2023-08-07 17:56 ` [net-next 13/15] net/mlx5: Fix typo reminder -> remainder Saeed Mahameed
2023-08-07 17:56 ` [net-next 14/15] net/mlx5: E-Switch, Remove redundant arg ignore_flow_lvl Saeed Mahameed
2023-08-07 17:56 ` Saeed Mahameed [this message]

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=20230807175642.20834-16-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=roid@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=vladbu@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).