aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-11-19 02:38:23 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-19 02:38:23 -0500
commit198d6ba4d7f48c94f990f4604f0b3d73925e0ded (patch)
tree56bbdf8ba2553c23c8099da9344a8f1d1aba97ab /drivers/net/mlx4
parent9a57f7fabd383920585ed8b74eacd117c6551f2d (diff)
parent7f0f598a0069d1ab072375965a4b69137233169c (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/isdn/i4l/isdn_net.c fs/cifs/connect.c
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.h9
-rw-r--r--drivers/net/mlx4/mlx4_en.h8
4 files changed, 27 insertions, 28 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.h b/drivers/net/mlx4/mlx4.h
index fa431fad0eec..56a2e213fe62 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -87,6 +87,9 @@ enum {
87 87
88#ifdef CONFIG_MLX4_DEBUG 88#ifdef CONFIG_MLX4_DEBUG
89extern int mlx4_debug_level; 89extern int mlx4_debug_level;
90#else /* CONFIG_MLX4_DEBUG */
91#define mlx4_debug_level (0)
92#endif /* CONFIG_MLX4_DEBUG */
90 93
91#define mlx4_dbg(mdev, format, arg...) \ 94#define mlx4_dbg(mdev, format, arg...) \
92 do { \ 95 do { \
@@ -94,12 +97,6 @@ extern int mlx4_debug_level;
94 dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ## arg); \ 97 dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ## arg); \
95 } while (0) 98 } while (0)
96 99
97#else /* CONFIG_MLX4_DEBUG */
98
99#define mlx4_dbg(mdev, format, arg...) do { (void) mdev; } while (0)
100
101#endif /* CONFIG_MLX4_DEBUG */
102
103#define mlx4_err(mdev, format, arg...) \ 100#define mlx4_err(mdev, format, arg...) \
104 dev_err(&mdev->pdev->dev, format, ## arg) 101 dev_err(&mdev->pdev->dev, format, ## arg)
105#define mlx4_info(mdev, format, arg...) \ 102#define mlx4_info(mdev, format, arg...) \
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h
index cc022197e2a5..24f6d2585a6e 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};