Commit b2cbbd8e authored by Don Fry's avatar Don Fry Committed by Jeff Garzik

pcnet32: Fix PCnet32 performance bug on non-coherent architecutres

The PCnet32 driver always passed the the size of the largest possible packet
to the pci_dma_sync_single_for_cpu and pci_dma_sync_single_for_device.
This results in a fairly large "colateral damage" in the caches and makes
the flush operation itself much slower.  On a system with a 40MHz CPU this
patch increases network bandwidth by about 12%.
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
Acked-by: default avatarDon Fry <pcnet32@verizon.net>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 4c44fd00
...@@ -1234,14 +1234,14 @@ static void pcnet32_rx_entry(struct net_device *dev, ...@@ -1234,14 +1234,14 @@ static void pcnet32_rx_entry(struct net_device *dev,
skb_put(skb, pkt_len); /* Make room */ skb_put(skb, pkt_len); /* Make room */
pci_dma_sync_single_for_cpu(lp->pci_dev, pci_dma_sync_single_for_cpu(lp->pci_dev,
lp->rx_dma_addr[entry], lp->rx_dma_addr[entry],
PKT_BUF_SZ - 2, pkt_len,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
eth_copy_and_sum(skb, eth_copy_and_sum(skb,
(unsigned char *)(lp->rx_skbuff[entry]->data), (unsigned char *)(lp->rx_skbuff[entry]->data),
pkt_len, 0); pkt_len, 0);
pci_dma_sync_single_for_device(lp->pci_dev, pci_dma_sync_single_for_device(lp->pci_dev,
lp->rx_dma_addr[entry], lp->rx_dma_addr[entry],
PKT_BUF_SZ - 2, pkt_len,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
} }
lp->stats.rx_bytes += skb->len; lp->stats.rx_bytes += skb->len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment