Commit 3e4b32e1 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] sky2: interrupt/poll optimization

Optimize poll routine by not clearing interrupt till after
processing, and checking for more work before re-enable.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent af2a58ac
...@@ -1736,7 +1736,6 @@ static int sky2_poll(struct net_device *dev0, int *budget) ...@@ -1736,7 +1736,6 @@ static int sky2_poll(struct net_device *dev0, int *budget)
u16 hwidx; u16 hwidx;
u16 tx_done[2] = { TX_NO_STATUS, TX_NO_STATUS }; u16 tx_done[2] = { TX_NO_STATUS, TX_NO_STATUS };
sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
hwidx = sky2_read16(hw, STAT_PUT_IDX); hwidx = sky2_read16(hw, STAT_PUT_IDX);
BUG_ON(hwidx >= STATUS_RING_SIZE); BUG_ON(hwidx >= STATUS_RING_SIZE);
rmb(); rmb();
...@@ -1754,8 +1753,6 @@ static int sky2_poll(struct net_device *dev0, int *budget) ...@@ -1754,8 +1753,6 @@ static int sky2_poll(struct net_device *dev0, int *budget)
hw->st_idx = (hw->st_idx + 1) % STATUS_RING_SIZE; hw->st_idx = (hw->st_idx + 1) % STATUS_RING_SIZE;
prefetch(hw->st_le + hw->st_idx); prefetch(hw->st_le + hw->st_idx);
BUG_ON(le->link >= hw->ports || !hw->dev[le->link]);
BUG_ON(le->link >= 2); BUG_ON(le->link >= 2);
dev = hw->dev[le->link]; dev = hw->dev[le->link];
if (dev == NULL || !netif_running(dev)) if (dev == NULL || !netif_running(dev))
...@@ -1821,12 +1818,13 @@ static int sky2_poll(struct net_device *dev0, int *budget) ...@@ -1821,12 +1818,13 @@ static int sky2_poll(struct net_device *dev0, int *budget)
} }
exit_loop: exit_loop:
sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
mmiowb(); mmiowb();
sky2_tx_check(hw, 0, tx_done[0]); sky2_tx_check(hw, 0, tx_done[0]);
sky2_tx_check(hw, 1, tx_done[1]); sky2_tx_check(hw, 1, tx_done[1]);
if (work_done < to_do) { if (sky2_read16(hw, STAT_PUT_IDX) == hw->st_idx) {
/* need to restart TX timer */ /* need to restart TX timer */
if (is_ec_a1(hw)) { if (is_ec_a1(hw)) {
sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP); sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
......
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