aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-05-17 17:37:06 -0400
committerJeff Garzik <jeff@garzik.org>2006-05-20 00:15:39 -0400
commit86fba6342dee30a1533b14da284d79e4eb66de26 (patch)
tree1ec4d7f2b874baa2f2548ed05ee4ab232b181c0f
parent86a31a759f2117816b8c78a049c41ead3ef9ef1c (diff)
[PATCH] sky2: force NAPI repoll if busy
If the status ring processing can't keep up with the incoming frames, it is more efficient to have NAPI keep scheduling the poll routine rather than causing another interrupt. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/sky2.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index bb185e5efa35..9729062d1fbb 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1919,6 +1919,12 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
1919 } 1919 }
1920} 1920}
1921 1921
1922/* Is status ring empty or is there more to do? */
1923static inline int sky2_more_work(const struct sky2_hw *hw)
1924{
1925 return (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX));
1926}
1927
1922/* Process status response ring */ 1928/* Process status response ring */
1923static int sky2_status_intr(struct sky2_hw *hw, int to_do) 1929static int sky2_status_intr(struct sky2_hw *hw, int to_do)
1924{ 1930{
@@ -2191,19 +2197,19 @@ static int sky2_poll(struct net_device *dev0, int *budget)
2191 if (status & Y2_IS_CHK_TXA2) 2197 if (status & Y2_IS_CHK_TXA2)
2192 sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2); 2198 sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2);
2193 2199
2194 if (status & Y2_IS_STAT_BMU)
2195 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
2196
2197 work_done = sky2_status_intr(hw, work_limit); 2200 work_done = sky2_status_intr(hw, work_limit);
2198 *budget -= work_done; 2201 *budget -= work_done;
2199 dev0->quota -= work_done; 2202 dev0->quota -= work_done;
2200 2203
2201 if (work_done >= work_limit) 2204 if (status & Y2_IS_STAT_BMU)
2205 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
2206
2207 if (sky2_more_work(hw))
2202 return 1; 2208 return 1;
2203 2209
2204 netif_rx_complete(dev0); 2210 netif_rx_complete(dev0);
2205 2211
2206 status = sky2_read32(hw, B0_Y2_SP_LISR); 2212 sky2_read32(hw, B0_Y2_SP_LISR);
2207 return 0; 2213 return 0;
2208} 2214}
2209 2215