* [PATCH ] pcnet32: Fix PCnet32 performance bug on non-coherent architecutres
@ 2007-03-06 2:13 Don Fry
2007-03-06 11:15 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Don Fry @ 2007-03-06 2:13 UTC (permalink / raw)
To: jgarzik; +Cc: netdev
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: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Don Fry <pcnet32@verizon.net>
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 36f9d98..4d94ba7 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1234,14 +1234,14 @@ static void pcnet32_rx_entry(struct net_device *dev,
skb_put(skb, pkt_len); /* Make room */
pci_dma_sync_single_for_cpu(lp->pci_dev,
lp->rx_dma_addr[entry],
- PKT_BUF_SZ - 2,
+ pkt_len,
PCI_DMA_FROMDEVICE);
eth_copy_and_sum(skb,
(unsigned char *)(lp->rx_skbuff[entry]->data),
pkt_len, 0);
pci_dma_sync_single_for_device(lp->pci_dev,
lp->rx_dma_addr[entry],
- PKT_BUF_SZ - 2,
+ pkt_len,
PCI_DMA_FROMDEVICE);
}
lp->stats.rx_bytes += skb->len;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-06 11:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-06 2:13 [PATCH ] pcnet32: Fix PCnet32 performance bug on non-coherent architecutres Don Fry
2007-03-06 11:15 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).