[ofa-general] cm.c and irqsave (was Re: [PATCH] ib/cm: fix stale connection detection)

Michael S. Tsirkin mst at dev.mellanox.co.il
Mon May 21 22:16:40 PDT 2007


> @@ -1295,26 +1295,29 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
>  
>  	req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad;
>  
> -	/* Check for duplicate REQ and stale connections. */
> +	/* Check for possible duplicate REQ. */
>  	spin_lock_irqsave(&cm.lock, flags);
>  	timewait_info = cm_insert_remote_id(cm_id_priv->timewait_info);

On an unrelated note, it looks like cm.c would benefit from an irqsave
diet: it seems to perform work almost exclusively from thread
context, so just spin_lock_irq is sure to be enough.

And if *everything* is done from a thread context, I think we can
go one step further and avoid disabling interrupts as well.

-- 
MST



More information about the general mailing list