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

Sean Hefty mshefty at ichips.intel.com
Wed Jan 26 15:55:07 PST 2005


On Wed, 26 Jan 2005 14:30:48 -0800
Libor Michalek <libor at topspin.com> wrote:

> >   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.

Thanks for looking into this more.  I'm not sure how this worked before.
Were these just warnings in the log file?

I think a slightly better solution is to set the local_id directly,
rather than relying on it being the first entry in the cm_id.  Can you
try with this patch in place of yours?

Thanks,
Sean

Index: core/cm.c
===================================================================
--- core/cm.c	(revision 1665)
+++ core/cm.c	(working copy)
@@ -280,7 +280,7 @@ static int cm_alloc_id(struct cm_id_priv
 	do {
 		spin_lock_irqsave(&cm.lock, flags);
 		ret = idr_get_new_above(&cm.local_id_table, cm_id_priv, 1,
-					(int *) &cm_id_priv->id);
+					(int *) &cm_id_priv->id.local_id);
 		spin_unlock_irqrestore(&cm.lock, flags);
 	} while( (ret == -EAGAIN) && idr_pre_get(&cm.local_id_table, GFP_KERNEL) );
 	return ret;





More information about the general mailing list