On 2019-05-29 15:48:51 [-0700], Eric Dumazet wrote: > > + > > + fragsz = SKB_DATA_ALIGN(fragsz); > > + if (irqs_disabled()) { > > > What is the difference between this prior test, and the following ? > > if (in_irq() || irqs_disabled()) > > I am asking because I see the latter being used in __dev_kfree_skb_any()
in_irq() is always true in hardirq context which is true for non-NAPI drivers. If in_irq() is true, irqs_disabled() will also be true. So I *think* I could replace the irqs_disabled() check with in_irq() which should be cheaper because it just checks the preempt counter. Sebastian