aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-11-17 10:53:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-17 10:53:25 -0500
commit847e9170c77d3b4f57822ae1f4cf4f65c65a8254 (patch)
tree23f931fa2c3f9cf967deb638fed9804806d07357 /drivers/net/mlx4
parent72eb8c6747b49e41fd2b042510f03ac7c13426fc (diff)
parent5f9021cfdc3524a4c5e3d7ae2d049eb7adcd6776 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (27 commits) rtnetlink: propagate error from dev_change_flags in do_setlink() isdn: remove extra byteswap in isdn_net_ciscohdlck_slarp_send_reply Phonet: refuse to send bigger than MTU packets e1000e: fix IPMI traffic e1000e: fix warn_on reload after phy_id error phy: fix phy address bug e100: fix dma error in direction for mapping igb: use dev_printk instead of printk qla3xxx: Cleanup: Fix link print statements. igb: Use device_set_wakeup_enable e1000: Use device_set_wakeup_enable e1000e: Use device_set_wakeup_enable via-velocity: enable perfect filtering for multicast packets phy: Add support for Marvell 88E1118 PHY mlx4_en: Pause parameters per port phylib: fix premature freeing of struct mii_bus atl1: Do not enumerate options unsupported by chip atl1e: fix broken multicast by removing unnecessary crc inversion gianfar: Fix DMA unmap invocations net/ucc_geth: Fix oops in uec_get_ethtool_stats() ...
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r--drivers/net/mlx4/en_netdev.c8
-rw-r--r--drivers/net/mlx4/en_params.c30
-rw-r--r--drivers/net/mlx4/mlx4_en.h8
3 files changed, 24 insertions, 22 deletions
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index a3f732418c49..96e709d6440a 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -656,10 +656,10 @@ static int mlx4_en_start_port(struct net_device *dev)
656 /* Configure port */ 656 /* Configure port */
657 err = mlx4_SET_PORT_general(mdev->dev, priv->port, 657 err = mlx4_SET_PORT_general(mdev->dev, priv->port,
658 priv->rx_skb_size + ETH_FCS_LEN, 658 priv->rx_skb_size + ETH_FCS_LEN,
659 mdev->profile.tx_pause, 659 priv->prof->tx_pause,
660 mdev->profile.tx_ppp, 660 priv->prof->tx_ppp,
661 mdev->profile.rx_pause, 661 priv->prof->rx_pause,
662 mdev->profile.rx_ppp); 662 priv->prof->rx_ppp);
663 if (err) { 663 if (err) {
664 mlx4_err(mdev, "Failed setting port general configurations" 664 mlx4_err(mdev, "Failed setting port general configurations"
665 " for port %d, with error %d\n", priv->port, err); 665 " for port %d, with error %d\n", priv->port, err);
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,
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h
index 11fb17c6e97b..98ddc0811f93 100644
--- a/drivers/net/mlx4/mlx4_en.h
+++ b/drivers/net/mlx4/mlx4_en.h
@@ -322,6 +322,10 @@ struct mlx4_en_port_profile {
322 u32 rx_ring_num; 322 u32 rx_ring_num;
323 u32 tx_ring_size; 323 u32 tx_ring_size;
324 u32 rx_ring_size; 324 u32 rx_ring_size;
325 u8 rx_pause;
326 u8 rx_ppp;
327 u8 tx_pause;
328 u8 tx_ppp;
325}; 329};
326 330
327struct mlx4_en_profile { 331struct mlx4_en_profile {
@@ -333,10 +337,6 @@ struct mlx4_en_profile {
333 int rx_moder_cnt; 337 int rx_moder_cnt;
334 int rx_moder_time; 338 int rx_moder_time;
335 int auto_moder; 339 int auto_moder;
336 u8 rx_pause;
337 u8 rx_ppp;
338 u8 tx_pause;
339 u8 tx_ppp;
340 u8 no_reset; 340 u8 no_reset;
341 struct mlx4_en_port_profile prof[MLX4_MAX_PORTS + 1]; 341 struct mlx4_en_port_profile prof[MLX4_MAX_PORTS + 1];
342}; 342};