net/mlx4_en: Fix adaptive moderation cq update
authorSagi Grimberg <sagig@mellanox.co.il>
Tue, 4 Jun 2013 05:13:26 +0000 (05:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Jun 2013 19:58:24 +0000 (12:58 -0700)
When turning on adaptive_rx under adaptive moderation, the CQ's moderation
count wasn't updated according to rx_frames which resulted in too many
interrupts and bandwidth drop.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c

index b35f9470009363bad560f7142322436baa76d8a3..810aab01c3c903ffd07d6989be1c6001086c6938 100644 (file)
@@ -1323,6 +1323,7 @@ static void mlx4_en_auto_moderation(struct mlx4_en_priv *priv)
                        priv->last_moder_time[ring] = moder_time;
                        cq = &priv->rx_cq[ring];
                        cq->moder_time = moder_time;
+                       cq->moder_cnt = priv->rx_frames;
                        err = mlx4_en_set_cq_moder(priv, cq);
                        if (err)
                                en_err(priv, "Failed modifying moderation for cq:%d\n",