diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:49:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 15:49:40 -0500 |
commit | 0191b625ca5a46206d2fb862bb08f36f2fcb3b31 (patch) | |
tree | 454d1842b1833d976da62abcbd5c47521ebe9bd7 /drivers/net/mlx4 | |
parent | 54a696bd07c14d3b1192d03ce7269bc59b45209a (diff) | |
parent | eb56092fc168bf5af199d47af50c0d84a96db898 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1429 commits)
net: Allow dependancies of FDDI & Tokenring to be modular.
igb: Fix build warning when DCA is disabled.
net: Fix warning fallout from recent NAPI interface changes.
gro: Fix potential use after free
sfc: If AN is enabled, always read speed/duplex from the AN advertising bits
sfc: When disabling the NIC, close the device rather than unregistering it
sfc: SFT9001: Add cable diagnostics
sfc: Add support for multiple PHY self-tests
sfc: Merge top-level functions for self-tests
sfc: Clean up PHY mode management in loopback self-test
sfc: Fix unreliable link detection in some loopback modes
sfc: Generate unique names for per-NIC workqueues
802.3ad: use standard ethhdr instead of ad_header
802.3ad: generalize out mac address initializer
802.3ad: initialize ports LACPDU from const initializer
802.3ad: remove typedef around ad_system
802.3ad: turn ports is_individual into a bool
802.3ad: turn ports is_enabled into a bool
802.3ad: make ntt bool
ixgbe: Fix set_ringparam in ixgbe to use the same memory pools.
...
Fixed trivial IPv4/6 address printing conflicts in fs/cifs/connect.c due
to the conversion to %pI (in this networking merge) and the addition of
doing IPv6 addresses (from the earlier merge of CIFS).
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r-- | drivers/net/mlx4/en_cq.c | 4 | ||||
-rw-r--r-- | drivers/net/mlx4/en_netdev.c | 48 | ||||
-rw-r--r-- | drivers/net/mlx4/en_params.c | 20 | ||||
-rw-r--r-- | drivers/net/mlx4/en_rx.c | 9 | ||||
-rw-r--r-- | drivers/net/mlx4/en_tx.c | 29 | ||||
-rw-r--r-- | drivers/net/mlx4/mcg.c | 25 | ||||
-rw-r--r-- | drivers/net/mlx4/mlx4_en.h | 12 |
7 files changed, 52 insertions, 95 deletions
diff --git a/drivers/net/mlx4/en_cq.c b/drivers/net/mlx4/en_cq.c index 674f836e225b..91f50de84be9 100644 --- a/drivers/net/mlx4/en_cq.c +++ b/drivers/net/mlx4/en_cq.c | |||
@@ -71,6 +71,8 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, | |||
71 | err = mlx4_en_map_buffer(&cq->wqres.buf); | 71 | err = mlx4_en_map_buffer(&cq->wqres.buf); |
72 | if (err) | 72 | if (err) |
73 | mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size); | 73 | mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size); |
74 | else | ||
75 | cq->buf = (struct mlx4_cqe *) cq->wqres.buf.direct.buf; | ||
74 | 76 | ||
75 | return err; | 77 | return err; |
76 | } | 78 | } |
@@ -85,7 +87,6 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) | |||
85 | cq->mcq.arm_db = cq->wqres.db.db + 1; | 87 | cq->mcq.arm_db = cq->wqres.db.db + 1; |
86 | *cq->mcq.set_ci_db = 0; | 88 | *cq->mcq.set_ci_db = 0; |
87 | *cq->mcq.arm_db = 0; | 89 | *cq->mcq.arm_db = 0; |
88 | cq->buf = (struct mlx4_cqe *) cq->wqres.buf.direct.buf; | ||
89 | memset(cq->buf, 0, cq->buf_size); | 90 | memset(cq->buf, 0, cq->buf_size); |
90 | 91 | ||
91 | err = mlx4_cq_alloc(mdev->dev, cq->size, &cq->wqres.mtt, &mdev->priv_uar, | 92 | err = mlx4_cq_alloc(mdev->dev, cq->size, &cq->wqres.mtt, &mdev->priv_uar, |
@@ -139,7 +140,6 @@ int mlx4_en_set_cq_moder(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) | |||
139 | 140 | ||
140 | int mlx4_en_arm_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) | 141 | int mlx4_en_arm_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) |
141 | { | 142 | { |
142 | cq->armed = 1; | ||
143 | mlx4_cq_arm(&cq->mcq, MLX4_CQ_DB_REQ_NOT, priv->mdev->uar_map, | 143 | mlx4_cq_arm(&cq->mcq, MLX4_CQ_DB_REQ_NOT, priv->mdev->uar_map, |
144 | &priv->mdev->uar_lock); | 144 | &priv->mdev->uar_lock); |
145 | 145 | ||
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index 96e709d6440a..ebada3c7aff2 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c | |||
@@ -369,7 +369,6 @@ static struct net_device_stats *mlx4_en_get_stats(struct net_device *dev) | |||
369 | 369 | ||
370 | static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv) | 370 | static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv) |
371 | { | 371 | { |
372 | struct mlx4_en_dev *mdev = priv->mdev; | ||
373 | struct mlx4_en_cq *cq; | 372 | struct mlx4_en_cq *cq; |
374 | int i; | 373 | int i; |
375 | 374 | ||
@@ -379,15 +378,8 @@ static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv) | |||
379 | * satisfy our coelsing target. | 378 | * satisfy our coelsing target. |
380 | * - moder_time is set to a fixed value. | 379 | * - moder_time is set to a fixed value. |
381 | */ | 380 | */ |
382 | priv->rx_frames = (mdev->profile.rx_moder_cnt == | 381 | priv->rx_frames = MLX4_EN_RX_COAL_TARGET / priv->dev->mtu + 1; |
383 | MLX4_EN_AUTO_CONF) ? | 382 | priv->rx_usecs = MLX4_EN_RX_COAL_TIME; |
384 | MLX4_EN_RX_COAL_TARGET / | ||
385 | priv->dev->mtu + 1 : | ||
386 | mdev->profile.rx_moder_cnt; | ||
387 | priv->rx_usecs = (mdev->profile.rx_moder_time == | ||
388 | MLX4_EN_AUTO_CONF) ? | ||
389 | MLX4_EN_RX_COAL_TIME : | ||
390 | mdev->profile.rx_moder_time; | ||
391 | mlx4_dbg(INTR, priv, "Default coalesing params for mtu:%d - " | 383 | mlx4_dbg(INTR, priv, "Default coalesing params for mtu:%d - " |
392 | "rx_frames:%d rx_usecs:%d\n", | 384 | "rx_frames:%d rx_usecs:%d\n", |
393 | priv->dev->mtu, priv->rx_frames, priv->rx_usecs); | 385 | priv->dev->mtu, priv->rx_frames, priv->rx_usecs); |
@@ -411,7 +403,7 @@ static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv) | |||
411 | priv->pkt_rate_high = MLX4_EN_RX_RATE_HIGH; | 403 | priv->pkt_rate_high = MLX4_EN_RX_RATE_HIGH; |
412 | priv->rx_usecs_high = MLX4_EN_RX_COAL_TIME_HIGH; | 404 | priv->rx_usecs_high = MLX4_EN_RX_COAL_TIME_HIGH; |
413 | priv->sample_interval = MLX4_EN_SAMPLE_INTERVAL; | 405 | priv->sample_interval = MLX4_EN_SAMPLE_INTERVAL; |
414 | priv->adaptive_rx_coal = mdev->profile.auto_moder; | 406 | priv->adaptive_rx_coal = 1; |
415 | priv->last_moder_time = MLX4_EN_AUTO_CONF; | 407 | priv->last_moder_time = MLX4_EN_AUTO_CONF; |
416 | priv->last_moder_jiffies = 0; | 408 | priv->last_moder_jiffies = 0; |
417 | priv->last_moder_packets = 0; | 409 | priv->last_moder_packets = 0; |
@@ -953,6 +945,23 @@ static int mlx4_en_change_mtu(struct net_device *dev, int new_mtu) | |||
953 | return 0; | 945 | return 0; |
954 | } | 946 | } |
955 | 947 | ||
948 | static const struct net_device_ops mlx4_netdev_ops = { | ||
949 | .ndo_open = mlx4_en_open, | ||
950 | .ndo_stop = mlx4_en_close, | ||
951 | .ndo_start_xmit = mlx4_en_xmit, | ||
952 | .ndo_get_stats = mlx4_en_get_stats, | ||
953 | .ndo_set_multicast_list = mlx4_en_set_multicast, | ||
954 | .ndo_set_mac_address = mlx4_en_set_mac, | ||
955 | .ndo_change_mtu = mlx4_en_change_mtu, | ||
956 | .ndo_tx_timeout = mlx4_en_tx_timeout, | ||
957 | .ndo_vlan_rx_register = mlx4_en_vlan_rx_register, | ||
958 | .ndo_vlan_rx_add_vid = mlx4_en_vlan_rx_add_vid, | ||
959 | .ndo_vlan_rx_kill_vid = mlx4_en_vlan_rx_kill_vid, | ||
960 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
961 | .ndo_poll_controller = mlx4_en_netpoll, | ||
962 | #endif | ||
963 | }; | ||
964 | |||
956 | int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | 965 | int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, |
957 | struct mlx4_en_port_profile *prof) | 966 | struct mlx4_en_port_profile *prof) |
958 | { | 967 | { |
@@ -1029,22 +1038,9 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
1029 | /* | 1038 | /* |
1030 | * Initialize netdev entry points | 1039 | * Initialize netdev entry points |
1031 | */ | 1040 | */ |
1032 | 1041 | dev->netdev_ops = &mlx4_netdev_ops; | |
1033 | dev->open = &mlx4_en_open; | ||
1034 | dev->stop = &mlx4_en_close; | ||
1035 | dev->hard_start_xmit = &mlx4_en_xmit; | ||
1036 | dev->get_stats = &mlx4_en_get_stats; | ||
1037 | dev->set_multicast_list = &mlx4_en_set_multicast; | ||
1038 | dev->set_mac_address = &mlx4_en_set_mac; | ||
1039 | dev->change_mtu = &mlx4_en_change_mtu; | ||
1040 | dev->tx_timeout = &mlx4_en_tx_timeout; | ||
1041 | dev->watchdog_timeo = MLX4_EN_WATCHDOG_TIMEOUT; | 1042 | dev->watchdog_timeo = MLX4_EN_WATCHDOG_TIMEOUT; |
1042 | dev->vlan_rx_register = mlx4_en_vlan_rx_register; | 1043 | |
1043 | dev->vlan_rx_add_vid = mlx4_en_vlan_rx_add_vid; | ||
1044 | dev->vlan_rx_kill_vid = mlx4_en_vlan_rx_kill_vid; | ||
1045 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1046 | dev->poll_controller = mlx4_en_netpoll; | ||
1047 | #endif | ||
1048 | SET_ETHTOOL_OPS(dev, &mlx4_en_ethtool_ops); | 1044 | SET_ETHTOOL_OPS(dev, &mlx4_en_ethtool_ops); |
1049 | 1045 | ||
1050 | /* Set defualt MAC */ | 1046 | /* Set defualt MAC */ |
diff --git a/drivers/net/mlx4/en_params.c b/drivers/net/mlx4/en_params.c index 95706ee1c019..047b37f5a747 100644 --- a/drivers/net/mlx4/en_params.c +++ b/drivers/net/mlx4/en_params.c | |||
@@ -60,24 +60,11 @@ MLX4_EN_PARM_INT(num_lro, MLX4_EN_MAX_LRO_DESCRIPTORS, | |||
60 | "Number of LRO sessions per ring or disabled (0)"); | 60 | "Number of LRO sessions per ring or disabled (0)"); |
61 | 61 | ||
62 | /* Priority pausing */ | 62 | /* Priority pausing */ |
63 | MLX4_EN_PARM_INT(pptx, MLX4_EN_DEF_TX_PAUSE, | ||
64 | "Pause policy on TX: 0 never generate pause frames " | ||
65 | "1 generate pause frames according to RX buffer threshold"); | ||
66 | MLX4_EN_PARM_INT(pprx, MLX4_EN_DEF_RX_PAUSE, | ||
67 | "Pause policy on RX: 0 ignore received pause frames " | ||
68 | "1 respect received pause frames"); | ||
69 | MLX4_EN_PARM_INT(pfctx, 0, "Priority based Flow Control policy on TX[7:0]." | 63 | MLX4_EN_PARM_INT(pfctx, 0, "Priority based Flow Control policy on TX[7:0]." |
70 | " Per priority bit mask"); | 64 | " Per priority bit mask"); |
71 | MLX4_EN_PARM_INT(pfcrx, 0, "Priority based Flow Control policy on RX[7:0]." | 65 | MLX4_EN_PARM_INT(pfcrx, 0, "Priority based Flow Control policy on RX[7:0]." |
72 | " Per priority bit mask"); | 66 | " Per priority bit mask"); |
73 | 67 | ||
74 | /* Interrupt moderation tunning */ | ||
75 | MLX4_EN_PARM_INT(rx_moder_cnt, MLX4_EN_AUTO_CONF, | ||
76 | "Max coalesced descriptors for Rx interrupt moderation"); | ||
77 | MLX4_EN_PARM_INT(rx_moder_time, MLX4_EN_AUTO_CONF, | ||
78 | "Timeout following last packet for Rx interrupt moderation"); | ||
79 | MLX4_EN_PARM_INT(auto_moder, 1, "Enable dynamic interrupt moderation"); | ||
80 | |||
81 | MLX4_EN_PARM_INT(rx_ring_num1, 0, "Number or Rx rings for port 1 (0 = #cores)"); | 68 | MLX4_EN_PARM_INT(rx_ring_num1, 0, "Number or Rx rings for port 1 (0 = #cores)"); |
82 | MLX4_EN_PARM_INT(rx_ring_num2, 0, "Number or Rx rings for port 2 (0 = #cores)"); | 69 | MLX4_EN_PARM_INT(rx_ring_num2, 0, "Number or Rx rings for port 2 (0 = #cores)"); |
83 | 70 | ||
@@ -92,16 +79,13 @@ int mlx4_en_get_profile(struct mlx4_en_dev *mdev) | |||
92 | struct mlx4_en_profile *params = &mdev->profile; | 79 | struct mlx4_en_profile *params = &mdev->profile; |
93 | int i; | 80 | int i; |
94 | 81 | ||
95 | params->rx_moder_cnt = min_t(int, rx_moder_cnt, MLX4_EN_AUTO_CONF); | ||
96 | params->rx_moder_time = min_t(int, rx_moder_time, MLX4_EN_AUTO_CONF); | ||
97 | params->auto_moder = auto_moder; | ||
98 | params->rss_xor = (rss_xor != 0); | 82 | params->rss_xor = (rss_xor != 0); |
99 | params->rss_mask = rss_mask & 0x1f; | 83 | params->rss_mask = rss_mask & 0x1f; |
100 | params->num_lro = min_t(int, num_lro , MLX4_EN_MAX_LRO_DESCRIPTORS); | 84 | params->num_lro = min_t(int, num_lro , MLX4_EN_MAX_LRO_DESCRIPTORS); |
101 | for (i = 1; i <= MLX4_MAX_PORTS; i++) { | 85 | for (i = 1; i <= MLX4_MAX_PORTS; i++) { |
102 | params->prof[i].rx_pause = pprx; | 86 | params->prof[i].rx_pause = 1; |
103 | params->prof[i].rx_ppp = pfcrx; | 87 | params->prof[i].rx_ppp = pfcrx; |
104 | params->prof[i].tx_pause = pptx; | 88 | params->prof[i].tx_pause = 1; |
105 | params->prof[i].tx_ppp = pfctx; | 89 | params->prof[i].tx_ppp = pfctx; |
106 | } | 90 | } |
107 | if (pfcrx || pfctx) { | 91 | if (pfcrx || pfctx) { |
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c index 6232227f56c3..c61b0bdca1a4 100644 --- a/drivers/net/mlx4/en_rx.c +++ b/drivers/net/mlx4/en_rx.c | |||
@@ -443,7 +443,8 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv) | |||
443 | /* Fill Rx buffers */ | 443 | /* Fill Rx buffers */ |
444 | ring->full = 0; | 444 | ring->full = 0; |
445 | } | 445 | } |
446 | if (mlx4_en_fill_rx_buffers(priv)) | 446 | err = mlx4_en_fill_rx_buffers(priv); |
447 | if (err) | ||
447 | goto err_buffers; | 448 | goto err_buffers; |
448 | 449 | ||
449 | for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) { | 450 | for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) { |
@@ -776,8 +777,6 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
776 | } else | 777 | } else |
777 | netif_receive_skb(skb); | 778 | netif_receive_skb(skb); |
778 | 779 | ||
779 | dev->last_rx = jiffies; | ||
780 | |||
781 | next: | 780 | next: |
782 | ++cq->mcq.cons_index; | 781 | ++cq->mcq.cons_index; |
783 | index = (cq->mcq.cons_index) & ring->size_mask; | 782 | index = (cq->mcq.cons_index) & ring->size_mask; |
@@ -815,7 +814,7 @@ void mlx4_en_rx_irq(struct mlx4_cq *mcq) | |||
815 | struct mlx4_en_priv *priv = netdev_priv(cq->dev); | 814 | struct mlx4_en_priv *priv = netdev_priv(cq->dev); |
816 | 815 | ||
817 | if (priv->port_up) | 816 | if (priv->port_up) |
818 | netif_rx_schedule(cq->dev, &cq->napi); | 817 | netif_rx_schedule(&cq->napi); |
819 | else | 818 | else |
820 | mlx4_en_arm_cq(priv, cq); | 819 | mlx4_en_arm_cq(priv, cq); |
821 | } | 820 | } |
@@ -835,7 +834,7 @@ int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget) | |||
835 | INC_PERF_COUNTER(priv->pstats.napi_quota); | 834 | INC_PERF_COUNTER(priv->pstats.napi_quota); |
836 | else { | 835 | else { |
837 | /* Done for now */ | 836 | /* Done for now */ |
838 | netif_rx_complete(dev, napi); | 837 | netif_rx_complete(napi); |
839 | mlx4_en_arm_cq(priv, cq); | 838 | mlx4_en_arm_cq(priv, cq); |
840 | } | 839 | } |
841 | return done; | 840 | return done; |
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c index 8592f8fb8475..ff4d75205c25 100644 --- a/drivers/net/mlx4/en_tx.c +++ b/drivers/net/mlx4/en_tx.c | |||
@@ -379,8 +379,8 @@ static void mlx4_en_process_tx_cq(struct net_device *dev, struct mlx4_en_cq *cq) | |||
379 | 379 | ||
380 | /* Wakeup Tx queue if this ring stopped it */ | 380 | /* Wakeup Tx queue if this ring stopped it */ |
381 | if (unlikely(ring->blocked)) { | 381 | if (unlikely(ring->blocked)) { |
382 | if (((u32) (ring->prod - ring->cons) <= | 382 | if ((u32) (ring->prod - ring->cons) <= |
383 | ring->size - HEADROOM - MAX_DESC_TXBBS) && !cq->armed) { | 383 | ring->size - HEADROOM - MAX_DESC_TXBBS) { |
384 | 384 | ||
385 | /* TODO: support multiqueue netdevs. Currently, we block | 385 | /* TODO: support multiqueue netdevs. Currently, we block |
386 | * when *any* ring is full. Note that: | 386 | * when *any* ring is full. Note that: |
@@ -404,14 +404,11 @@ void mlx4_en_tx_irq(struct mlx4_cq *mcq) | |||
404 | struct mlx4_en_priv *priv = netdev_priv(cq->dev); | 404 | struct mlx4_en_priv *priv = netdev_priv(cq->dev); |
405 | struct mlx4_en_tx_ring *ring = &priv->tx_ring[cq->ring]; | 405 | struct mlx4_en_tx_ring *ring = &priv->tx_ring[cq->ring]; |
406 | 406 | ||
407 | spin_lock_irq(&ring->comp_lock); | 407 | if (!spin_trylock(&ring->comp_lock)) |
408 | cq->armed = 0; | 408 | return; |
409 | mlx4_en_process_tx_cq(cq->dev, cq); | 409 | mlx4_en_process_tx_cq(cq->dev, cq); |
410 | if (ring->blocked) | 410 | mod_timer(&cq->timer, jiffies + 1); |
411 | mlx4_en_arm_cq(priv, cq); | 411 | spin_unlock(&ring->comp_lock); |
412 | else | ||
413 | mod_timer(&cq->timer, jiffies + 1); | ||
414 | spin_unlock_irq(&ring->comp_lock); | ||
415 | } | 412 | } |
416 | 413 | ||
417 | 414 | ||
@@ -424,8 +421,10 @@ void mlx4_en_poll_tx_cq(unsigned long data) | |||
424 | 421 | ||
425 | INC_PERF_COUNTER(priv->pstats.tx_poll); | 422 | INC_PERF_COUNTER(priv->pstats.tx_poll); |
426 | 423 | ||
427 | netif_tx_lock(priv->dev); | 424 | if (!spin_trylock(&ring->comp_lock)) { |
428 | spin_lock_irq(&ring->comp_lock); | 425 | mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT); |
426 | return; | ||
427 | } | ||
429 | mlx4_en_process_tx_cq(cq->dev, cq); | 428 | mlx4_en_process_tx_cq(cq->dev, cq); |
430 | inflight = (u32) (ring->prod - ring->cons - ring->last_nr_txbb); | 429 | inflight = (u32) (ring->prod - ring->cons - ring->last_nr_txbb); |
431 | 430 | ||
@@ -435,8 +434,7 @@ void mlx4_en_poll_tx_cq(unsigned long data) | |||
435 | if (inflight && priv->port_up) | 434 | if (inflight && priv->port_up) |
436 | mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT); | 435 | mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT); |
437 | 436 | ||
438 | spin_unlock_irq(&ring->comp_lock); | 437 | spin_unlock(&ring->comp_lock); |
439 | netif_tx_unlock(priv->dev); | ||
440 | } | 438 | } |
441 | 439 | ||
442 | static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv, | 440 | static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv, |
@@ -479,7 +477,10 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind) | |||
479 | 477 | ||
480 | /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */ | 478 | /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */ |
481 | if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0) | 479 | if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0) |
482 | mlx4_en_process_tx_cq(priv->dev, cq); | 480 | if (spin_trylock(&ring->comp_lock)) { |
481 | mlx4_en_process_tx_cq(priv->dev, cq); | ||
482 | spin_unlock(&ring->comp_lock); | ||
483 | } | ||
483 | } | 484 | } |
484 | 485 | ||
485 | static void *get_frag_ptr(struct sk_buff *skb) | 486 | static void *get_frag_ptr(struct sk_buff *skb) |
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c index 592c01ae2c5d..6053c357a470 100644 --- a/drivers/net/mlx4/mcg.c +++ b/drivers/net/mlx4/mcg.c | |||
@@ -118,17 +118,7 @@ static int find_mgm(struct mlx4_dev *dev, | |||
118 | return err; | 118 | return err; |
119 | 119 | ||
120 | if (0) | 120 | if (0) |
121 | mlx4_dbg(dev, "Hash for %04x:%04x:%04x:%04x:" | 121 | mlx4_dbg(dev, "Hash for %pI6 is %04x\n", gid, *hash); |
122 | "%04x:%04x:%04x:%04x is %04x\n", | ||
123 | be16_to_cpu(((__be16 *) gid)[0]), | ||
124 | be16_to_cpu(((__be16 *) gid)[1]), | ||
125 | be16_to_cpu(((__be16 *) gid)[2]), | ||
126 | be16_to_cpu(((__be16 *) gid)[3]), | ||
127 | be16_to_cpu(((__be16 *) gid)[4]), | ||
128 | be16_to_cpu(((__be16 *) gid)[5]), | ||
129 | be16_to_cpu(((__be16 *) gid)[6]), | ||
130 | be16_to_cpu(((__be16 *) gid)[7]), | ||
131 | *hash); | ||
132 | 122 | ||
133 | *index = *hash; | 123 | *index = *hash; |
134 | *prev = -1; | 124 | *prev = -1; |
@@ -215,7 +205,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | |||
215 | 205 | ||
216 | if (block_mcast_loopback) | 206 | if (block_mcast_loopback) |
217 | mgm->qp[members_count++] = cpu_to_be32((qp->qpn & MGM_QPN_MASK) | | 207 | mgm->qp[members_count++] = cpu_to_be32((qp->qpn & MGM_QPN_MASK) | |
218 | (1 << MGM_BLCK_LB_BIT)); | 208 | (1U << MGM_BLCK_LB_BIT)); |
219 | else | 209 | else |
220 | mgm->qp[members_count++] = cpu_to_be32(qp->qpn & MGM_QPN_MASK); | 210 | mgm->qp[members_count++] = cpu_to_be32(qp->qpn & MGM_QPN_MASK); |
221 | 211 | ||
@@ -277,16 +267,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]) | |||
277 | goto out; | 267 | goto out; |
278 | 268 | ||
279 | if (index == -1) { | 269 | if (index == -1) { |
280 | mlx4_err(dev, "MGID %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x " | 270 | mlx4_err(dev, "MGID %pI6 not found\n", gid); |
281 | "not found\n", | ||
282 | be16_to_cpu(((__be16 *) gid)[0]), | ||
283 | be16_to_cpu(((__be16 *) gid)[1]), | ||
284 | be16_to_cpu(((__be16 *) gid)[2]), | ||
285 | be16_to_cpu(((__be16 *) gid)[3]), | ||
286 | be16_to_cpu(((__be16 *) gid)[4]), | ||
287 | be16_to_cpu(((__be16 *) gid)[5]), | ||
288 | be16_to_cpu(((__be16 *) gid)[6]), | ||
289 | be16_to_cpu(((__be16 *) gid)[7])); | ||
290 | err = -EINVAL; | 271 | err = -EINVAL; |
291 | goto out; | 272 | goto out; |
292 | } | 273 | } |
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h index 98ddc0811f93..e78209768def 100644 --- a/drivers/net/mlx4/mlx4_en.h +++ b/drivers/net/mlx4/mlx4_en.h | |||
@@ -58,17 +58,17 @@ | |||
58 | #define mlx4_dbg(mlevel, priv, format, arg...) \ | 58 | #define mlx4_dbg(mlevel, priv, format, arg...) \ |
59 | if (NETIF_MSG_##mlevel & priv->msg_enable) \ | 59 | if (NETIF_MSG_##mlevel & priv->msg_enable) \ |
60 | printk(KERN_DEBUG "%s %s: " format , DRV_NAME ,\ | 60 | printk(KERN_DEBUG "%s %s: " format , DRV_NAME ,\ |
61 | (&priv->mdev->pdev->dev)->bus_id , ## arg) | 61 | (dev_name(&priv->mdev->pdev->dev)) , ## arg) |
62 | 62 | ||
63 | #define mlx4_err(mdev, format, arg...) \ | 63 | #define mlx4_err(mdev, format, arg...) \ |
64 | printk(KERN_ERR "%s %s: " format , DRV_NAME ,\ | 64 | printk(KERN_ERR "%s %s: " format , DRV_NAME ,\ |
65 | (&mdev->pdev->dev)->bus_id , ## arg) | 65 | (dev_name(&mdev->pdev->dev)) , ## arg) |
66 | #define mlx4_info(mdev, format, arg...) \ | 66 | #define mlx4_info(mdev, format, arg...) \ |
67 | printk(KERN_INFO "%s %s: " format , DRV_NAME ,\ | 67 | printk(KERN_INFO "%s %s: " format , DRV_NAME ,\ |
68 | (&mdev->pdev->dev)->bus_id , ## arg) | 68 | (dev_name(&mdev->pdev->dev)) , ## arg) |
69 | #define mlx4_warn(mdev, format, arg...) \ | 69 | #define mlx4_warn(mdev, format, arg...) \ |
70 | printk(KERN_WARNING "%s %s: " format , DRV_NAME ,\ | 70 | printk(KERN_WARNING "%s %s: " format , DRV_NAME ,\ |
71 | (&mdev->pdev->dev)->bus_id , ## arg) | 71 | (dev_name(&mdev->pdev->dev)) , ## arg) |
72 | 72 | ||
73 | /* | 73 | /* |
74 | * Device constants | 74 | * Device constants |
@@ -311,7 +311,6 @@ struct mlx4_en_cq { | |||
311 | enum cq_type is_tx; | 311 | enum cq_type is_tx; |
312 | u16 moder_time; | 312 | u16 moder_time; |
313 | u16 moder_cnt; | 313 | u16 moder_cnt; |
314 | int armed; | ||
315 | struct mlx4_cqe *buf; | 314 | struct mlx4_cqe *buf; |
316 | #define MLX4_EN_OPCODE_ERROR 0x1e | 315 | #define MLX4_EN_OPCODE_ERROR 0x1e |
317 | }; | 316 | }; |
@@ -334,9 +333,6 @@ struct mlx4_en_profile { | |||
334 | u8 rss_mask; | 333 | u8 rss_mask; |
335 | u32 active_ports; | 334 | u32 active_ports; |
336 | u32 small_pkt_int; | 335 | u32 small_pkt_int; |
337 | int rx_moder_cnt; | ||
338 | int rx_moder_time; | ||
339 | int auto_moder; | ||
340 | u8 no_reset; | 336 | u8 no_reset; |
341 | struct mlx4_en_port_profile prof[MLX4_MAX_PORTS + 1]; | 337 | struct mlx4_en_port_profile prof[MLX4_MAX_PORTS + 1]; |
342 | }; | 338 | }; |