diff options
author | Hadar Hen Zion <hadarh@mellanox.com> | 2013-01-30 23:07:07 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-31 17:48:47 (GMT) |
commit | 280fce1e3ef85ff7f90a9d7e8c8a0d71bbf5a9a4 (patch) | |
tree | f90e8fc37a4100effa770b5b302e641d4af6f95d /drivers/net | |
parent | 8258bd2713c3e42bc0e5664cbede0e07587c125f (diff) | |
download | linux-fsl-qoriq-280fce1e3ef85ff7f90a9d7e8c8a0d71bbf5a9a4.tar.xz |
net/mlx4_en: Block insertion of ethtool steering rules while the interface is down
Attaching steering rules while the interface is down is an invalid operation, block it.
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index f36c219..6f8044d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c @@ -1006,7 +1006,8 @@ static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, if ((cmd->cmd == ETHTOOL_GRXCLSRLCNT || cmd->cmd == ETHTOOL_GRXCLSRULE || cmd->cmd == ETHTOOL_GRXCLSRLALL) && - mdev->dev->caps.steering_mode != MLX4_STEERING_MODE_DEVICE_MANAGED) + (mdev->dev->caps.steering_mode != + MLX4_STEERING_MODE_DEVICE_MANAGED || !priv->port_up)) return -EINVAL; switch (cmd->cmd) { @@ -1042,7 +1043,8 @@ static int mlx4_en_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd) struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; - if (mdev->dev->caps.steering_mode != MLX4_STEERING_MODE_DEVICE_MANAGED) + if (mdev->dev->caps.steering_mode != + MLX4_STEERING_MODE_DEVICE_MANAGED || !priv->port_up) return -EINVAL; switch (cmd->cmd) { |