aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/en_params.c
diff options
context:
space:
mode:
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>2008-11-04 23:48:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-15 16:52:07 -0500
commitd53b93f2603554c3420e301bd13ee2c354a15ceb (patch)
tree7bd42fc5b292baaeb184b3ad15f528653ae97e52 /drivers/net/mlx4/en_params.c
parenta2224ad38704a3cfe033313f803183a23e6b7886 (diff)
mlx4_en: Pause parameters per port
Before the change the driver reported the same pause parameters for all the ports, even only one of them was modified. Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mlx4/en_params.c')
-rw-r--r--drivers/net/mlx4/en_params.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/net/mlx4/en_params.c b/drivers/net/mlx4/en_params.c
index c2e69b1bcd0a..95706ee1c019 100644
--- a/drivers/net/mlx4/en_params.c
+++ b/drivers/net/mlx4/en_params.c
@@ -90,6 +90,7 @@ MLX4_EN_PARM_INT(rx_ring_size2, MLX4_EN_AUTO_CONF, "Rx ring size for port 2");
90int mlx4_en_get_profile(struct mlx4_en_dev *mdev) 90int mlx4_en_get_profile(struct mlx4_en_dev *mdev)
91{ 91{
92 struct mlx4_en_profile *params = &mdev->profile; 92 struct mlx4_en_profile *params = &mdev->profile;
93 int i;
93 94
94 params->rx_moder_cnt = min_t(int, rx_moder_cnt, MLX4_EN_AUTO_CONF); 95 params->rx_moder_cnt = min_t(int, rx_moder_cnt, MLX4_EN_AUTO_CONF);
95 params->rx_moder_time = min_t(int, rx_moder_time, MLX4_EN_AUTO_CONF); 96 params->rx_moder_time = min_t(int, rx_moder_time, MLX4_EN_AUTO_CONF);
@@ -97,11 +98,13 @@ int mlx4_en_get_profile(struct mlx4_en_dev *mdev)
97 params->rss_xor = (rss_xor != 0); 98 params->rss_xor = (rss_xor != 0);
98 params->rss_mask = rss_mask & 0x1f; 99 params->rss_mask = rss_mask & 0x1f;
99 params->num_lro = min_t(int, num_lro , MLX4_EN_MAX_LRO_DESCRIPTORS); 100 params->num_lro = min_t(int, num_lro , MLX4_EN_MAX_LRO_DESCRIPTORS);
100 params->rx_pause = pprx; 101 for (i = 1; i <= MLX4_MAX_PORTS; i++) {
101 params->rx_ppp = pfcrx; 102 params->prof[i].rx_pause = pprx;
102 params->tx_pause = pptx; 103 params->prof[i].rx_ppp = pfcrx;
103 params->tx_ppp = pfctx; 104 params->prof[i].tx_pause = pptx;
104 if (params->rx_ppp || params->tx_ppp) { 105 params->prof[i].tx_ppp = pfctx;
106 }
107 if (pfcrx || pfctx) {
105 params->prof[1].tx_ring_num = MLX4_EN_TX_RING_NUM; 108 params->prof[1].tx_ring_num = MLX4_EN_TX_RING_NUM;
106 params->prof[2].tx_ring_num = MLX4_EN_TX_RING_NUM; 109 params->prof[2].tx_ring_num = MLX4_EN_TX_RING_NUM;
107 } else { 110 } else {
@@ -407,14 +410,14 @@ static int mlx4_en_set_pauseparam(struct net_device *dev,
407 struct mlx4_en_dev *mdev = priv->mdev; 410 struct mlx4_en_dev *mdev = priv->mdev;
408 int err; 411 int err;
409 412
410 mdev->profile.tx_pause = pause->tx_pause != 0; 413 priv->prof->tx_pause = pause->tx_pause != 0;
411 mdev->profile.rx_pause = pause->rx_pause != 0; 414 priv->prof->rx_pause = pause->rx_pause != 0;
412 err = mlx4_SET_PORT_general(mdev->dev, priv->port, 415 err = mlx4_SET_PORT_general(mdev->dev, priv->port,
413 priv->rx_skb_size + ETH_FCS_LEN, 416 priv->rx_skb_size + ETH_FCS_LEN,
414 mdev->profile.tx_pause, 417 priv->prof->tx_pause,
415 mdev->profile.tx_ppp, 418 priv->prof->tx_ppp,
416 mdev->profile.rx_pause, 419 priv->prof->rx_pause,
417 mdev->profile.rx_ppp); 420 priv->prof->rx_ppp);
418 if (err) 421 if (err)
419 mlx4_err(mdev, "Failed setting pause params to\n"); 422 mlx4_err(mdev, "Failed setting pause params to\n");
420 423
@@ -425,10 +428,9 @@ static void mlx4_en_get_pauseparam(struct net_device *dev,
425 struct ethtool_pauseparam *pause) 428 struct ethtool_pauseparam *pause)
426{ 429{
427 struct mlx4_en_priv *priv = netdev_priv(dev); 430 struct mlx4_en_priv *priv = netdev_priv(dev);
428 struct mlx4_en_dev *mdev = priv->mdev;
429 431
430 pause->tx_pause = mdev->profile.tx_pause; 432 pause->tx_pause = priv->prof->tx_pause;
431 pause->rx_pause = mdev->profile.rx_pause; 433 pause->rx_pause = priv->prof->rx_pause;
432} 434}
433 435
434static void mlx4_en_get_ringparam(struct net_device *dev, 436static void mlx4_en_get_ringparam(struct net_device *dev,