[openib-general] Re: Some CM ib_destroy_cm_id errors?

Libor Michalek libor at topspin.com
Wed Jan 26 14:30:48 PST 2005


On Wed, Jan 26, 2005 at 01:08:29PM -0800, Libor Michalek wrote:
> On Wed, Jan 26, 2005 at 12:32:30PM -0800, Sean Hefty wrote:
> > Libor Michalek wrote:
> > >   I'm seeing the following errors in my log file when I try to detroy a
> > > communications identifier. In the first case it is a cm_id which has
> > > never been used, just create, a failed cm_send_req(), and a destroy. The
> > > second case is a listening cm_id which is being destroyed.
> > 
> > Not sure what is going on.  I have tests for the listen cases.  I'll 
> > run through those to make sure that they work.  (They did when I ran 
> > them last week, but I haven't re-tested with the latest code changes.)
> > 
> >  From the error, it looks like the cm_id->local_id is being set to 0. 
> > Can you verify that you don't clean the cm_id memory after it's allocated?
> 
>   It's comming back from ib_create_cm_id with a local_id of 0, which
> explains why my REPs are being dropped as well.

  Looks like the issue is with the 'struct idr' table. The way that
allocation is implemented, the communication identifier local_id
needs to be the first element in 'struct ib_cm_id' Because the 
ib_cm_id structure is cast to an int pointer into which idr_get_new_above()
writes the id.

  I moved both for readability.

-Libor

Index: infiniband/include/ib_cm.h
===================================================================
--- infiniband/include/ib_cm.h	(revision 1664)
+++ infiniband/include/ib_cm.h	(working copy)
@@ -279,14 +279,14 @@
 			     struct ib_cm_event *event);
 
 struct ib_cm_id {
+	u32			local_id;
+	u32			remote_id;
 	ib_cm_handler		cm_handler;
 	void			*context;
 	u64			service_id;
 	u64			service_mask;
 	enum ib_cm_state	state;
 	enum ib_cm_lap_state	lap_state;
-	u32			local_id;
-	u32			remote_id;
 };
 
 /**




More information about the general mailing list