Skip to content

Commit

Permalink
net/mlx5: Bridge, Only handle registered netdev bridge events
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Vlad Buslov <[email protected]>
Signed-off-by: Saeed Mahameed <[email protected]>
  • Loading branch information
roidayan authored and Saeed Mahameed committed Aug 7, 2023
1 parent d602be2 commit b56fb19
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b56fb19

Please sign in to comment.