Message ID | 20100428112528.01277670@nehalam |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Stephen Hemminger <shemminger@vyatta.com> Date: Wed, 28 Apr 2010 11:25:28 -0700 > The following does the same thing without the extra overhead > of testing all the registers. It also handles the out of memory > case. > > Compile tested only... > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Tom can you test this version? -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Apr 28, 2010 at 2:25 PM, David Miller <davem@davemloft.net> wrote: > From: Stephen Hemminger <shemminger@vyatta.com> > Date: Wed, 28 Apr 2010 11:25:28 -0700 > >> The following does the same thing without the extra overhead >> of testing all the registers. It also handles the out of memory >> case. >> >> Compile tested only... >> >> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> > > Tom can you test this version? > Looks good. 406038 tps in my quick test which still is showing the benefits. Thanks for cleaning this up Stephen! Tom -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Tom Herbert <therbert@google.com> Date: Wed, 28 Apr 2010 16:56:30 -0700 > On Wed, Apr 28, 2010 at 2:25 PM, David Miller <davem@davemloft.net> wrote: >> From: Stephen Hemminger <shemminger@vyatta.com> >> Date: Wed, 28 Apr 2010 11:25:28 -0700 >> >>> The following does the same thing without the extra overhead >>> of testing all the registers. It also handles the out of memory >>> case. >>> >>> Compile tested only... >>> >>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> >> >> Tom can you test this version? >> > > Looks good. 406038 tps in my quick test which still is showing the > benefits. Thanks for cleaning this up Stephen! Thanks for testing, applied, thanks everyone. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/drivers/net/forcedeth.c 2010-04-28 11:14:29.784799317 -0700 +++ b/drivers/net/forcedeth.c 2010-04-28 11:23:53.254354744 -0700 @@ -3743,23 +3743,26 @@ static int nv_napi_poll(struct napi_stru u8 __iomem *base = get_hwbase(dev); unsigned long flags; int retcode; - int tx_work, rx_work; + int rx_count, tx_work=0, rx_work=0; - if (!nv_optimized(np)) { - spin_lock_irqsave(&np->lock, flags); - tx_work = nv_tx_done(dev, np->tx_ring_size); - spin_unlock_irqrestore(&np->lock, flags); + do { + if (!nv_optimized(np)) { + spin_lock_irqsave(&np->lock, flags); + tx_work += nv_tx_done(dev, np->tx_ring_size); + spin_unlock_irqrestore(&np->lock, flags); - rx_work = nv_rx_process(dev, budget); - retcode = nv_alloc_rx(dev); - } else { - spin_lock_irqsave(&np->lock, flags); - tx_work = nv_tx_done_optimized(dev, np->tx_ring_size); - spin_unlock_irqrestore(&np->lock, flags); + rx_count = nv_rx_process(dev, budget); + retcode = nv_alloc_rx(dev); + } else { + spin_lock_irqsave(&np->lock, flags); + tx_work += nv_tx_done_optimized(dev, np->tx_ring_size); + spin_unlock_irqrestore(&np->lock, flags); - rx_work = nv_rx_process_optimized(dev, budget); - retcode = nv_alloc_rx_optimized(dev); - } + rx_count = nv_rx_process_optimized(dev, budget); + retcode = nv_alloc_rx_optimized(dev); + } + } while (retcode == 0 && + rx_count > 0 && (rx_work += rx_count) < budget); if (retcode) { spin_lock_irqsave(&np->lock, flags);
The following does the same thing without the extra overhead of testing all the registers. It also handles the out of memory case. Compile tested only... Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html