diff options
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c index 3e8d33605fe7..fa1a069e14e6 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | |||
@@ -378,8 +378,8 @@ static int mlx4_en_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
378 | ethtool_cmd_speed_set(cmd, priv->port_state.link_speed); | 378 | ethtool_cmd_speed_set(cmd, priv->port_state.link_speed); |
379 | cmd->duplex = DUPLEX_FULL; | 379 | cmd->duplex = DUPLEX_FULL; |
380 | } else { | 380 | } else { |
381 | ethtool_cmd_speed_set(cmd, -1); | 381 | ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN); |
382 | cmd->duplex = -1; | 382 | cmd->duplex = DUPLEX_UNKNOWN; |
383 | } | 383 | } |
384 | 384 | ||
385 | if (trans_type > 0 && trans_type <= 0xC) { | 385 | if (trans_type > 0 && trans_type <= 0xC) { |
@@ -564,7 +564,7 @@ static u32 mlx4_en_get_rxfh_indir_size(struct net_device *dev) | |||
564 | return priv->rx_ring_num; | 564 | return priv->rx_ring_num; |
565 | } | 565 | } |
566 | 566 | ||
567 | static int mlx4_en_get_rxfh_indir(struct net_device *dev, u32 *ring_index) | 567 | static int mlx4_en_get_rxfh(struct net_device *dev, u32 *ring_index, u8 *key) |
568 | { | 568 | { |
569 | struct mlx4_en_priv *priv = netdev_priv(dev); | 569 | struct mlx4_en_priv *priv = netdev_priv(dev); |
570 | struct mlx4_en_rss_map *rss_map = &priv->rss_map; | 570 | struct mlx4_en_rss_map *rss_map = &priv->rss_map; |
@@ -582,8 +582,8 @@ static int mlx4_en_get_rxfh_indir(struct net_device *dev, u32 *ring_index) | |||
582 | return err; | 582 | return err; |
583 | } | 583 | } |
584 | 584 | ||
585 | static int mlx4_en_set_rxfh_indir(struct net_device *dev, | 585 | static int mlx4_en_set_rxfh(struct net_device *dev, const u32 *ring_index, |
586 | const u32 *ring_index) | 586 | const u8 *key) |
587 | { | 587 | { |
588 | struct mlx4_en_priv *priv = netdev_priv(dev); | 588 | struct mlx4_en_priv *priv = netdev_priv(dev); |
589 | struct mlx4_en_dev *mdev = priv->mdev; | 589 | struct mlx4_en_dev *mdev = priv->mdev; |
@@ -925,13 +925,13 @@ static int mlx4_en_flow_replace(struct net_device *dev, | |||
925 | qpn = cmd->fs.ring_cookie & (EN_ETHTOOL_QP_ATTACH - 1); | 925 | qpn = cmd->fs.ring_cookie & (EN_ETHTOOL_QP_ATTACH - 1); |
926 | } else { | 926 | } else { |
927 | if (cmd->fs.ring_cookie >= priv->rx_ring_num) { | 927 | if (cmd->fs.ring_cookie >= priv->rx_ring_num) { |
928 | en_warn(priv, "rxnfc: RX ring (%llu) doesn't exist.\n", | 928 | en_warn(priv, "rxnfc: RX ring (%llu) doesn't exist\n", |
929 | cmd->fs.ring_cookie); | 929 | cmd->fs.ring_cookie); |
930 | return -EINVAL; | 930 | return -EINVAL; |
931 | } | 931 | } |
932 | qpn = priv->rss_map.qps[cmd->fs.ring_cookie].qpn; | 932 | qpn = priv->rss_map.qps[cmd->fs.ring_cookie].qpn; |
933 | if (!qpn) { | 933 | if (!qpn) { |
934 | en_warn(priv, "rxnfc: RX ring (%llu) is inactive.\n", | 934 | en_warn(priv, "rxnfc: RX ring (%llu) is inactive\n", |
935 | cmd->fs.ring_cookie); | 935 | cmd->fs.ring_cookie); |
936 | return -EINVAL; | 936 | return -EINVAL; |
937 | } | 937 | } |
@@ -956,7 +956,7 @@ static int mlx4_en_flow_replace(struct net_device *dev, | |||
956 | } | 956 | } |
957 | err = mlx4_flow_attach(priv->mdev->dev, &rule, ®_id); | 957 | err = mlx4_flow_attach(priv->mdev->dev, &rule, ®_id); |
958 | if (err) { | 958 | if (err) { |
959 | en_err(priv, "Fail to attach network rule at location %d.\n", | 959 | en_err(priv, "Fail to attach network rule at location %d\n", |
960 | cmd->fs.location); | 960 | cmd->fs.location); |
961 | goto out_free_list; | 961 | goto out_free_list; |
962 | } | 962 | } |
@@ -1121,7 +1121,7 @@ static int mlx4_en_set_channels(struct net_device *dev, | |||
1121 | { | 1121 | { |
1122 | struct mlx4_en_priv *priv = netdev_priv(dev); | 1122 | struct mlx4_en_priv *priv = netdev_priv(dev); |
1123 | struct mlx4_en_dev *mdev = priv->mdev; | 1123 | struct mlx4_en_dev *mdev = priv->mdev; |
1124 | int port_up; | 1124 | int port_up = 0; |
1125 | int err = 0; | 1125 | int err = 0; |
1126 | 1126 | ||
1127 | if (channel->other_count || channel->combined_count || | 1127 | if (channel->other_count || channel->combined_count || |
@@ -1151,7 +1151,8 @@ static int mlx4_en_set_channels(struct net_device *dev, | |||
1151 | netif_set_real_num_tx_queues(dev, priv->tx_ring_num); | 1151 | netif_set_real_num_tx_queues(dev, priv->tx_ring_num); |
1152 | netif_set_real_num_rx_queues(dev, priv->rx_ring_num); | 1152 | netif_set_real_num_rx_queues(dev, priv->rx_ring_num); |
1153 | 1153 | ||
1154 | mlx4_en_setup_tc(dev, MLX4_EN_NUM_UP); | 1154 | if (dev->num_tc) |
1155 | mlx4_en_setup_tc(dev, MLX4_EN_NUM_UP); | ||
1155 | 1156 | ||
1156 | en_warn(priv, "Using %d TX rings\n", priv->tx_ring_num); | 1157 | en_warn(priv, "Using %d TX rings\n", priv->tx_ring_num); |
1157 | en_warn(priv, "Using %d RX rings\n", priv->rx_ring_num); | 1158 | en_warn(priv, "Using %d RX rings\n", priv->rx_ring_num); |
@@ -1223,8 +1224,8 @@ const struct ethtool_ops mlx4_en_ethtool_ops = { | |||
1223 | .get_rxnfc = mlx4_en_get_rxnfc, | 1224 | .get_rxnfc = mlx4_en_get_rxnfc, |
1224 | .set_rxnfc = mlx4_en_set_rxnfc, | 1225 | .set_rxnfc = mlx4_en_set_rxnfc, |
1225 | .get_rxfh_indir_size = mlx4_en_get_rxfh_indir_size, | 1226 | .get_rxfh_indir_size = mlx4_en_get_rxfh_indir_size, |
1226 | .get_rxfh_indir = mlx4_en_get_rxfh_indir, | 1227 | .get_rxfh = mlx4_en_get_rxfh, |
1227 | .set_rxfh_indir = mlx4_en_set_rxfh_indir, | 1228 | .set_rxfh = mlx4_en_set_rxfh, |
1228 | .get_channels = mlx4_en_get_channels, | 1229 | .get_channels = mlx4_en_get_channels, |
1229 | .set_channels = mlx4_en_set_channels, | 1230 | .set_channels = mlx4_en_set_channels, |
1230 | .get_ts_info = mlx4_en_get_ts_info, | 1231 | .get_ts_info = mlx4_en_get_ts_info, |