From patchwork Wed Jul 6 02:18:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 9215335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A8676048B for ; Wed, 6 Jul 2016 02:18:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AA37285A4 for ; Wed, 6 Jul 2016 02:18:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D78C285A6; Wed, 6 Jul 2016 02:18:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C039E285A4 for ; Wed, 6 Jul 2016 02:18:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bKcOS-0004OQ-IQ; Wed, 06 Jul 2016 02:16:52 +0000 Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bKcON-0004MB-VB for linux-arm-kernel@lists.infradead.org; Wed, 06 Jul 2016 02:16:49 +0000 Received: by mail-lf0-x231.google.com with SMTP id f6so145881660lfg.0 for ; Tue, 05 Jul 2016 19:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=/0kyohtg5EuOacYeO28iJ2GOHY0JyE+a0Ynh4lYmXfo=; b=ZbWjwDNFuG8abY+ByrBudbHSItMta9Pdv5585jM3Iq9k0zG9XjvXriv4uMHUVCzz9D 2C+23/xcG2u+wHKwh3+8TMIZ89RDga8F+Hld3YVCv+gUeGDebTqVb4VkAUZwRAjN+/Iv OPTwQaz6+ofs2pg52vErPqlN3ZQeNEU6fLmucx1HA7wS5Yr0KnHR3GqX1hQoW83CkM2b Hnd3G5hn/FL/3l8zU4vubsH5sDzSPqdFtZfK1Ka8R5Fm9CzBZrKob5qyzldtt0+GFYC8 +RFgUmnOuhFQ+sLZjS2fE7rRTN7HOOGn5rdaSv9JDpnpBEYGbDETWygLO0xa8rYgjNo5 2cDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/0kyohtg5EuOacYeO28iJ2GOHY0JyE+a0Ynh4lYmXfo=; b=HReHKkLYUQUV5x7RpjNjVeoHDRavW6ppIBEOHgmAMMaKWrKh3wuJQaFeRe3YMWY21R iGU4BX/H5YdpYfkZOxYycbeAdXfzEhd8TE2caUJOhRkebuuK27twhDGTq/GnGZ0BWtje EsClTI1ck7nWRIWr5UBacrYDx3KoPsu88RQ/CVt/ukoa6Z6VzEsrx9nGqReCJKa5G2Tr nDC+X1RALRKKCmQBWn1pDKN6KdkRdPOg5wWcmMLCB7jJFTKVQBCeNg5YNm0woD6Vb2x1 JPRM+7QQyHvfsMFt14VXhU4sJV3PvUDkGHxhHhEsQ6mwwaWzT1HyIIbNHO3FsmMTJ8PH JgiQ== X-Gm-Message-State: ALyK8tIhFafvrUELZU7yMRqrmzYmmER24VIE5mPpo0xbeLlSz2tPWc0deoFf02zvjj2/Pg== X-Received: by 10.25.41.65 with SMTP id p62mr6077015lfp.7.1467771384923; Tue, 05 Jul 2016 19:16:24 -0700 (PDT) Received: from enkidu.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id n72sm5974652lfi.39.2016.07.05.19.16.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jul 2016 19:16:24 -0700 (PDT) From: Marcin Wojtas To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH net] net: mvneta: set real interrupt per packet for tx_done Date: Wed, 6 Jul 2016 04:18:58 +0200 Message-Id: <1467771538-31811-1-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160705_191648_200548_109DA0BF X-CRM114-Status: UNSURE ( 8.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thomas.petazzoni@free-electrons.com, andrew@lunn.ch, linux@arm.linux.org.uk, jason@lakedaemon.net, jaz@semihalf.com, stable@vger.kernel.org, Dmitri Epshtein , nadavh@marvell.com, alior@marvell.com, gregory.clement@free-electrons.com, nitroshift@yahoo.com, mw@semihalf.com, davem@davemloft.net, sebastian.hesselbarth@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitri Epshtein Commit aebea2ba0f74 ("net: mvneta: fix Tx interrupt delay") intended to set coalescing threshold to a value guaranteeing interrupt generation per each sent packet, so that buffers can be released with no delay. In fact setting threshold to '1' was wrong, because it causes interrupt every two packets. According to the documentation a reason behind it is following - interrupt occurs once sent buffers counter reaches a value, which is higher than one specified in MVNETA_TXQ_SIZE_REG(q). This behavior was confirmed during tests. Also when testing the SoC working as a NAS device, better performance was observed with int-per-packet, as it strongly depends on the fact that all transmitted packets are released immediately. This commit enables NETA controller work in interrupt per sent packet mode by setting coalescing threshold to 0. Signed-off-by: Dmitri Epshtein Signed-off-by: Marcin Wojtas Cc: # v3.10+ Fixes aebea2ba0f74 ("net: mvneta: fix Tx interrupt delay") Acked-by: Willy Tarreau --- drivers/net/ethernet/marvell/mvneta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index cf04c97..0ad2fa3 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -244,7 +244,7 @@ /* Various constants */ /* Coalescing */ -#define MVNETA_TXDONE_COAL_PKTS 1 +#define MVNETA_TXDONE_COAL_PKTS 0 /* interrupt per packet */ #define MVNETA_RX_COAL_PKTS 32 #define MVNETA_RX_COAL_USEC 100