From patchwork Sun Nov 22 07:53:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Wojtas X-Patchwork-Id: 7675561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AFBE7BF90C for ; Sun, 22 Nov 2015 07:58:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3DF020653 for ; Sun, 22 Nov 2015 07:58:12 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id F08F52064F for ; Sun, 22 Nov 2015 07:58:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a0PUG-0000WH-JF; Sun, 22 Nov 2015 07:55:04 +0000 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a0PTU-0008TD-BB for linux-arm-kernel@lists.infradead.org; Sun, 22 Nov 2015 07:54:17 +0000 Received: by lfdl133 with SMTP id l133so10117894lfd.2 for ; Sat, 21 Nov 2015 23:53:54 -0800 (PST) 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:in-reply-to:references; bh=Vz43JvDNolIlUHa3PbXip2iZ1RuonKx/SKB0tBcKYHI=; b=zMfGFURnPvwD+zOy0MfqOSnH5ui1RkufFAUZ4hoVKhxPtB6tiy6x00oLey8M2hh2p5 OCE4kYVSb2tvXT1g7X8c5t1UAjeqbwECjBzya1gMCjcItDrau/7iN+XOtRtw7jYkBf/m CW2JbakIBz7yPIfg0cFIcGJ1zgrG16wPbU7mk11PVhM4ckUN+si1eVwexLQMaODjSlf5 E8RB43rErez+k3A5izg93pJhAOYJ/1+FROagryg4KpTzpJs3bSDSDWAzb1kFQvi9LPkf mad8lOg28DNYsMCfBGxPKO2bJgih6j8mVc73drmdSv7LkTc666FTvfZUu1IczOESpvVc ndOg== 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:in-reply-to :references; bh=Vz43JvDNolIlUHa3PbXip2iZ1RuonKx/SKB0tBcKYHI=; b=aPj1e4hfzx87V6F9VDXRpOeo1fkWgstmFxXELv1FWV06DNxa2ZfyAMi/DMhy9HukTu /6ylJiqF//i8r2LxPnfwSRaNoBQtNEFaOAxFdXz7jDR4GOgEmBwz6HNg76Kgl5ly88u8 /79RV+BzatQZWz7sHV1gIbwIOD5WGjzW5iU+jJGzkxi+Xo0l43n5Tx4Cgx+gHI/Mx/Zv U/R3Mdh9pNdp+e/BRpEoARjukM440zi5ztH5W+cFxnyd894i+/cSH6SSxAGK1TlifMoE +qOS9t5TkHUvM89ScUroi7u3v8POmKPBqQBZeWUNB/sEmrOtRU/luDmBgqJi3kTzUKB1 ai/A== X-Gm-Message-State: ALoCoQmHoow+cDAM74cwrgWqePkoaeDe3a0GLTWDB0Yen3Eq+19dXVcWyUxSarZ6+Ho5Y9AI0n0u X-Received: by 10.25.135.195 with SMTP id j186mr7582044lfd.141.1448178834874; Sat, 21 Nov 2015 23:53:54 -0800 (PST) Received: from enkidu.semihalf.local (cardhu.semihalf.com. [213.17.239.108]) by smtp.gmail.com with ESMTPSA id y79sm1010840lfd.45.2015.11.21.23.53.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Nov 2015 23:53:54 -0800 (PST) From: Marcin Wojtas To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH 05/13] net: mvneta: add xmit_more support Date: Sun, 22 Nov 2015 08:53:51 +0100 Message-Id: <1448178839-3541-6-git-send-email-mw@semihalf.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1448178839-3541-1-git-send-email-mw@semihalf.com> References: <1448178839-3541-1-git-send-email-mw@semihalf.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151121_235416_704937_DE63F630 X-CRM114-Status: GOOD ( 12.12 ) X-Spam-Score: -2.6 (--) 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, myair@marvell.com, jaz@semihalf.com, simon.guinot@sequanux.org, xswang@marvell.com, nadavh@marvell.com, alior@marvell.com, tn@semihalf.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-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Simon Guinot Basing on xmit_more flag of the skb, TX descriptors can be concatenated before flushing. This commit delay Tx descriptor flush if the queue is running and if there is more skb's to send. Signed-off-by: Simon Guinot --- drivers/net/ethernet/marvell/mvneta.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index f079b13..9c9e858 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -467,6 +467,7 @@ struct mvneta_tx_queue { * descriptor ring */ int count; + int pending; int tx_stop_threshold; int tx_wake_threshold; @@ -751,8 +752,9 @@ static void mvneta_txq_pend_desc_add(struct mvneta_port *pp, /* Only 255 descriptors can be added at once ; Assume caller * process TX desriptors in quanta less than 256 */ - val = pend_desc; + val = pend_desc + txq->pending; mvreg_write(pp, MVNETA_TXQ_UPDATE_REG(txq->id), val); + txq->pending = 0; } /* Get pointer to next TX descriptor to be processed (send) by HW */ @@ -1857,11 +1859,14 @@ out: struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id); txq->count += frags; - mvneta_txq_pend_desc_add(pp, txq, frags); - if (txq->count >= txq->tx_stop_threshold) netif_tx_stop_queue(nq); + if (!skb->xmit_more || netif_xmit_stopped(nq)) + mvneta_txq_pend_desc_add(pp, txq, frags); + else + txq->pending += frags; + u64_stats_update_begin(&stats->syncp); stats->tx_packets++; stats->tx_bytes += len;