aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorFaisal Latif <faisal.latif@intel.com>2010-02-12 14:55:03 -0500
committerRoland Dreier <rolandd@cisco.com>2010-02-19 14:38:14 -0500
commit6e10d2e407542605b2bdca43dc88c35fa8bd24b2 (patch)
treec79261a233ea24d7b3cee6fb011a6b8f5243a8e4 /drivers/infiniband
parent676ad585531e965416fd958747894541dabcec96 (diff)
RDMA/nes: Use atomic counters for CM listener create and destroy
After running long iterative MPI tests, sometimes ethtool reports a "CM Destroy Listener" count more than the "CM Create Listener" count. This inconsistency is fixed by making counter variables atomic. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/nes/nes.h4
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c8
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h
index 98840564bb2f..cffdac4a899f 100644
--- a/drivers/infiniband/hw/nes/nes.h
+++ b/drivers/infiniband/hw/nes/nes.h
@@ -193,8 +193,8 @@ extern u32 cm_packets_created;
193extern u32 cm_packets_received; 193extern u32 cm_packets_received;
194extern u32 cm_packets_dropped; 194extern u32 cm_packets_dropped;
195extern u32 cm_packets_retrans; 195extern u32 cm_packets_retrans;
196extern u32 cm_listens_created; 196extern atomic_t cm_listens_created;
197extern u32 cm_listens_destroyed; 197extern atomic_t cm_listens_destroyed;
198extern u32 cm_backlog_drops; 198extern u32 cm_backlog_drops;
199extern atomic_t cm_loopbacks; 199extern atomic_t cm_loopbacks;
200extern atomic_t cm_nodes_created; 200extern atomic_t cm_nodes_created;
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 39468c277036..debd92c53d89 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -67,8 +67,8 @@ u32 cm_packets_dropped;
67u32 cm_packets_retrans; 67u32 cm_packets_retrans;
68u32 cm_packets_created; 68u32 cm_packets_created;
69u32 cm_packets_received; 69u32 cm_packets_received;
70u32 cm_listens_created; 70atomic_t cm_listens_created;
71u32 cm_listens_destroyed; 71atomic_t cm_listens_destroyed;
72u32 cm_backlog_drops; 72u32 cm_backlog_drops;
73atomic_t cm_loopbacks; 73atomic_t cm_loopbacks;
74atomic_t cm_nodes_created; 74atomic_t cm_nodes_created;
@@ -1042,7 +1042,7 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core *cm_core,
1042 kfree(listener); 1042 kfree(listener);
1043 listener = NULL; 1043 listener = NULL;
1044 ret = 0; 1044 ret = 0;
1045 cm_listens_destroyed++; 1045 atomic_inc(&cm_listens_destroyed);
1046 } else { 1046 } else {
1047 spin_unlock_irqrestore(&cm_core->listen_list_lock, flags); 1047 spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
1048 } 1048 }
@@ -3172,7 +3172,7 @@ int nes_create_listen(struct iw_cm_id *cm_id, int backlog)
3172 g_cm_core->api->stop_listener(g_cm_core, (void *)cm_node); 3172 g_cm_core->api->stop_listener(g_cm_core, (void *)cm_node);
3173 return err; 3173 return err;
3174 } 3174 }
3175 cm_listens_created++; 3175 atomic_inc(&cm_listens_created);
3176 } 3176 }
3177 3177
3178 cm_id->add_ref(cm_id); 3178 cm_id->add_ref(cm_id);
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index ab1102780186..3d550dc77d0d 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -1230,8 +1230,8 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev,
1230 target_stat_values[++index] = cm_packets_received; 1230 target_stat_values[++index] = cm_packets_received;
1231 target_stat_values[++index] = cm_packets_dropped; 1231 target_stat_values[++index] = cm_packets_dropped;
1232 target_stat_values[++index] = cm_packets_retrans; 1232 target_stat_values[++index] = cm_packets_retrans;
1233 target_stat_values[++index] = cm_listens_created; 1233 target_stat_values[++index] = atomic_read(&cm_listens_created);
1234 target_stat_values[++index] = cm_listens_destroyed; 1234 target_stat_values[++index] = atomic_read(&cm_listens_destroyed);
1235 target_stat_values[++index] = cm_backlog_drops; 1235 target_stat_values[++index] = cm_backlog_drops;
1236 target_stat_values[++index] = atomic_read(&cm_loopbacks); 1236 target_stat_values[++index] = atomic_read(&cm_loopbacks);
1237 target_stat_values[++index] = atomic_read(&cm_nodes_created); 1237 target_stat_values[++index] = atomic_read(&cm_nodes_created);