From patchwork Mon Apr 8 12:10:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuseppe CAVALLARO X-Patchwork-Id: 234752 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0C6E42C00F8 for ; Mon, 8 Apr 2013 22:10:45 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935506Ab3DHMKk (ORCPT ); Mon, 8 Apr 2013 08:10:40 -0400 Received: from eu1sys200aog114.obsmtp.com ([207.126.144.137]:42000 "EHLO eu1sys200aog114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935417Ab3DHMKj (ORCPT ); Mon, 8 Apr 2013 08:10:39 -0400 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob114.postini.com ([207.126.147.11]) with SMTP ID DSNKUWKzvIQEZZoGQau1nUHynE8+d9I5wCSP@postini.com; Mon, 08 Apr 2013 12:10:39 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C9932B6; Mon, 8 Apr 2013 12:10:35 +0000 (GMT) Received: from mail7.sgp.st.com (unknown [164.129.223.81]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9CEDA4CF0; Mon, 8 Apr 2013 12:10:35 +0000 (GMT) Received: from localhost (lxmcdt5.ctn.st.com [164.130.129.175]) by mail7.sgp.st.com (MOS 4.3.3-GA) with ESMTP id BBC55715 (AUTH cavagiu); Mon, 8 Apr 2013 14:10:35 +0200 From: Giuseppe CAVALLARO To: netdev@vger.kernel.org Cc: eric.dumazet@gmail.com, bhutchings@solarflare.com, shiraz.hashim@st.com, Giuseppe Cavallaro Subject: [net-next.git 5/5] stmmac: prefetch all dma_erx when use extend_desc Date: Mon, 8 Apr 2013 14:10:03 +0200 Message-Id: <1365423003-23959-6-git-send-email-peppe.cavallaro@st.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1365423003-23959-1-git-send-email-peppe.cavallaro@st.com> References: <1365423003-23959-1-git-send-email-peppe.cavallaro@st.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch is to prefetch, in the stmmac_rx, the whole dma_erx descriptor in case of using the extended descriptors. Signed-off-by: Giuseppe Cavallaro --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 5d336e7..384fc90 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2004,7 +2004,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit) #endif while (count < limit) { int status; - struct dma_desc *p, *p_next; + struct dma_desc *p; if (priv->extend_desc) p = (struct dma_desc *)(priv->dma_erx + entry); @@ -2018,12 +2018,9 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit) next_entry = (++priv->cur_rx) % rxsize; if (priv->extend_desc) - p_next = (struct dma_desc *)(priv->dma_erx + - next_entry); + prefetch(priv->dma_erx + next_entry); else - p_next = priv->dma_rx + next_entry; - - prefetch(p_next); + prefetch(priv->dma_rx + next_entry); /* read the status of the incoming frame */ status = priv->hw->desc->rx_status(&priv->dev->stats,