* netif_receive_skb_list and interrupts enabled/disabled
@ 2019-03-26 20:04 Heiner Kallweit
2019-03-27 8:20 ` Jesper Dangaard Brouer
0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2019-03-26 20:04 UTC (permalink / raw)
To: Edward Cree, Jesper Dangaard Brouer; +Cc: netdev@vger.kernel.org
A question inspired by 0a25d92c6f4f ("dpaa2-eth: use netif_receive_skb_list"):
kerneldoc of netif_receive_skb_list states that interrupts should be
enabled. When used from NAPI context irqs typically are disabled.
And if the NAPI budget is fully consumed then interrupts don't get enabled
in the same NAPI poll loop. How is this supposed to play together?
Thanks, Heiner
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: netif_receive_skb_list and interrupts enabled/disabled
2019-03-26 20:04 netif_receive_skb_list and interrupts enabled/disabled Heiner Kallweit
@ 2019-03-27 8:20 ` Jesper Dangaard Brouer
2019-03-27 18:55 ` Heiner Kallweit
0 siblings, 1 reply; 3+ messages in thread
From: Jesper Dangaard Brouer @ 2019-03-27 8:20 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Edward Cree, netdev@vger.kernel.org, brouer
On Tue, 26 Mar 2019 21:04:09 +0100
Heiner Kallweit <hkallweit1@gmail.com> wrote:
> A question inspired by 0a25d92c6f4f ("dpaa2-eth: use netif_receive_skb_list"):
> kerneldoc of netif_receive_skb_list states that interrupts should be
> enabled.
Do notice that the exact same comment (and rule) applies to
netif_receive_skb() which also have below comment:
/* [...]
* This function may only be called from softirq context and interrupts
* should be enabled.
*/
> When used from NAPI context irqs typically are disabled.
> And if the NAPI budget is fully consumed then interrupts don't get enabled
> in the same NAPI poll loop. How is this supposed to play together?
You have misunderstood that is means that interrupts should be
enabled. It is talking about local_irq_disable/enable and
local_irq_save/restore. This is different from disabling the IRQs on a
given NIC RX-queue.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: netif_receive_skb_list and interrupts enabled/disabled
2019-03-27 8:20 ` Jesper Dangaard Brouer
@ 2019-03-27 18:55 ` Heiner Kallweit
0 siblings, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2019-03-27 18:55 UTC (permalink / raw)
To: Jesper Dangaard Brouer; +Cc: Edward Cree, netdev@vger.kernel.org
On 27.03.2019 09:20, Jesper Dangaard Brouer wrote:
> On Tue, 26 Mar 2019 21:04:09 +0100
> Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
>> A question inspired by 0a25d92c6f4f ("dpaa2-eth: use netif_receive_skb_list"):
>> kerneldoc of netif_receive_skb_list states that interrupts should be
>> enabled.
>
> Do notice that the exact same comment (and rule) applies to
> netif_receive_skb() which also have below comment:
>
> /* [...]
> * This function may only be called from softirq context and interrupts
> * should be enabled.
> */
>
>> When used from NAPI context irqs typically are disabled.
>> And if the NAPI budget is fully consumed then interrupts don't get enabled
>> in the same NAPI poll loop. How is this supposed to play together?
>
> You have misunderstood that is means that interrupts should be
> enabled. It is talking about local_irq_disable/enable and
> local_irq_save/restore. This is different from disabling the IRQs on a
> given NIC RX-queue.
>
Uh, you're right of course, my bad. One more question because this part
of the network stack was beyond my horizon so far.
The referenced patch replaces a number of calls to napi_gro_receive()
with a call to netif_receive_skb_list(). In a follow-up to this mail thread
there was a remark "We should likely add a similar napi_gro_receive_list()
function."
For my understanding: When is it safe to replace a number of
napi_gro_receive() calls with netif_receive_skb_list() and when would we
need the new napi_gro_receive_list()?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-27 18:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-26 20:04 netif_receive_skb_list and interrupts enabled/disabled Heiner Kallweit
2019-03-27 8:20 ` Jesper Dangaard Brouer
2019-03-27 18:55 ` Heiner Kallweit
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).