diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-01-17 03:51:00 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-01-17 03:51:00 +0000 |
commit | ad24ab1198401680a8b0e037663d2b5799de2c99 (patch) | |
tree | 46ccd80a8e5c4d3ff3e788f9bb28edc0d78bd9fa | |
parent | 344bbcdf5c42ce2f5f9a97170c85440279f3b9c9 (diff) |
Optimize alignment of received buffers such that we don't take insane
piles of address error exceptions due to bad alignment any longer.
This results in a considerable performance boost.
-rw-r--r-- | drivers/net/ioc3-eth.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index 870cc56ea..126ef69f1 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c @@ -115,7 +115,7 @@ struct ioc3_private { /* BEWARE: The IOC3 documentation documents the size of rx buffers as 1644 while it's actually 1664. This one was nasty to track down ... */ -#define RX_OFFSET 8 +#define RX_OFFSET 10 #define RX_BUF_ALLOC_SIZE (1664 + RX_OFFSET + 128) /* DMA barrier to separate cached and uncached accesses. */ @@ -314,7 +314,7 @@ ioc3_rx(struct net_device *dev, struct ioc3_private *ip, struct ioc3 *ioc3) n_entry = ip->rx_pi; skb = ip->rx_skbs[rx_entry]; - rxb = (struct ioc3_erxbuf *) (skb->data - sizeof(struct ioc3_erxbuf)); + rxb = (struct ioc3_erxbuf *) (skb->data - RX_OFFSET); w0 = rxb->w0; while (w0 & ERXBUF_V) { @@ -374,8 +374,7 @@ next: /* Now go on to the next ring entry. */ rx_entry = (rx_entry + 1) & 511; skb = ip->rx_skbs[rx_entry]; - rxb = (struct ioc3_erxbuf *) (skb->data - - sizeof(struct ioc3_erxbuf)); + rxb = (struct ioc3_erxbuf *) (skb->data - RX_OFFSET); w0 = rxb->w0; } ip->rx_pi = n_entry; @@ -651,8 +650,8 @@ ioc3_open(struct net_device *dev) //ioc3_eth_init(dev, p, ioc3); - ioc3->emcr = (4 << EMCR_RXOFF_SHIFT) | EMCR_TXDMAEN | EMCR_TXEN - | EMCR_RXDMAEN | EMCR_RXEN; + ioc3->emcr = ((RX_OFFSET / 2) << EMCR_RXOFF_SHIFT) | EMCR_TXDMAEN | + EMCR_TXEN | EMCR_RXDMAEN | EMCR_RXEN; ioc3->eier = EISR_RXTIMERINT | EISR_TXEXPLICIT; /* Interrupts ... */ dev->tbusy = 0; |