]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
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>
Fri, 21 Aug 2020 07:47:57 +0000 (09:47 +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 e69674d38f167378faf91bed815482dd8b7910ca..a3107d133b4047ed3b8112940d65661e7a020dff 100644 (file)
@@ -180,7 +180,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) {