From patchwork Wed May 16 12:50:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 914614 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="GsZeuSNb"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40mDrP43Kyz9s2R for ; Wed, 16 May 2018 22:53:25 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752925AbeEPMvf (ORCPT ); Wed, 16 May 2018 08:51:35 -0400 Received: from smtprelay6.synopsys.com ([198.182.37.59]:47559 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752914AbeEPMvd (ORCPT ); Wed, 16 May 2018 08:51:33 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id D9F551E140A for ; Wed, 16 May 2018 14:51:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1526475092; bh=HmThc0dfbbXLHNWE4tcJtsz1F7svLJeqFpSpQsXYjnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=GsZeuSNbhwFQP6QrtznTT3hpX7vzWhastpT//MsYehlAAMdHtS+wmSUw3chhZ9HsI Ds/ccbQO4XlstvhUL4P+N3VbLrxZyuI4GMv21Ylt6WCda33OJIfsWH9PYhyhA7hfSv i8cfYPnXTu9FfSLwyz2o8eITuIrVMabXu06Y4P8ASjLH3rU221vHNnJYwEoumj1Yf/ j6ZorgsSGthxb25EJWCcZvqAKym4ZsDBd3qqIpoO8KfZfTqzJEBhsT84I0c+fMW9m5 pfDxI7qkkmXyR1hpcMgC2BDfyKtmDTTUfmM9ZVo4MRgVyjma2Q4VdpM0LTZXX597Gy lPohisw+iU7UA== Received: from joabreu-VirtualBox.internal.synopsys.com (joabreu-e7440.internal.synopsys.com [10.107.19.35]) by mailhost.synopsys.com (Postfix) with ESMTP id B3DED5E33; Wed, 16 May 2018 05:51:29 -0700 (PDT) From: Jose Abreu To: netdev@vger.kernel.org Cc: Jose Abreu , "David S. Miller" , Joao Pinto , Vitor Soares , Giuseppe Cavallaro , Alexandre Torgue Subject: [PATCH v2 net-next 01/12] net: stmmac: Enable OSP for GMAC4 Date: Wed, 16 May 2018 13:50:43 +0100 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This enables OSP (Operate on Second Packet) for GMAC4. The feature allows DMA to fetch second descriptor while its still processing the first one. Running iperf, the performance gain is +/- 38%. Signed-off-by: Jose Abreu Cc: David S. Miller Cc: Joao Pinto Cc: Vitor Soares Cc: Giuseppe Cavallaro Cc: Alexandre Torgue --- drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c index 117c3a5..9aab5b3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c @@ -94,6 +94,10 @@ static void dwmac4_dma_init_tx_chan(void __iomem *ioaddr, value = readl(ioaddr + DMA_CHAN_TX_CONTROL(chan)); value = value | (txpbl << DMA_BUS_MODE_PBL_SHIFT); + + /* Enable OSP to get best performance */ + value |= DMA_CONTROL_OSP; + writel(value, ioaddr + DMA_CHAN_TX_CONTROL(chan)); writel(dma_tx_phy, ioaddr + DMA_CHAN_TX_BASE_ADDR(chan));