History

net: ethernet: altera: TSE: Remove unneeded dma sync for tx buffers

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.

Lino Sanfilippo committed 9 years ago

Commit 151a14d1 parent d262fd11 file · +0 −10Browse files

Unified · Split

drivers/net/ethernet/altera/altera_tse_main.c+0−10
@@ -400,12 +400,6 @@ static int tse_rx(struct altera_tse_private *priv, int limit) · 399 unmodified lines
400 400
401 skb_put(skb, pktlength);401 skb_put(skb, pktlength);
402 402
403 /* make cache consistent with receive packet buffer */
404 dma_sync_single_for_cpu(priv->device,
405 priv->rx_ring[entry].dma_addr,
406 priv->rx_ring[entry].len,
407 DMA_FROM_DEVICE);
408
409 dma_unmap_single(priv->device, priv->rx_ring[entry].dma_addr,403 dma_unmap_single(priv->device, priv->rx_ring[entry].dma_addr,
410 priv->rx_ring[entry].len, DMA_FROM_DEVICE);404 priv->rx_ring[entry].len, DMA_FROM_DEVICE);
411 405
@@ -592,10 +586,6 @@ static int tse_start_xmit(struct sk_buff *skb, struct net_device *dev) · 180 unmodified lines
592 buffer->dma_addr = dma_addr;586 buffer->dma_addr = dma_addr;
593 buffer->len = nopaged_len;587 buffer->len = nopaged_len;
594 588
595 /* Push data out of the cache hierarchy into main memory */
596 dma_sync_single_for_device(priv->device, buffer->dma_addr,
597 buffer->len, DMA_TO_DEVICE);
598
599 priv->dmaops->tx_buffer(priv, buffer);589 priv->dmaops->tx_buffer(priv, buffer);
600 590
601 skb_tx_timestamp(skb);591 skb_tx_timestamp(skb);