From patchwork Tue Jun 2 09:23:13 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Petrilin X-Patchwork-Id: 27942 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id CBC85B707C for ; Tue, 2 Jun 2009 18:32:51 +1000 (EST) Received: by ozlabs.org (Postfix) id BD143DDDF8; Tue, 2 Jun 2009 18:32:51 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 489E0DDDF7 for ; Tue, 2 Jun 2009 18:32:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757123AbZFBIcj (ORCPT ); Tue, 2 Jun 2009 04:32:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757875AbZFBIci (ORCPT ); Tue, 2 Jun 2009 04:32:38 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:40021 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1760172AbZFBIcc (ORCPT ); Tue, 2 Jun 2009 04:32:32 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yevgenyp@mellanox.co.il) with SMTP; 2 Jun 2009 11:32:31 +0300 Received: from sw275.lab.mtl.com ([10.4.12.75]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Jun 2009 11:32:30 +0300 Message-ID: <4A24EF81.4060104@mellanox.co.il> Date: Tue, 02 Jun 2009 12:23:13 +0300 From: Yevgeny Petrilin User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: David Miller CC: netdev@vger.kernel.org, Tziporet Koren Subject: [PATCH 5/8] mlx4_en: Coalescing target is equal for all mtu's References: <4A0AB34A.10100@mellanox.co.il><4A1948D7.8010504@mellanox.co.il><4A1A57AA.1080209@mellanox.co.il> <20090525.014435.203274473.davem@davemloft.net> In-Reply-To: <20090525.014435.203274473.davem@davemloft.net> X-OriginalArrivalTime: 02 Jun 2009 08:32:30.0652 (UTC) FILETIME=[AB425FC0:01C9E35C] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-5.600.1016-16678.005 X-TM-AS-Result: No-1.614900-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The interrupt moderation should not depend on number of incoming bytes, but on number of incoming packets. The previous scheme caused very high interrupts rate for small messages when big MTU was configured. Signed-off-by: Yevgeny Petrilin --- drivers/net/mlx4/en_ethtool.c | 3 +-- drivers/net/mlx4/en_netdev.c | 2 +- drivers/net/mlx4/mlx4_en.h | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx4/en_ethtool.c b/drivers/net/mlx4/en_ethtool.c index 91d8116..091f990 100644 --- a/drivers/net/mlx4/en_ethtool.c +++ b/drivers/net/mlx4/en_ethtool.c @@ -268,8 +268,7 @@ static int mlx4_en_set_coalesce(struct net_device *dev, priv->rx_frames = (coal->rx_max_coalesced_frames == MLX4_EN_AUTO_CONF) ? - MLX4_EN_RX_COAL_TARGET / - priv->dev->mtu + 1 : + MLX4_EN_RX_COAL_TARGET : coal->rx_max_coalesced_frames; priv->rx_usecs = (coal->rx_coalesce_usecs == MLX4_EN_AUTO_CONF) ? diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index fea65e7..16a634f 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c @@ -372,7 +372,7 @@ static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv) * satisfy our coelsing target. * - moder_time is set to a fixed value. */ - priv->rx_frames = MLX4_EN_RX_COAL_TARGET / priv->dev->mtu + 1; + priv->rx_frames = MLX4_EN_RX_COAL_TARGET; priv->rx_usecs = MLX4_EN_RX_COAL_TIME; en_dbg(INTR, priv, "Default coalesing params for mtu:%d - " "rx_frames:%d rx_usecs:%d\n", diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h index 174ae86..fcbfcfc 100644 --- a/drivers/net/mlx4/mlx4_en.h +++ b/drivers/net/mlx4/mlx4_en.h @@ -143,8 +143,8 @@ enum { #define MLX4_EN_DEF_TX_RING_SIZE 1024 #define MLX4_EN_DEF_RX_RING_SIZE 1024 -/* Target number of bytes to coalesce with interrupt moderation */ -#define MLX4_EN_RX_COAL_TARGET 0x20000 +/* Target number of packets to coalesce with interrupt moderation */ +#define MLX4_EN_RX_COAL_TARGET 44 #define MLX4_EN_RX_COAL_TIME 0x10 #define MLX4_EN_TX_COAL_PKTS 5