aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 17:50:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-22 17:50:12 -0400
commitece236ce2fad9c27a6fd2530f899289025194bce (patch)
tree474b793205872206a2a3f7d409ff9b1f81f3a9a8 /drivers/infiniband/hw/mlx4/main.c
parent441c196e84b11aad3123baa9320eee7abc6b5c98 (diff)
parent4460207561290c3be7e6c7538f22690028170c1d (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (26 commits) IB/qib: Defer HCA error events to tasklet mlx4_core: Bump the driver version to 1.0 RDMA/cxgb4: Use printk_ratelimited() instead of printk_ratelimit() IB/mlx4: Support PMA counters for IBoE IB/mlx4: Use flow counters on IBoE ports IB/pma: Add include file for IBA performance counters definitions mlx4_core: Add network flow counters mlx4_core: Fix location of counter index in QP context struct mlx4_core: Read extended capabilities into the flags field mlx4_core: Extend capability flags to 64 bits IB/mlx4: Generate GID change events in IBoE code IB/core: Add GID change event RDMA/cma: Don't allow IPoIB port space for IBoE RDMA: Allow for NULL .modify_device() and .modify_port() methods IB/qib: Update active link width IB/qib: Fix potential deadlock with link down interrupt IB/qib: Add sysfs interface to read free contexts IB/mthca: Remove unnecessary read of PCI_CAP_ID_EXP IB/qib: Remove double define IB/qib: Remove unnecessary read of PCI_CAP_ID_EXP ...
Diffstat (limited to 'drivers/infiniband/hw/mlx4/main.c')
-rw-r--r--drivers/infiniband/hw/mlx4/main.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index fbe1973f77b0..fa643f4f4e28 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -816,7 +816,7 @@ static void update_gids_task(struct work_struct *work)
816 memcpy(gw->dev->iboe.gid_table[gw->port - 1], gw->gids, sizeof gw->gids); 816 memcpy(gw->dev->iboe.gid_table[gw->port - 1], gw->gids, sizeof gw->gids);
817 event.device = &gw->dev->ib_dev; 817 event.device = &gw->dev->ib_dev;
818 event.element.port_num = gw->port; 818 event.element.port_num = gw->port;
819 event.event = IB_EVENT_LID_CHANGE; 819 event.event = IB_EVENT_GID_CHANGE;
820 ib_dispatch_event(&event); 820 ib_dispatch_event(&event);
821 } 821 }
822 822
@@ -1098,11 +1098,21 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
1098 if (init_node_data(ibdev)) 1098 if (init_node_data(ibdev))
1099 goto err_map; 1099 goto err_map;
1100 1100
1101 for (i = 0; i < ibdev->num_ports; ++i) {
1102 if (mlx4_ib_port_link_layer(&ibdev->ib_dev, i + 1) ==
1103 IB_LINK_LAYER_ETHERNET) {
1104 err = mlx4_counter_alloc(ibdev->dev, &ibdev->counters[i]);
1105 if (err)
1106 ibdev->counters[i] = -1;
1107 } else
1108 ibdev->counters[i] = -1;
1109 }
1110
1101 spin_lock_init(&ibdev->sm_lock); 1111 spin_lock_init(&ibdev->sm_lock);
1102 mutex_init(&ibdev->cap_mask_mutex); 1112 mutex_init(&ibdev->cap_mask_mutex);
1103 1113
1104 if (ib_register_device(&ibdev->ib_dev, NULL)) 1114 if (ib_register_device(&ibdev->ib_dev, NULL))
1105 goto err_map; 1115 goto err_counter;
1106 1116
1107 if (mlx4_ib_mad_init(ibdev)) 1117 if (mlx4_ib_mad_init(ibdev))
1108 goto err_reg; 1118 goto err_reg;
@@ -1132,6 +1142,10 @@ err_notif:
1132err_reg: 1142err_reg:
1133 ib_unregister_device(&ibdev->ib_dev); 1143 ib_unregister_device(&ibdev->ib_dev);
1134 1144
1145err_counter:
1146 for (; i; --i)
1147 mlx4_counter_free(ibdev->dev, ibdev->counters[i - 1]);
1148
1135err_map: 1149err_map:
1136 iounmap(ibdev->uar_map); 1150 iounmap(ibdev->uar_map);
1137 1151
@@ -1160,7 +1174,8 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)
1160 ibdev->iboe.nb.notifier_call = NULL; 1174 ibdev->iboe.nb.notifier_call = NULL;
1161 } 1175 }
1162 iounmap(ibdev->uar_map); 1176 iounmap(ibdev->uar_map);
1163 1177 for (p = 0; p < ibdev->num_ports; ++p)
1178 mlx4_counter_free(ibdev->dev, ibdev->counters[p]);
1164 mlx4_foreach_port(p, dev, MLX4_PORT_TYPE_IB) 1179 mlx4_foreach_port(p, dev, MLX4_PORT_TYPE_IB)
1165 mlx4_CLOSE_PORT(dev, p); 1180 mlx4_CLOSE_PORT(dev, p);
1166 1181