net/mlx5e: Only support tx/rx pause setting for port owner
authorHuy Nguyen <huyn@mellanox.com>
Thu, 1 Aug 2019 16:10:19 +0000 (11:10 -0500)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 8 Aug 2019 20:01:18 +0000 (13:01 -0700)
Only support changing tx/rx pause frame setting if the net device
is the vport group manager.

Fixes: 3c2d18ef22df ("net/mlx5e: Support ethtool get/set_pauseparam")
Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

index 03bed714bac3f919675517b5bb759a1c7e9e2d6a..ee9fa0c2c8b988ec610b8e5e0ca5a3f341c77961 100644 (file)
@@ -1338,6 +1338,9 @@ int mlx5e_ethtool_set_pauseparam(struct mlx5e_priv *priv,
        struct mlx5_core_dev *mdev = priv->mdev;
        int err;
 
+       if (!MLX5_CAP_GEN(mdev, vport_group_manager))
+               return -EOPNOTSUPP;
+
        if (pauseparam->autoneg)
                return -EINVAL;