aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-04-11 16:44:25 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-11 16:44:25 -0400
commit1c01a80cfec6f806246f31ff2680cd3639b30e67 (patch)
tree0b554aad2ec1da71ecf6339d4ba51617bfe1dc3c /drivers/net/mlx4
parentc44d79950b2daa1025e62eede73e4e4a274d1ef3 (diff)
parent4a9f65f6304a00f6473e83b19c1e83caa1e42530 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/smsc911x.c
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r--drivers/net/mlx4/en_main.c2
-rw-r--r--drivers/net/mlx4/en_netdev.c10
-rw-r--r--drivers/net/mlx4/en_rx.c6
-rw-r--r--drivers/net/mlx4/en_selftest.c2
-rw-r--r--drivers/net/mlx4/en_tx.c2
-rw-r--r--drivers/net/mlx4/main.c5
-rw-r--r--drivers/net/mlx4/mcg.c2
-rw-r--r--drivers/net/mlx4/mlx4.h2
-rw-r--r--drivers/net/mlx4/port.c4
-rw-r--r--drivers/net/mlx4/sense.c4
10 files changed, 25 insertions, 14 deletions
diff --git a/drivers/net/mlx4/en_main.c b/drivers/net/mlx4/en_main.c
index 9317b61a75b8..9276b1b25586 100644
--- a/drivers/net/mlx4/en_main.c
+++ b/drivers/net/mlx4/en_main.c
@@ -236,7 +236,7 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
236 goto err_mr; 236 goto err_mr;
237 } 237 }
238 238
239 /* Configure wich ports to start according to module parameters */ 239 /* Configure which ports to start according to module parameters */
240 mdev->port_cnt = 0; 240 mdev->port_cnt = 0;
241 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) 241 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH)
242 mdev->port_cnt++; 242 mdev->port_cnt++;
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index 4f158baa0246..77063f91c564 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -247,7 +247,7 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
247 priv->port); 247 priv->port);
248 if (err) 248 if (err)
249 en_err(priv, "Failed enabling " 249 en_err(priv, "Failed enabling "
250 "promiscous mode\n"); 250 "promiscuous mode\n");
251 251
252 /* Disable port multicast filter (unconditionally) */ 252 /* Disable port multicast filter (unconditionally) */
253 err = mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 253 err = mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0,
@@ -276,7 +276,7 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
276 } 276 }
277 277
278 /* 278 /*
279 * Not in promiscous mode 279 * Not in promiscuous mode
280 */ 280 */
281 281
282 if (priv->flags & MLX4_EN_FLAG_PROMISC) { 282 if (priv->flags & MLX4_EN_FLAG_PROMISC) {
@@ -292,14 +292,14 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
292 err = mlx4_unicast_promisc_remove(mdev->dev, priv->base_qpn, 292 err = mlx4_unicast_promisc_remove(mdev->dev, priv->base_qpn,
293 priv->port); 293 priv->port);
294 if (err) 294 if (err)
295 en_err(priv, "Failed disabling promiscous mode\n"); 295 en_err(priv, "Failed disabling promiscuous mode\n");
296 296
297 /* Disable Multicast promisc */ 297 /* Disable Multicast promisc */
298 if (priv->flags & MLX4_EN_FLAG_MC_PROMISC) { 298 if (priv->flags & MLX4_EN_FLAG_MC_PROMISC) {
299 err = mlx4_multicast_promisc_remove(mdev->dev, priv->base_qpn, 299 err = mlx4_multicast_promisc_remove(mdev->dev, priv->base_qpn,
300 priv->port); 300 priv->port);
301 if (err) 301 if (err)
302 en_err(priv, "Failed disabling multicast promiscous mode\n"); 302 en_err(priv, "Failed disabling multicast promiscuous mode\n");
303 priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC; 303 priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC;
304 } 304 }
305 305
@@ -331,7 +331,7 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
331 err = mlx4_multicast_promisc_remove(mdev->dev, priv->base_qpn, 331 err = mlx4_multicast_promisc_remove(mdev->dev, priv->base_qpn,
332 priv->port); 332 priv->port);
333 if (err) 333 if (err)
334 en_err(priv, "Failed disabling multicast promiscous mode\n"); 334 en_err(priv, "Failed disabling multicast promiscuous mode\n");
335 priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC; 335 priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC;
336 } 336 }
337 337
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 05998ee297c9..62dd21b06df4 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -345,6 +345,8 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
345 err = mlx4_en_init_allocator(priv, ring); 345 err = mlx4_en_init_allocator(priv, ring);
346 if (err) { 346 if (err) {
347 en_err(priv, "Failed initializing ring allocator\n"); 347 en_err(priv, "Failed initializing ring allocator\n");
348 if (ring->stride <= TXBB_SIZE)
349 ring->buf -= TXBB_SIZE;
348 ring_ind--; 350 ring_ind--;
349 goto err_allocator; 351 goto err_allocator;
350 } 352 }
@@ -369,6 +371,8 @@ err_buffers:
369 ring_ind = priv->rx_ring_num - 1; 371 ring_ind = priv->rx_ring_num - 1;
370err_allocator: 372err_allocator:
371 while (ring_ind >= 0) { 373 while (ring_ind >= 0) {
374 if (priv->rx_ring[ring_ind].stride <= TXBB_SIZE)
375 priv->rx_ring[ring_ind].buf -= TXBB_SIZE;
372 mlx4_en_destroy_allocator(priv, &priv->rx_ring[ring_ind]); 376 mlx4_en_destroy_allocator(priv, &priv->rx_ring[ring_ind]);
373 ring_ind--; 377 ring_ind--;
374 } 378 }
@@ -706,7 +710,7 @@ int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget)
706} 710}
707 711
708 712
709/* Calculate the last offset position that accomodates a full fragment 713/* Calculate the last offset position that accommodates a full fragment
710 * (assuming fagment size = stride-align) */ 714 * (assuming fagment size = stride-align) */
711static int mlx4_en_last_alloc_offset(struct mlx4_en_priv *priv, u16 stride, u16 align) 715static int mlx4_en_last_alloc_offset(struct mlx4_en_priv *priv, u16 stride, u16 align)
712{ 716{
diff --git a/drivers/net/mlx4/en_selftest.c b/drivers/net/mlx4/en_selftest.c
index 9c91a92da705..191a8dcd8a93 100644
--- a/drivers/net/mlx4/en_selftest.c
+++ b/drivers/net/mlx4/en_selftest.c
@@ -149,7 +149,7 @@ void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf)
149 149
150 netif_carrier_off(dev); 150 netif_carrier_off(dev);
151retry_tx: 151retry_tx:
152 /* Wait untill all tx queues are empty. 152 /* Wait until all tx queues are empty.
153 * there should not be any additional incoming traffic 153 * there should not be any additional incoming traffic
154 * since we turned the carrier off */ 154 * since we turned the carrier off */
155 msleep(200); 155 msleep(200);
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c
index 01feb8fd42ad..b229acf1855f 100644
--- a/drivers/net/mlx4/en_tx.c
+++ b/drivers/net/mlx4/en_tx.c
@@ -636,7 +636,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
636 if (unlikely(!real_size)) 636 if (unlikely(!real_size))
637 goto tx_drop; 637 goto tx_drop;
638 638
639 /* Allign descriptor to TXBB size */ 639 /* Align descriptor to TXBB size */
640 desc_size = ALIGN(real_size, TXBB_SIZE); 640 desc_size = ALIGN(real_size, TXBB_SIZE);
641 nr_txbb = desc_size / TXBB_SIZE; 641 nr_txbb = desc_size / TXBB_SIZE;
642 if (unlikely(nr_txbb > MAX_DESC_TXBBS)) { 642 if (unlikely(nr_txbb > MAX_DESC_TXBBS)) {
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 62fa7eec5f0c..3814fc9b1145 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -944,6 +944,10 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
944 } 944 }
945 945
946 for (port = 1; port <= dev->caps.num_ports; port++) { 946 for (port = 1; port <= dev->caps.num_ports; port++) {
947 enum mlx4_port_type port_type = 0;
948 mlx4_SENSE_PORT(dev, port, &port_type);
949 if (port_type)
950 dev->caps.port_type[port] = port_type;
947 ib_port_default_caps = 0; 951 ib_port_default_caps = 0;
948 err = mlx4_get_port_ib_caps(dev, port, &ib_port_default_caps); 952 err = mlx4_get_port_ib_caps(dev, port, &ib_port_default_caps);
949 if (err) 953 if (err)
@@ -958,6 +962,7 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
958 goto err_mcg_table_free; 962 goto err_mcg_table_free;
959 } 963 }
960 } 964 }
965 mlx4_set_port_mask(dev);
961 966
962 return 0; 967 return 0;
963 968
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
index c6d336aed2d9..e63c37d6a115 100644
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -222,7 +222,7 @@ static int existing_steering_entry(struct mlx4_dev *dev, u8 vep_num, u8 port,
222 222
223 /* the given qpn is listed as a promisc qpn 223 /* the given qpn is listed as a promisc qpn
224 * we need to add it as a duplicate to this entry 224 * we need to add it as a duplicate to this entry
225 * for future refernce */ 225 * for future references */
226 list_for_each_entry(dqp, &entry->duplicates, list) { 226 list_for_each_entry(dqp, &entry->duplicates, list) {
227 if (qpn == dqp->qpn) 227 if (qpn == dqp->qpn)
228 return 0; /* qp is already duplicated */ 228 return 0; /* qp is already duplicated */
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index c1e0e5f1bcdb..dd7d745fbab4 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -431,6 +431,8 @@ void mlx4_srq_event(struct mlx4_dev *dev, u32 srqn, int event_type);
431 431
432void mlx4_handle_catas_err(struct mlx4_dev *dev); 432void mlx4_handle_catas_err(struct mlx4_dev *dev);
433 433
434int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port,
435 enum mlx4_port_type *type);
434void mlx4_do_sense_ports(struct mlx4_dev *dev, 436void mlx4_do_sense_ports(struct mlx4_dev *dev,
435 enum mlx4_port_type *stype, 437 enum mlx4_port_type *stype,
436 enum mlx4_port_type *defaults); 438 enum mlx4_port_type *defaults);
diff --git a/drivers/net/mlx4/port.c b/drivers/net/mlx4/port.c
index eca7d8596f87..8856659fb43c 100644
--- a/drivers/net/mlx4/port.c
+++ b/drivers/net/mlx4/port.c
@@ -172,7 +172,7 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn, u8 wrap)
172 } 172 }
173 173
174 if (mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) { 174 if (mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) {
175 /* MAC already registered, increase refernce count */ 175 /* MAC already registered, increase references count */
176 ++table->refs[i]; 176 ++table->refs[i];
177 goto out; 177 goto out;
178 } 178 }
@@ -360,7 +360,7 @@ int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index)
360 if (table->refs[i] && 360 if (table->refs[i] &&
361 (vlan == (MLX4_VLAN_MASK & 361 (vlan == (MLX4_VLAN_MASK &
362 be32_to_cpu(table->entries[i])))) { 362 be32_to_cpu(table->entries[i])))) {
363 /* Vlan already registered, increase refernce count */ 363 /* Vlan already registered, increase references count */
364 *index = i; 364 *index = i;
365 ++table->refs[i]; 365 ++table->refs[i];
366 goto out; 366 goto out;
diff --git a/drivers/net/mlx4/sense.c b/drivers/net/mlx4/sense.c
index 015fbe785c13..e2337a7411d9 100644
--- a/drivers/net/mlx4/sense.c
+++ b/drivers/net/mlx4/sense.c
@@ -38,8 +38,8 @@
38 38
39#include "mlx4.h" 39#include "mlx4.h"
40 40
41static int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port, 41int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port,
42 enum mlx4_port_type *type) 42 enum mlx4_port_type *type)
43{ 43{
44 u64 out_param; 44 u64 out_param;
45 int err = 0; 45 int err = 0;