diff options
author | Olof Johansson <olof@lixom.net> | 2007-11-28 21:57:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:04:24 -0500 |
commit | 906674abab0424b466a2db4bb6a890a8c477b10a (patch) | |
tree | 967cf65374d0fe39e4c8b83ddb6f68479bf30d50 /drivers/net | |
parent | 61cec3bddc79373a246e2f8eb13e5acdc106f46a (diff) |
pasemi_mac: Improve RX interrupt mitigation
pasemi_mac: Improve RX interrupt mitigation
Currently the receive side interrupts will go off on the reception of
a packet, NAPI will poll the ring and keep polling as long as there's
a decent amount of packets to receive.
This is less than optimal, especially for LRO where it's better if we
have a more substantial amount of packets to process at once, to get
the real LRO benefits.
So, set the count threshold to a higher value and use the timeout feature
that will give us an interrupt even if not enough packets have come in
to set off the count threshold.
FIXME: It'd be real nice to have ethtool support for users to tune this
at runtime.
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/pasemi_mac.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 683e8de0ac89..e78aac488f3c 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -504,15 +504,19 @@ static void pasemi_mac_replenish_rx_ring(const struct net_device *dev, | |||
504 | 504 | ||
505 | static void pasemi_mac_restart_rx_intr(const struct pasemi_mac *mac) | 505 | static void pasemi_mac_restart_rx_intr(const struct pasemi_mac *mac) |
506 | { | 506 | { |
507 | struct pasemi_mac_rxring *rx = rx_ring(mac); | ||
507 | unsigned int reg, pcnt; | 508 | unsigned int reg, pcnt; |
508 | /* Re-enable packet count interrupts: finally | 509 | /* Re-enable packet count interrupts: finally |
509 | * ack the packet count interrupt we got in rx_intr. | 510 | * ack the packet count interrupt we got in rx_intr. |
510 | */ | 511 | */ |
511 | 512 | ||
512 | pcnt = *rx_ring(mac)->chan.status & PAS_STATUS_PCNT_M; | 513 | pcnt = *rx->chan.status & PAS_STATUS_PCNT_M; |
513 | 514 | ||
514 | reg = PAS_IOB_DMA_RXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_RXCH_RESET_PINTC; | 515 | reg = PAS_IOB_DMA_RXCH_RESET_PCNT(pcnt) | PAS_IOB_DMA_RXCH_RESET_PINTC; |
515 | 516 | ||
517 | if (*rx->chan.status & PAS_STATUS_TIMER) | ||
518 | reg |= PAS_IOB_DMA_RXCH_RESET_TINTC; | ||
519 | |||
516 | write_iob_reg(PAS_IOB_DMA_RXCH_RESET(mac->rx->chan.chno), reg); | 520 | write_iob_reg(PAS_IOB_DMA_RXCH_RESET(mac->rx->chan.chno), reg); |
517 | } | 521 | } |
518 | 522 | ||
@@ -795,8 +799,6 @@ static irqreturn_t pasemi_mac_rx_intr(int irq, void *data) | |||
795 | reg |= PAS_IOB_DMA_RXCH_RESET_SINTC; | 799 | reg |= PAS_IOB_DMA_RXCH_RESET_SINTC; |
796 | if (*chan->status & PAS_STATUS_ERROR) | 800 | if (*chan->status & PAS_STATUS_ERROR) |
797 | reg |= PAS_IOB_DMA_RXCH_RESET_DINTC; | 801 | reg |= PAS_IOB_DMA_RXCH_RESET_DINTC; |
798 | if (*chan->status & PAS_STATUS_TIMER) | ||
799 | reg |= PAS_IOB_DMA_RXCH_RESET_TINTC; | ||
800 | 802 | ||
801 | netif_rx_schedule(dev, &mac->napi); | 803 | netif_rx_schedule(dev, &mac->napi); |
802 | 804 | ||
@@ -972,10 +974,6 @@ static int pasemi_mac_open(struct net_device *dev) | |||
972 | 974 | ||
973 | write_mac_reg(mac, PAS_MAC_CFG_TXP, flags); | 975 | write_mac_reg(mac, PAS_MAC_CFG_TXP, flags); |
974 | 976 | ||
975 | /* 0xffffff is max value, about 16ms */ | ||
976 | write_iob_reg(PAS_IOB_DMA_COM_TIMEOUTCFG, | ||
977 | PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT(0xffffff)); | ||
978 | |||
979 | ret = pasemi_mac_setup_rx_resources(dev); | 977 | ret = pasemi_mac_setup_rx_resources(dev); |
980 | if (ret) | 978 | if (ret) |
981 | goto out_rx_resources; | 979 | goto out_rx_resources; |
@@ -985,8 +983,12 @@ static int pasemi_mac_open(struct net_device *dev) | |||
985 | if (!mac->tx) | 983 | if (!mac->tx) |
986 | goto out_tx_ring; | 984 | goto out_tx_ring; |
987 | 985 | ||
986 | /* 0x3ff with 33MHz clock is about 31us */ | ||
987 | write_iob_reg(PAS_IOB_DMA_COM_TIMEOUTCFG, | ||
988 | PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT(0x3ff)); | ||
989 | |||
988 | write_iob_reg(PAS_IOB_DMA_RXCH_CFG(mac->rx->chan.chno), | 990 | write_iob_reg(PAS_IOB_DMA_RXCH_CFG(mac->rx->chan.chno), |
989 | PAS_IOB_DMA_RXCH_CFG_CNTTH(0)); | 991 | PAS_IOB_DMA_RXCH_CFG_CNTTH(128)); |
990 | 992 | ||
991 | write_iob_reg(PAS_IOB_DMA_TXCH_CFG(mac->tx->chan.chno), | 993 | write_iob_reg(PAS_IOB_DMA_TXCH_CFG(mac->tx->chan.chno), |
992 | PAS_IOB_DMA_TXCH_CFG_CNTTH(32)); | 994 | PAS_IOB_DMA_TXCH_CFG_CNTTH(32)); |