Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933335AbcK3Wsr (ORCPT ); Wed, 30 Nov 2016 17:48:47 -0500 Received: from mout.gmx.net ([212.227.15.18]:63494 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754505AbcK3Wso (ORCPT ); Wed, 30 Nov 2016 17:48:44 -0500 From: Lino Sanfilippo To: vbridger@opensource.altera.com Cc: nios2-dev@lists.rocketboards.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Lino Sanfilippo Subject: [PATCH 1/2] net: ethernet: altera: TSE: Remove unneeded dma sync for tx buffers Date: Wed, 30 Nov 2016 23:48:31 +0100 Message-Id: <1480546112-3099-1-git-send-email-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 1.9.1 X-Provags-ID: V03:K0:w/aSttRD1iTFNS+2Q1FCOaS9aNMcwb/qV0+toXAJ1dN1wszRwuW /dwJVtgFdicQTCOmSd9/iobVR5czN8j+pRVfRLQ3CTQ1MfV5rALDk5XdLNOnyz3gL6X2K4P ptSOj2G6+41HrNNgG5IZKBoud6lxRC0SWVfkuZ1MFSyQb0mwowELEnuHA4ucSphKPiCmhHc +z6usDf0Mr/fqE68SkXbw== X-UI-Out-Filterresults: notjunk:1;V01:K0:MitjeMs6k2M=:oA78iJuc9eoz0KGX66HEqE bWjWTaxg0rltEDOPW+U2ulIpwsDvECMMGl+8Q+dWmE/3YIAM93SBdD1aesrSUHdhGE+385px4 5SND0RhT8gAUtqd6jecmIqpmKV7n3zyfjmmzCSkN4Qh25Iwa3D0WtYniMKmvzDzykTyKP49J6 zkXPTvjPkU7jwa9Nivl9UaSDspTLmKiNs55W1NhMCzP88rUTsw3TcDdD9OHWqVvv4oxde/ASL 62CBnX//tXvuDVQ8v/VUQXVDRWiG0ZwpkmnKXTAt2qoF9SocKdSzjKJmG9v66iEaXybtLU1Dp mR1Y1gCbYSZI/t4sJZlAoutpdUnrlQDa4oC5AWNMbbFAqQL+NrKTf1ZA/EyFyReO3XNnom4sq Sad6Tl3Uw2RZ2/MjQavKmDhLv9MwxF7O9SSqfjKFR5OxcObpVTUiGc/cXvRZ8UPoi5YmOfnBJ CcTUQ/eL6ElW/nw46KM+pcL5nzVZUiyCSB5D0YrA428AdyPmm3nw4KDhGgCRH7rViniK29ic3 bsRhUWlc3X+uCngRO1h+rlomdDdKorxHTqCEjaArhaANApgprFSHWwFlARjvpbdr0D6W5bQJR iaGeDEnl9ECzEDjIhwoS9j0vo1/UFXSrTR2BjQKxtvCJdEB3r8Cfq27g4mzjrLedKrHCfqsmJ oC/K/3cIOcg6yzGYT/JKAa4creEhIO2l77O3p5+okbtkeOSPI5GS/sxBdcQ8WCouw5suTkMGl ZDBzHKcd/b+f51yUZGRjhdPV1K7p0+kTA8O7vH113a6qi482NFx7ZsdV1Rg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1497 Lines: 42 An explicit dma sync for device directly after mapping as well as an explicit dma sync for cpu directly before unmapping is unnecessary and costly on the hotpath. So remove these calls. Signed-off-by: Lino Sanfilippo --- drivers/net/ethernet/altera/altera_tse_main.c | 10 ---------- 1 file changed, 10 deletions(-) Please note that this is only compile tested since I do not have the concerning hardware. diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index bda31f3..16c4163 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -400,12 +400,6 @@ static int tse_rx(struct altera_tse_private *priv, int limit) skb_put(skb, pktlength); - /* make cache consistent with receive packet buffer */ - dma_sync_single_for_cpu(priv->device, - priv->rx_ring[entry].dma_addr, - priv->rx_ring[entry].len, - DMA_FROM_DEVICE); - dma_unmap_single(priv->device, priv->rx_ring[entry].dma_addr, priv->rx_ring[entry].len, DMA_FROM_DEVICE); @@ -592,10 +586,6 @@ static int tse_start_xmit(struct sk_buff *skb, struct net_device *dev) buffer->dma_addr = dma_addr; buffer->len = nopaged_len; - /* Push data out of the cache hierarchy into main memory */ - dma_sync_single_for_device(priv->device, buffer->dma_addr, - buffer->len, DMA_TO_DEVICE); - priv->dmaops->tx_buffer(priv, buffer); skb_tx_timestamp(skb); -- 2.7.4