[PATCH 01/02] RDMA/nes: atomic counters for cm listener create and destroy

2010-02-12 Thread Faisal Latif
Running long hour iterative MPI tests, sometimes ethtool statistics
CM Destroy Listener count is more than CM Create Listener.
This inconsistency is fixed by making counter variable atomic.

Signed-off-by: Faisal Latif faisal.la...@intel.com
---
 drivers/infiniband/hw/nes/nes.h |4 ++--
 drivers/infiniband/hw/nes/nes_cm.c  |8 
 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 9884056..cffdac4 100644
--- a/drivers/infiniband/hw/nes/nes.h
+++ b/drivers/infiniband/hw/nes/nes.h
@@ -193,8 +193,8 @@ extern u32 cm_packets_created;
 extern u32 cm_packets_received;
 extern u32 cm_packets_dropped;
 extern u32 cm_packets_retrans;
-extern u32 cm_listens_created;
-extern u32 cm_listens_destroyed;
+extern atomic_t cm_listens_created;
+extern atomic_t cm_listens_destroyed;
 extern u32 cm_backlog_drops;
 extern atomic_t cm_loopbacks;
 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 39468c2..debd92c 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;
 u32 cm_packets_retrans;
 u32 cm_packets_created;
 u32 cm_packets_received;
-u32 cm_listens_created;
-u32 cm_listens_destroyed;
+atomic_t cm_listens_created;
+atomic_t cm_listens_destroyed;
 u32 cm_backlog_drops;
 atomic_t cm_loopbacks;
 atomic_t cm_nodes_created;
@@ -1042,7 +1042,7 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core 
*cm_core,
kfree(listener);
listener = NULL;
ret = 0;
-   cm_listens_destroyed++;
+   atomic_inc(cm_listens_destroyed);
} else {
spin_unlock_irqrestore(cm_core-listen_list_lock, flags);
}
@@ -3172,7 +3172,7 @@ int nes_create_listen(struct iw_cm_id *cm_id, int backlog)
g_cm_core-api-stop_listener(g_cm_core, (void 
*)cm_node);
return err;
}
-   cm_listens_created++;
+   atomic_inc(cm_listens_created);
}
 
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 ab11027..3d550dc 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,
target_stat_values[++index] = cm_packets_received;
target_stat_values[++index] = cm_packets_dropped;
target_stat_values[++index] = cm_packets_retrans;
-   target_stat_values[++index] = cm_listens_created;
-   target_stat_values[++index] = cm_listens_destroyed;
+   target_stat_values[++index] = atomic_read(cm_listens_created);
+   target_stat_values[++index] = atomic_read(cm_listens_destroyed);
target_stat_values[++index] = cm_backlog_drops;
target_stat_values[++index] = atomic_read(cm_loopbacks);
target_stat_values[++index] = atomic_read(cm_nodes_created);
-- 
1.5.3.3

--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/02] RDMA/nes: listener destroyed during loopback setup crash

2010-02-12 Thread Faisal Latif
When listener is destroyed and where is MPA response pending for
loopback connection, the active side cm_node gets destroyed in
cm_event_connect_error() and again in nes_accept()/nes_reject().
Incrementing cm_node's refcount to not be destroyed by cm_event_connect_error().

Signed-off-by: Faisal Latif faisal.la...@intel.com
---
 drivers/infiniband/hw/nes/nes_cm.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_cm.c 
b/drivers/infiniband/hw/nes/nes_cm.c
index debd92c..2a49ee4 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1011,9 +1011,10 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core 
*cm_core,
event.cm_info.loc_port =
 loopback-loc_port;
event.cm_info.cm_id = loopback-cm_id;
+   add_ref_cm_node(loopback);
+   loopback-state = NES_CM_STATE_CLOSED;
cm_event_connect_error(event);
cm_node-state = 
NES_CM_STATE_LISTENER_DESTROYED;
-   loopback-state = NES_CM_STATE_CLOSED;
 
rem_ref_cm_node(cm_node-cm_core,
 cm_node);
-- 
1.5.3.3

--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 02/02] RDMA/nes: listener destroyed during loopback setup crash

2010-02-12 Thread Sean Hefty
@@ -1011,9 +1011,10 @@ static int mini_cm_dec_refcnt_listen(struct nes_cm_core
*cm_core,
   event.cm_info.loc_port =
loopback-loc_port;
   event.cm_info.cm_id = loopback-cm_id;
+  add_ref_cm_node(loopback);
+  loopback-state = NES_CM_STATE_CLOSED;

It seems odd to increment a reference count in a function with the name
'dec_refcnt'.  Is there a better name for mini_cm_dec_refcnt_listen?

--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] mlx4_ib: simplify retrieval of ib_device

2010-02-12 Thread Roland Dreier
thanks, applied
-- 
Roland Dreier  rola...@cisco.com
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] ib/ehca: allow access for ib_query_qp()

2010-02-12 Thread Roland Dreier
applied 1  2, thanks
-- 
Roland Dreier  rola...@cisco.com
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html