diff options
author | Faisal Latif <faisal.latif@intel.com> | 2010-02-12 14:55:03 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-02-19 14:38:14 -0500 |
commit | 6e10d2e407542605b2bdca43dc88c35fa8bd24b2 (patch) | |
tree | c79261a233ea24d7b3cee6fb011a6b8f5243a8e4 /drivers/infiniband/hw | |
parent | 676ad585531e965416fd958747894541dabcec96 (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/hw')
-rw-r--r-- | drivers/infiniband/hw/nes/nes.h | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_cm.c | 8 | ||||
-rw-r--r-- | drivers/infiniband/hw/nes/nes_nic.c | 4 |
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; | |||
193 | extern u32 cm_packets_received; | 193 | extern u32 cm_packets_received; |
194 | extern u32 cm_packets_dropped; | 194 | extern u32 cm_packets_dropped; |
195 | extern u32 cm_packets_retrans; | 195 | extern u32 cm_packets_retrans; |
196 | extern u32 cm_listens_created; | 196 | extern atomic_t cm_listens_created; |
197 | extern u32 cm_listens_destroyed; | 197 | extern atomic_t cm_listens_destroyed; |
198 | extern u32 cm_backlog_drops; | 198 | extern u32 cm_backlog_drops; |
199 | extern atomic_t cm_loopbacks; | 199 | extern atomic_t cm_loopbacks; |
200 | extern atomic_t cm_nodes_created; | 200 | extern 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; | |||
67 | u32 cm_packets_retrans; | 67 | u32 cm_packets_retrans; |
68 | u32 cm_packets_created; | 68 | u32 cm_packets_created; |
69 | u32 cm_packets_received; | 69 | u32 cm_packets_received; |
70 | u32 cm_listens_created; | 70 | atomic_t cm_listens_created; |
71 | u32 cm_listens_destroyed; | 71 | atomic_t cm_listens_destroyed; |
72 | u32 cm_backlog_drops; | 72 | u32 cm_backlog_drops; |
73 | atomic_t cm_loopbacks; | 73 | atomic_t cm_loopbacks; |
74 | atomic_t cm_nodes_created; | 74 | atomic_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); |