* [patch 09/11] forcedeth: improve NAPI logic
@ 2007-04-26 7:23 akpm
2007-04-26 14:30 ` Ayaz Abdulla
2007-04-28 0:10 ` Jeff Garzik
0 siblings, 2 replies; 8+ messages in thread
From: akpm @ 2007-04-26 7:23 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, mingo, aabdulla
From: Ingo Molnar <mingo@elte.hu>
Another forcedeth.c thing: i noticed that its NAPI handler does not do
tx-ring processing. The patch below implements this - tested on DESC_VER_2
hardware, with CONFIG_FORCEDETH_NAPI=y.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/forcedeth.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff -puN drivers/net/forcedeth.c~forcedeth-improve-napi-logic drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-improve-napi-logic
+++ a/drivers/net/forcedeth.c
@@ -3108,9 +3108,17 @@ static int nv_napi_poll(struct net_devic
int retcode;
if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) {
+ spin_lock_irqsave(&np->lock, flags);
+ nv_tx_done(dev);
+ spin_unlock_irqrestore(&np->lock, flags);
+
pkts = nv_rx_process(dev, limit);
retcode = nv_alloc_rx(dev);
} else {
+ spin_lock_irqsave(&np->lock, flags);
+ nv_tx_done_optimized(dev, np->tx_ring_size);
+ spin_unlock_irqrestore(&np->lock, flags);
+
pkts = nv_rx_process_optimized(dev, limit);
retcode = nv_alloc_rx_optimized(dev);
}
_
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 09/11] forcedeth: improve NAPI logic
2007-04-26 7:23 [patch 09/11] forcedeth: improve NAPI logic akpm
@ 2007-04-26 14:30 ` Ayaz Abdulla
2007-04-26 18:24 ` Jeff Garzik
2007-04-28 0:10 ` Jeff Garzik
1 sibling, 1 reply; 8+ messages in thread
From: Ayaz Abdulla @ 2007-04-26 14:30 UTC (permalink / raw)
To: akpm; +Cc: jeff, netdev, mingo
I don't see why the NAPI handler needs to process tx packets. The ISR
will handle all tx processing.
akpm@linux-foundation.org wrote:
> From: Ingo Molnar <mingo@elte.hu>
>
> Another forcedeth.c thing: i noticed that its NAPI handler does not do
> tx-ring processing. The patch below implements this - tested on DESC_VER_2
> hardware, with CONFIG_FORCEDETH_NAPI=y.
>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> Cc: Ayaz Abdulla <aabdulla@nvidia.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/net/forcedeth.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff -puN drivers/net/forcedeth.c~forcedeth-improve-napi-logic drivers/net/forcedeth.c
> --- a/drivers/net/forcedeth.c~forcedeth-improve-napi-logic
> +++ a/drivers/net/forcedeth.c
> @@ -3108,9 +3108,17 @@ static int nv_napi_poll(struct net_devic
> int retcode;
>
> if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) {
> + spin_lock_irqsave(&np->lock, flags);
> + nv_tx_done(dev);
> + spin_unlock_irqrestore(&np->lock, flags);
> +
> pkts = nv_rx_process(dev, limit);
> retcode = nv_alloc_rx(dev);
> } else {
> + spin_lock_irqsave(&np->lock, flags);
> + nv_tx_done_optimized(dev, np->tx_ring_size);
> + spin_unlock_irqrestore(&np->lock, flags);
> +
> pkts = nv_rx_process_optimized(dev, limit);
> retcode = nv_alloc_rx_optimized(dev);
> }
> _
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 09/11] forcedeth: improve NAPI logic
2007-04-26 18:24 ` Jeff Garzik
@ 2007-04-26 14:53 ` Ayaz Abdulla
2007-04-27 12:27 ` Jeff Garzik
2007-04-27 18:57 ` Lennart Sorensen
0 siblings, 2 replies; 8+ messages in thread
From: Ayaz Abdulla @ 2007-04-26 14:53 UTC (permalink / raw)
To: Jeff Garzik; +Cc: akpm, netdev, mingo
Jeff Garzik wrote:
> Ayaz Abdulla wrote:
>
>> I don't see why the NAPI handler needs to process tx packets. The ISR
>> will handle all tx processing.
>
>
> It is a design choice, not a requirement.
>
> Moving non-RX interrupt processing to the NAPI handler can help as loads
> increase. The basic idea is to do as much work as possible in the NAPI
> handler with NIC interrupts masked. That mitigates global system
> per-interrupt overhead even more than an only-RX NAPI scheme.
>
> Several net drivers do TX completion handling in the NAPI handler.
Ok. In that case, the patch needs to be improved.
The following needs to be done when NAPI is enabled:
- remove the tx handling within the ISRs
- mask off the tx interrupts within the ISRs that handle tx processing
- re-enable tx interrupts within the NAPI handler
- add tx handling within the NAPI handler (this patch covers it)
>
> Jeff
>
>
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 09/11] forcedeth: improve NAPI logic
2007-04-26 14:30 ` Ayaz Abdulla
@ 2007-04-26 18:24 ` Jeff Garzik
2007-04-26 14:53 ` Ayaz Abdulla
0 siblings, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2007-04-26 18:24 UTC (permalink / raw)
To: Ayaz Abdulla; +Cc: akpm, netdev, mingo
Ayaz Abdulla wrote:
> I don't see why the NAPI handler needs to process tx packets. The ISR
> will handle all tx processing.
It is a design choice, not a requirement.
Moving non-RX interrupt processing to the NAPI handler can help as loads
increase. The basic idea is to do as much work as possible in the NAPI
handler with NIC interrupts masked. That mitigates global system
per-interrupt overhead even more than an only-RX NAPI scheme.
Several net drivers do TX completion handling in the NAPI handler.
Jeff
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 09/11] forcedeth: improve NAPI logic
2007-04-26 14:53 ` Ayaz Abdulla
@ 2007-04-27 12:27 ` Jeff Garzik
2007-04-27 18:57 ` Lennart Sorensen
1 sibling, 0 replies; 8+ messages in thread
From: Jeff Garzik @ 2007-04-27 12:27 UTC (permalink / raw)
To: Ayaz Abdulla; +Cc: akpm, netdev, mingo
Ayaz Abdulla wrote:
>
>
> Jeff Garzik wrote:
>> Ayaz Abdulla wrote:
>>
>>> I don't see why the NAPI handler needs to process tx packets. The ISR
>>> will handle all tx processing.
>>
>>
>> It is a design choice, not a requirement.
>>
>> Moving non-RX interrupt processing to the NAPI handler can help as
>> loads increase. The basic idea is to do as much work as possible in
>> the NAPI handler with NIC interrupts masked. That mitigates global
>> system per-interrupt overhead even more than an only-RX NAPI scheme.
>>
>> Several net drivers do TX completion handling in the NAPI handler.
>
> Ok. In that case, the patch needs to be improved.
>
> The following needs to be done when NAPI is enabled:
> - remove the tx handling within the ISRs
> - mask off the tx interrupts within the ISRs that handle tx processing
> - re-enable tx interrupts within the NAPI handler
> - add tx handling within the NAPI handler (this patch covers it)
Agreed.
Jeff
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 09/11] forcedeth: improve NAPI logic
2007-04-26 14:53 ` Ayaz Abdulla
2007-04-27 12:27 ` Jeff Garzik
@ 2007-04-27 18:57 ` Lennart Sorensen
1 sibling, 0 replies; 8+ messages in thread
From: Lennart Sorensen @ 2007-04-27 18:57 UTC (permalink / raw)
To: Ayaz Abdulla; +Cc: Jeff Garzik, akpm, netdev, mingo
On Thu, Apr 26, 2007 at 10:53:04AM -0400, Ayaz Abdulla wrote:
> Ok. In that case, the patch needs to be improved.
>
> The following needs to be done when NAPI is enabled:
> - remove the tx handling within the ISRs
> - mask off the tx interrupts within the ISRs that handle tx processing
> - re-enable tx interrupts within the NAPI handler
> - add tx handling within the NAPI handler (this patch covers it)
I thought a number of drivers handled tx from napi while receives were
happening, but went to plain interrupts if no receives were happening.
Maybe I misread the code (I have mainly dealt with pcnet32 so far).
Certainly for gigabit I would think napi all the time would be much more
efficient.
--
Len Sorensen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 09/11] forcedeth: improve NAPI logic
2007-04-26 7:23 [patch 09/11] forcedeth: improve NAPI logic akpm
2007-04-26 14:30 ` Ayaz Abdulla
@ 2007-04-28 0:10 ` Jeff Garzik
2007-04-28 0:25 ` Andrew Morton
1 sibling, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2007-04-28 0:10 UTC (permalink / raw)
To: akpm; +Cc: netdev, mingo, aabdulla
akpm@linux-foundation.org wrote:
> From: Ingo Molnar <mingo@elte.hu>
>
> Another forcedeth.c thing: i noticed that its NAPI handler does not do
> tx-ring processing. The patch below implements this - tested on DESC_VER_2
> hardware, with CONFIG_FORCEDETH_NAPI=y.
>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> Cc: Ayaz Abdulla <aabdulla@nvidia.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/net/forcedeth.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
See thread comments -- this patch should be expanded.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 09/11] forcedeth: improve NAPI logic
2007-04-28 0:10 ` Jeff Garzik
@ 2007-04-28 0:25 ` Andrew Morton
0 siblings, 0 replies; 8+ messages in thread
From: Andrew Morton @ 2007-04-28 0:25 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev, mingo, aabdulla
On Fri, 27 Apr 2007 20:10:54 -0400
Jeff Garzik <jeff@garzik.org> wrote:
> akpm@linux-foundation.org wrote:
> > From: Ingo Molnar <mingo@elte.hu>
> >
> > Another forcedeth.c thing: i noticed that its NAPI handler does not do
> > tx-ring processing. The patch below implements this - tested on DESC_VER_2
> > hardware, with CONFIG_FORCEDETH_NAPI=y.
> >
> > Signed-off-by: Ingo Molnar <mingo@elte.hu>
> > Cc: Ayaz Abdulla <aabdulla@nvidia.com>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > ---
> >
> > drivers/net/forcedeth.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
>
> See thread comments -- this patch should be expanded.
>
yeah, I added the comments to the changelog for you all to read next
time I send it ;)
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-04-28 0:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-26 7:23 [patch 09/11] forcedeth: improve NAPI logic akpm
2007-04-26 14:30 ` Ayaz Abdulla
2007-04-26 18:24 ` Jeff Garzik
2007-04-26 14:53 ` Ayaz Abdulla
2007-04-27 12:27 ` Jeff Garzik
2007-04-27 18:57 ` Lennart Sorensen
2007-04-28 0:10 ` Jeff Garzik
2007-04-28 0:25 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).