net/mlx5e: Don't support phys switch id if not in switchdev mode
authorRoi Dayan <roid@mellanox.com>
Fri, 7 Aug 2020 02:05:42 +0000 (19:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Sep 2020 11:40:23 +0000 (13:40 +0200)
Support for phys switch id ndo added for representors and if
we do not have representors there is no need to support it.
Since each port return different switch id supporting this
block support for creating bond over PFs and attaching to bridge
in legacy mode.

This bug doesn't exist upstream as the code got refactored and the
netdev api is totally different.

Fixes: cb67b832921c ("net/mlx5e: Introduce SRIOV VF representors")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c

index 701624a63d2f4f62f8b080604e206a64107b5b79..1ab40d622ae1e5805c9db30b9d2cd3471c2f1e16 100644 (file)
@@ -198,7 +198,7 @@ int mlx5e_attr_get(struct net_device *dev, struct switchdev_attr *attr)
        struct mlx5_eswitch_rep *rep = rpriv->rep;
        struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
 
-       if (esw->mode == SRIOV_NONE)
+       if (esw->mode != SRIOV_OFFLOADS)
                return -EOPNOTSUPP;
 
        switch (attr->id) {