[ofa-general] [PATCH] IB/mlx4 mlx4_ib: eq interrupts

Eli Cohen eli at mellanox.co.il
Wed May 9 00:19:53 PDT 2007


On Tue, 2007-05-08 at 17:57 -0700, Roland Dreier wrote:
> > > @@ -249,8 +249,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)
>  > >  		}
>  > >  	}
>  > >  
>  > > -	if (eqes_found)
>  > > -		eq_set_ci(eq, 1);
>  > > +	eq_set_ci(eq, 1);
>  > >  
>  > >  	return eqes_found;
>  > >  }
> 
>  > This will not ensure arming all EQs for all interrupts and we will face
>  > the same problem of losing interrupts.
> 
> I don't understand what you mean here.  How is unconditionally arming
> the EQ at the end of mlx4_eq_int() any different from your proposed
> patch?  My change calls eq_set_ci() at the end of every call to
> mlx4_eq_int(), and your change calls eq_set_ci() after every call to
> mlx4_eq_int().  I'm probably missing something obvious, but I really
> don't see it right now.
> 

The difference between what I propose and what you propose is that my
version unconditionally arms ALL EQs regardless of whether we find any
EQEs in them while you arm only the EQs in which you find EQEs. The
justification for doing this comes from the following scenario. Suppose
we have two EQs, 0 and 1:

1. An event is generated on EQ1.
2. EQ1 posts an EQE.
3. A set interrupt message is sent. Very soon after
that ...
3. An event is generated on EQ0.
4. EQ0 posts an EQE.
5. The interrupt handler is called and does:
        a. clear interrupt
        b. poll EQ0 but there is nothing there since the EQE is not yet
in memory.
        c. poll EQ1, find an EQE, arm EQ1

Now we have an unconsumed EQE in EQ0 but it is not armed.

Remember that the same is true for Arbel but there we arm all the EQs in
a single write to the device.




More information about the general mailing list