netdev
[Top] [All Lists]

Re: More questions...

To: andrewm@xxxxxxxxxx (Andrew Morton)
Subject: Re: More questions...
From: kuznet@xxxxxxxxxxxxx
Date: Sun, 2 Apr 2000 18:57:23 +0400 (MSK DST)
Cc: netdev@xxxxxxxxxxx
In-reply-to: <38E7308B.F5DE5214@xxxxxxxxxx> from "Andrew Morton" at Apr 2, 0 04:13:14 pm
Sender: owner-netdev@xxxxxxxxxxx
Hello!

> - dev_kfree_skb_irq can be called from non-IRQ context
>   in 3c59x.c  This looks safe.  But should one
>   wrap the call in local_irq_save()/restore() for
>   future-safety?

No, you should not. See below.


> - Should dev_kfree_skb_irq() be doing a local_irq_save()
>   even though it's for IRQ context only?

There exist no such thing as "IRQ context". Each IRQ bucket
has its own context and they can overlap arbitrarily.
dev_kfree_skb_irq() simply enqueues skb to a per-cpu queue
shared by all the IRQs, so that it needs protection
against all the irqs.

Essentially, all "IRQ-safe" functions (another example is netif_rx())
may be safely called from any other context. Is it answer to the first
question?

Actually, it is even possible to design lighter scheme to move skb
destruction out of irqs, not using local_irq_save().

Alexey

<Prev in Thread] Current Thread [Next in Thread>