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

Eli Cohen eli at mellanox.co.il
Mon May 7 23:47:26 PDT 2007


On Mon, 2007-05-07 at 09:40 -0700, Roland Dreier wrote:
> Thanks... should we optimize out the
> 
> 	if (eqes_found)
> 		eq_set_ci(eq, 1);
> 
> at the end of mlx4_eq_int() now?
I think we should


>   Actually the best fix is probably:
> 
> diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
> index 8d641b8..acf1c80 100644
> --- a/drivers/net/mlx4/eq.c
> +++ b/drivers/net/mlx4/eq.c
> @@ -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.

Index: connectx_kernel/drivers/net/mlx4/eq.c
===================================================================
--- connectx_kernel.orig/drivers/net/mlx4/eq.c	2007-05-06 17:34:12.000000000 +0300
+++ connectx_kernel/drivers/net/mlx4/eq.c	2007-05-08 09:37:50.000000000 +0300
@@ -256,9 +256,6 @@ static int mlx4_eq_int(struct mlx4_dev *
 		}
 	}
 
-	if (eqes_found)
-		eq_set_ci(eq, 1);
-
 	return eqes_found;
 }
 
@@ -266,13 +263,17 @@ static irqreturn_t mlx4_interrupt(int ir
 {
 	struct mlx4_dev *dev = dev_ptr;
 	struct mlx4_priv *priv = mlx4_priv(dev);
+	struct mlx4_eq *eq;
 	int work = 0;
 	int i;
 
 	writel(priv->eq_table.clr_mask, priv->eq_table.clr_int);
 
-	for (i = 0; i < MLX4_EQ_CATAS; ++i)
-		work |= mlx4_eq_int(dev, &priv->eq_table.eq[i]);
+	for (i = 0; i < MLX4_EQ_CATAS; ++i) {
+		eq = &priv->eq_table.eq[i];
+		work |= mlx4_eq_int(dev, eq);
+		eq_set_ci(eq, 1);
+	}
 
 	return IRQ_RETVAL(work);
 }
@@ -283,6 +284,7 @@ static irqreturn_t mlx4_msi_x_interrupt(
 	struct mlx4_dev *dev = eq->dev;
 
 	mlx4_eq_int(dev, eq);
+	eq_set_ci(eq, 1);
 
 	/* MSI-X vectors always belong to us */
 	return IRQ_HANDLED;


> because it seems sort of strange if we ever don't rearm the EQ on an
> MSI-X interrupt.
> 
> What do you think?

Actually I think the following patch can do the work and is similar to
what we did for mthca/Hermon



> 
> On the other hand, this patch (and your patch) rearms the EQ on shared
> interrupts for other devices too.  Can't be helped I guess.
> 
>  - R.
> 



More information about the general mailing list